You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Frontend] Single-CPU runs crash: extension_codecache.py calls future.result() on the str AsyncCompile.submit returns inline #542
With only one usable CPU, every simulated kernel launch on the master frontend crashes with AttributeError: 'str' object has no attribute 'result'.
MLIRAsyncCompile.mlir() in PyTorchSimFrontend/extension_codecache.py assumes self.submit(task) returns a Future, then calls future.result() (line 284 on master @ 509f425, and the same line in release v1.1.0).
Inductor's AsyncCompile.submit() does not return a Future when compile_threads <= 1. In that case it runs the
task inline and returns its result, which here is the key str:
Inductor sets compile_threads from the number of usable CPUs, so this happens on any 1-CPU container, Slurm job
or cgroup (for example docker run --cpuset-cpus 0, or srun -c 1).
compile_threads 1
...
File "/workspace/PyTorchSim/PyTorchSimFrontend/extension_codecache.py", line 284, in run_kernel_simulation
key = future.result()
^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'result'
The same command with TORCHINDUCTOR_COMPILE_THREADS=2 (or with two or more CPUs) passes.
Activity