-
Notifications
You must be signed in to change notification settings - Fork 213
feat: Sharding implementation #1648
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
base: main
Are you sure you want to change the base?
Conversation
…d defn files. only the Mesh module has a standalone file now
nx/lib/nx/defn/shard/mesh.ex
Outdated
| defmodule Nx.Defn.Shard.Mesh do | ||
| defstruct [:name, :shape] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a moduledoc that explains what exactly shape is and why does the mesh have a name
nx/lib/nx/defn/compiler.ex
Outdated
| @doc """ | ||
| Callback for compilation. | ||
| Its main purpose is to compile a function for a given mesh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Its main purpose is to compile a function for a given mesh. | |
| Its main purpose is to compile a function for a given `Nx.Defn.Shard.Mesh`. |
If possible, can we also expand on why the third argument is [vars] instead of vars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the documentation. I also included your suggested changes manually
nx/lib/nx/defn/compiler.ex
Outdated
| @callback __to_backend__(keyword) :: {module, keyword} | ||
|
|
||
| @doc """ | ||
| Callback for compilation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Callback for compilation. | |
| Callback for compilation of a parallelizable computation. |
| @@ -0,0 +1,16 @@ | |||
| defmodule Nx.Defn.Shard.Mesh do | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| defmodule Nx.Defn.Shard.Mesh do | |
| defmodule Nx.Defn.Mesh do |
Let's avoid too deep nesting. So either Nx.Defn.Mesh or, if we feel it will be used outside of defn, Nx.Mesh.
First iteration of sharding support on Nx. Related to issue #645 pmap support