Since I try to run OpenCL backend on 2.4/nightly I have things I can’t understand and I can’t find reference there: rfcs/RFC-0037-Interoperability-Standard-of-3rd-Backend-Integration-Mechanism.md at 9bd181e74225af94547c9fefcbeeca1cae907193 · pytorch/rfcs · GitHub
I indeed need to change one of the Allocator method to non-cost but other issues keeps me failing.
After I load the module and run trivial test like this
import torch
import numpy as np
torch.ops.load_library("build/libpt_ocl.so")
torch.utils.rename_privateuse1_backend('ocl')
torch.utils.generate_methods_for_privateuse1_backend()
dev='ocl:0'
t1=torch.ones((20,10),device=dev)
It fails with an error:
File "/home/artik/Projects/dlprim_backend/test.py", line 8, in <module>
t1=torch.ones((20,10),device=dev)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'torch.ocl'
Same happens if I try to load it like this
import torch
import numpy as np
from build import ocl
torch.utils.rename_privateuse1_backend('ocl')
torch.utils.generate_methods_for_privateuse1_backend()
dev='ocl:0'
t1=torch.ones((20,10),requires_grad=True,device=dev)
or even try to add torch.ocl = ocl
line
What do I miss