Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mlx::compile for the Nx.Defn compiler #61

Open
polvalente opened this issue Nov 30, 2024 · 0 comments · May be fixed by #68
Open

Use mlx::compile for the Nx.Defn compiler #61

polvalente opened this issue Nov 30, 2024 · 0 comments · May be fixed by #68

Comments

@polvalente
Copy link
Collaborator

MLX uses an abstraction for compiling Python functions: https://github.com/ml-explore/mlx/blob/974bb54ab2f8e8450f856ac215df160374080b33/python/src/transforms.cpp#L370C8-L370C21

We can copy most of that workflow to get a similarly-compiled defn function in EMLX.compile. EMLX can get the (vector) -> vector function pointer as a NIF resource, cache that in the compiler key and use it for the Elixir function as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant