Skip to content

Commit d842b33

Browse files
wsmosesgithub-actions[bot]giordano
authored
Multiple device error (#690)
* Multiple device error * Update src/Compiler.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/Compiler.jl Co-authored-by: Mosè Giordano <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mosè Giordano <[email protected]>
1 parent b506bfc commit d842b33

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Compiler.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,13 @@ function compile_xla(f, args; client=nothing, optimize=true, no_nan=false, devic
10491049
end
10501050
end
10511051

1052+
num_devices = XLA.ClientNumAddressableDevices(client)
1053+
if num_devices != 1
1054+
error(
1055+
"Unsupported client with multiple addressible devices (we need to pass right shard data)",
1056+
)
1057+
end
1058+
10521059
# compile MLIR module to XLA executable
10531060
exec = XLA.Compile(client, mod)
10541061
(

0 commit comments

Comments
 (0)