[PR #160] Remove the torch._dynamo import, dead since #3 removed its only user #188

Open
opened 2026-10-26 22:21:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/160
Author: @PozzettiAndrea
Created: 9/6/2026
Status: 🔄 Open

Base: main ← Head: k1-drop-dynamo-import


📝 Commits (1)

  • c7adcc8 Remove the torch._dynamo import, dead since #3 removed its only user

📊 Changes

1 file changed (+0 additions, -1 deletions)

View changed files

📝 comfy_kitchen/tensor/base.py (+0 -1)

📄 Description

$ grep -rn "torch\._dynamo" comfy_kitchen/ tests/
comfy_kitchen/tensor/base.py:13:import torch._dynamo

That is the only reference left in the package. The @torch._dynamo.disable()
decorator that needed it went away in #3 (06651e3).

_dynamo is in torch's _lazy_modules, so torch.compile and the
torch._disable_dynamo wrapper still import it themselves on first use, and compiled
and exported results are bit identical with and without the line on torch 2.8 and
2.11. Dropping it takes import comfy_kitchen from 1981 loaded modules to 1179 on
torch 2.8, for every process that imports the package without running a kernel.

ruff check . clean. pytest tests/ on CPU: 616 passed, same single pre-existing
torch 2.8 failure as unmodified main.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-kitchen/pull/160 **Author:** [@PozzettiAndrea](https://github.com/PozzettiAndrea) **Created:** 9/6/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `k1-drop-dynamo-import` --- ### 📝 Commits (1) - [`c7adcc8`](https://github.com/Comfy-Org/comfy-kitchen/commit/c7adcc88193ca15afc74fec6e8cd38cbedba4247) Remove the torch._dynamo import, dead since #3 removed its only user ### 📊 Changes **1 file changed** (+0 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `comfy_kitchen/tensor/base.py` (+0 -1) </details> ### 📄 Description $ grep -rn "torch\._dynamo" comfy_kitchen/ tests/ comfy_kitchen/tensor/base.py:13:import torch._dynamo That is the only reference left in the package. The `@torch._dynamo.disable()` decorator that needed it went away in #3 (06651e3). `_dynamo` is in torch's `_lazy_modules`, so `torch.compile` and the `torch._disable_dynamo` wrapper still import it themselves on first use, and compiled and exported results are bit identical with and without the line on torch 2.8 and 2.11. Dropping it takes `import comfy_kitchen` from 1981 loaded modules to 1179 on torch 2.8, for every process that imports the package without running a kernel. `ruff check .` clean. `pytest tests/` on CPU: 616 passed, same single pre-existing torch 2.8 failure as unmodified main. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-kitchen#188
No description provided.