tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

[BUG] unable to compile f3 in torch.compile tutorial

Open tttiago opened this issue 4 months ago • 0 comments

Add Link

https://docs.pytorch.org/tutorials/intermediate/torch_compile_tutorial.html

Describe the bug

When I run the cell

compile_f3 = torch.compile(f3)
print("compile 3:", test_fns(f3, compile_f3, (inp2,)))

in the tutorial, I get the warnings show in the tutorial, but also an error

InternalTorchDynamoError: AttributeError: 'str' object has no attribute 'IF_NEEDED'

from user code:
   File "/home/tiago/miniforge3/envs/pytorch/lib/python3.12/site-packages/scipy/fft/_realtransforms_backend.py", line 15, in torch_dynamo_resume_in__execute_at_12
    return xp.asarray(y)
  File "/home/tiago/miniforge3/envs/pytorch/lib/python3.12/site-packages/scipy/_lib/array_api_compat/numpy/_aliases.py", line 113, in asarray
    return np.array(obj, copy=copy, dtype=dtype, **kwargs)  # pyright: ignore

This also happened when I ran the tutorial in Google Colab.

Describe your environment

  • Plataform: Ubuntu 24.04.3
  • CUDA 12.9
  • pytorch 2.7.1

cc @williamwen42 @msaroufim @anijain2305

tttiago avatar Sep 10 '25 15:09 tttiago