[Ascend NPU] Trellis2 shape stage aborts: aten::max.dim has no INT32 kernel (EZ1001)

Open Beginner friendly
#17,816 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@harmehak0173 is already working on this.

Since Nov 23, 2026.

  • #17942 by @harmehak0173 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, pytorch

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
  1. Ascend 910B2(CANN 9.1.0,torch 2.10.0+cpu,torch_npu 2.10.0.post4,Python 3.12.13)
  2. 启动 ComfyUI(commit ee34406f),加载 TRELLIS.2 原生节点链
  3. 提交 Trellis2ShapeStage → KSampler → Trellis2UpsampleStage → VaeDecodeShapeTrellis
  4. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Comfy-Org/ComfyUI

All issues in Comfy-Org/ComfyUI

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.