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

Reading wrong binary from device #71

Closed
josevalim opened this issue Nov 30, 2020 · 0 comments · Fixed by #72
Closed

Reading wrong binary from device #71

josevalim opened this issue Nov 30, 2020 · 0 comments · Fixed by #72
Milestone

Comments

@josevalim
Copy link
Collaborator

If you wrap the contents of this test in a for:

https://github.com/elixir-nx/exla/blob/main/test/exla/nx_device_test.exs#L4

Like this:

  test "transfers data from nx<->device" do
    for _ <- 1..10000 do
    t = Nx.tensor([1, 2, 3, 4])

Then it fails with a 100% certainty for me. I think we are doing either one of:

  1. When sending data to the device, we are using zero-copy (which we shouldn't, we should only do zero-copy on run, since we know the binary can't be GCed meanwhile)

  2. When reading the data for a CPU device, we are pointing to a place in memory instead of allocating an Erlang binary (unlikely?)

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