Skip to content

Commit

Permalink
Bubble up exceptions in EXLA.DeviceBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Aug 27, 2024
1 parent 3aac796 commit 1784b0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exla/lib/exla/defn/buffers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ defmodule EXLA.Defn.Buffers do
case data do
%EXLA.Backend{buffer: %EXLA.DeviceBuffer{ref: ref} = buffer}
when node(ref) != node() ->
binary = :erpc.call(node(ref), EXLA.DeviceBuffer, :read, [buffer])
try do
:erpc.call(node(ref), EXLA.DeviceBuffer, :read, [buffer])
catch
:error, {:exception, reason, stacktrace} ->
reraise Exception.normalize(:error, reason, stacktrace), stacktrace
end

EXLA.BinaryBuffer.from_binary(binary, to_typespec(tensor))

%EXLA.Backend{buffer: %EXLA.DeviceBuffer{} = buffer}
Expand Down

0 comments on commit 1784b0d

Please sign in to comment.