Comfy-Org / Comfy-Org/ComfyUI

Torch hitting recompile limit

Open
#9,972 1 comment 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [ ] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

I expected it to not throw erros I guess?

### Actual Behavior

Errors in console, but generation works nonetheless (unclear how it is affected)

### Steps to Reproduce

Load ComfyUI default Wan2.1 t2v or i2v workflow. Add `TorchCompileModel` node after the `LoadDiffusionModel` node.

### Debug Logs

```powershell
W0921 18:31:43.172000 6084 Lib\site-packages\torch\_inductor\utils.py:1250] [9/0_1] Not enough SMs to use max_autotune_gemm mode
W0921 18:32:27.863000 6084 Lib\site-packages\torch\_dynamo\convert_frame.py:964] [9/64] torch._dynamo hit config.recompile_limit (64)
W0921 18:32:27.863000 6084 Lib\site-packages\torch\_dynamo\convert_frame.py:964] [9/64] function: '__call__' (ComfyUI\comfy\model_patcher.py:129)
W0921 18:32:27.863000 6084 Lib\site-packages\torch\_dynamo\convert_frame.py:964] [9/64] last reason: 9/63: self.key == 'diffusion_model.blocks.6.self_attn.v.weight'
W0921 18:32:27.863000 6084 Lib\site-packages\torch\_dynamo\convert_frame.py:964] [9/64] To log all recompilation reasons, use TORCH_LOGS="recompiles".
W0921 18:32:27.863000 6084 Lib\site-packages\torch\_dynamo\convert_frame.py:964] [9/64] To diagnose recompilation issues, see https://pytorch.org/docs/main/torch.compiler_troubleshooting.html.
```

### Other

Followed the steps to install triton and sageattention. Torch compile seems to work, but errors are randomly appearing in the console. Either this one with dynamo hitting the recompile limit, or another one. They are actually random, the same generation can run smoothly and the next try generate this log. Is it something to worry about or warnings that can be safely ignored?

It seems I have torch-2.7.1%2Bcu128-cp312-cp312-win_amd64.whl installed. But I have still using the comfy pack that had pyton 3.12 because I could not find how to install torch and sage for 3.13.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.