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

GPU-only Tensors #3

Open
Linux-cpp-lisp opened this issue May 31, 2021 · 2 comments
Open

GPU-only Tensors #3

Linux-cpp-lisp opened this issue May 31, 2021 · 2 comments

Comments

@Linux-cpp-lisp
Copy link

Hi all,

I'm considering trying to integrate acrotensor with PyTorch to use it in a model. It looks like it should be fairly trivial to create an acro::Tensor that references the GPU memory of some_pytorch_tensor.contiguous(); the only issue is Tensor.cpp:L192:

if (ddata != nullptr) {
      ACROBATIC_ASSERT(hdata != nullptr, "Acrotensor does not currently support GPU only tensors.");

It seems to me reading the rest of Tensor.cpp that this isn't actually true — it seems like as long as you never try to move the Tensor back to host it should be fine — but I was hoping to confirm this.

If anyone has previously tried to integrate this with PyTorch or has any thoughts on that, I'd also be grateful to hear them.

Thanks for your work on this library!

@acfisher
Copy link
Collaborator

I obviously haven't looked at this in quite a while and had no idea folks were looking at it. I believe that should work as long as you don't call anything that needs the data on the host. Did you end up giving it a try?

@Linux-cpp-lisp
Copy link
Author

Hi @acfisher ,

It's also been a long time since I looked at this, but I did implement PyTorch bindings at one point, which I think worked fine with regard to this issue. The code is here if you are interested: https://github.com/Linux-cpp-lisp/acrotensor/tree/pytorch.

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

No branches or pull requests

2 participants