torch icon indicating copy to clipboard operation
torch copied to clipboard

Is torch.jit.fork supported inside torch::jit_compile?

Open PhDyellow opened this issue 1 year ago • 1 comments

Thank you for torch, switching to GPU powered tensors has dramatically sped up my analyses!

I was wondering if torch.jit.fork is supported. I get

Error in cpp_jit_compile(source) : 
attribute lookup is not defined on builtin:
  File"<string>", line 3

def fails () :
  torch.jit.fork()

I may be using it incorrectly, the examples from pytorch are wrapped in python code rather than a call to torch::jit_compile.

PhDyellow avatar Jul 08 '23 14:07 PhDyellow

Our implementation of jit_compile is a very thin wraper around LibTorch's torch::jit::compile and I am not sure I fully understand how it works internally. I opened: https://discuss.pytorch.org/t/fork-and-wait-within-libtorchs-torch-compile/183892 to hopefully understand more what we could do to make this work.

dfalbel avatar Jul 10 '23 22:07 dfalbel