Skip to content

Commit

Permalink
Improve docs around node transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Sep 2, 2024
1 parent ab9f2d1 commit a0bea9a
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions exla/lib/exla.ex
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ defmodule EXLA do
To increase the stack size of dirty IO threads from 40 kilowords to
128 kilowords. In a release, you can set this flag in your `vm.args`.
## Distribution
EXLA allows its tensors to be sent across nodes, as long as the parent
node (which effectively holds the tensor) keeps a reference to the
tensor while it is read by any other node it was sent to.
The result of `EXLA.compile/3` can also be shared across nodes.
On invocation, the underlying executable is automatically serialized
and sent to other nodes, without requiring a full recompilation,
as long as the same conditions as above apply.
## Docker considerations
EXLA should run fine on Docker with one important consideration:
Expand Down Expand Up @@ -274,11 +285,11 @@ defmodule EXLA do
[2, 4, 6]
>
Results are allocated on the `EXLA.Backend`. Note that the
`EXLA.Backend` is asynchronous: operations on its tensors
*may* return immediately, before the tensor data is available.
The backend will then block only when trying to read the data
or when passing it to another operation.
The returned function can be sent across nodes, as long as the parent
node (which effectively holds the function) keeps a reference to the
function while it is invoked by any other node it was sent to. On
invocation, the underlying executable is automatically serialized
and sent to other nodes, without requiring a full recompilation.
See `jit/2` for supported options.
"""
Expand Down

0 comments on commit a0bea9a

Please sign in to comment.