[Ascend NPU] Trellis2 shape stage aborts: aten::max.dim has no INT32 kernel (EZ1001)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- machine-learning
Research direction
Start with comfy/ldm/trellis2/vae.py, especially SparseTensor.__cal_spatial_shape, where the report says coords[:, 1:].max(0) fails on Ascend NPU because aten::max.dim lacks an INT32 kernel. Check the reported dtype and existing tests for this shape calculation, then verify the Shape VAE decode workflow completes on Ascend; done means it produces the expected grid without the EZ1001 error.
Written by the indexing model from the issue text.
Description
Custom Node Testing
- 我用
--disable-all-custom-nodes复现过,问题依旧(只用了内置 Trellis2 节点)
Expected Behavior
Trellis2 的 Shape/Upsample 链在 Ascend NPU 上正常完成,产出网格。
Actual Behavior
Trellis2UpsampleStage 之后的 Shape VAE 解码在 comfy/ldm/trellis2/vae.py::SparseTensor.__cal_spatial_shape 处中断:
EZ1001: ... aclnnMaxDim ...
(Ascend 侧 aten::max.dim 只注册了 FLOAT / FP16 / INT64 / BOOL / BF16,没有 INT32;该阶段的 coords 来自 sparse latent,dtype 是 int32,因此直接失败。)
补 int64 转换后同一 Workflow 三阶段全部通过,说明不是模型或权重问题。
Steps to Reproduce
- Ascend 910B2(CANN 9.1.0,torch 2.10.0+cpu,torch_npu 2.10.0.post4,Python 3.12.13)
- 启动 ComfyUI(commit
ee34406f),加载 TRELLIS.2 原生节点链 - 提交
Trellis2ShapeStage → KSampler → Trellis2UpsampleStage → VaeDecodeShapeTrellis - Shape 阶段的 VAE 解码在
__cal_spatial_shape抛错
Proposal
一处一行的改动即可,值不变(coords 是非负体素索引):
- return torch.Size((coords[:, 1:].max(0)[0] + 1).tolist())
+ return torch.Size((coords[:, 1:].long().max(0)[0] + 1).tolist())
如果维护者更希望由后端解决,这条也可以只作为 workaround 关闭;但 int32 输入在 CUDA 上本来就少见,转 int64 对 CUDA/CPU 无副作用。
Debug Logs
[完整 server 日志见附件;崩溃点前最后一行是 Trellis2UpsampleStage 完成,随后进入 VaeDecodeShapeTrellis]
EZ1001: ... aclnnMaxDim ...
- Dominant language
- Python
- Stars
- 150k
- Forks
- 17.9k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 181
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Comfy-Org/ComfyUI
-
UnboundLocalError on a dangling symlink in custom_nodesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Feature
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
ModelMergeSimple and all merge nodes are O(N²)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Comfy-Org/ComfyUI#17823 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
ROCm gfx1100: contiguous-k/v SDPA workaround is gfx1151-only, MiniMax H3 sampling 2.2x slower on RX 7900 XTXPossibly taken @TwelveNights claimed this 25 days ago. OpenPotential Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in Comfy-Org/ComfyUI
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day