Closed GreatestTrain closed 1 year ago
Can you clarify somethings:
Is this working?
import torch
torch.ops.load_library("/home/rml/Desktop/pytorch_dlprim/build/libpt_ocl.so")
t = torch.tensor((5.,1.,2.), dtype=torch.float32).to("privateuseone:1")
print(t)
Cause it worked for me. What is the workaround you suggested?
Regarding installation. I indeed hadn't added proper installation procedure, I'd rather want to do something like import torch_opencl
but hadn't got to it yet.
Nevermind, seems like a jupyter-specific bug.
Works as normal in python and ipython shell.
(pytorch) notebooks[master*] % python test.py
Accessing device #1:gfx1010:xnack- on AMD Accelerated Parallel Processing
tensor([5.0000e+00, 1.0000e+00, 2.0000e+00], device='privateuseone:1')
(pytorch) notebooks[master*] % ipython test.py
Accessing device #1:gfx1010:xnack- on AMD Accelerated Parallel Processing
tensor([5.0000e+00, 1.0000e+00, 2.0000e+00], device='privateuseone:1')
Is just that jupyter seems to not be working.
Anyway, thanks for your time.
Hello.
I am trying to test this backend outside of the test provided in this repository.
But get an error trying to create a tensor inside "privateuseone:1" device
python mnist.py --device ocl:1
runs just fine.Checking the build folder I noticed that
libpt_ocl.so
is linked to an shared object located on build folder:(builded with
-DCMAKE_PREFIX_PATH=~/.conda/envs/pytorch/lib/python3.10/site-packages/torch/share/cmake/Torch
)make install DESTDIR=~/.conda/envs/pytorch/
just copies .so and .hpp files from dlprim but no _libptocl file.Adding the next lines in
mnist.py
after line 148 prints the expected tensor:clinfo --list: