NVIDIA / NVIDIA/cuEquivariance

cuequivariance_torch.Linear failed in AOTI export

Open
#282 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
433
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Dear developers, I am trying to use torch._inductor.aoti_compile_and_package to export my models. However, when I use the default AOTI settings(i.e. always_keep_tensor_constants=False) An error happened:"torch._inductor.exc.InductorError: LoweringException: AttributeError: 'Constant' object has no attribute 'data'
target: aten.unsqueeze.default
args[0]: Constant(dtype=torch.float32, device=device(type='cuda', index=0), value=0.1767766922712326)
args[1]: 0" 0.17677 is sqrt value of 1/32 ,which is consistent with input 32x0e and output 32x0e. The error is solved by setting always_keep_tensor_constants=True for AOTI. Although I am new to AOTI, I manage to confirm this error happened in cuequivariance_torch.Linear module with the help of codex.

To Reproduce
Use the script I upload (generated by codex) and run
python cuet_aoti_minimal_repro.py --device cuda:0 --dtype float32 --dump-graphs for reproducing the error
python cuet_aoti_minimal_repro.py --device cuda:0 --dtype float32 --keep-tensor-constants for temporarily solving the error.

cuet_aoti_minimal_repro.py

Screenshots

Image Image Image

GPU HW/SW(please complete the following information):
Torch == 2.12.0 +cu126 (2.10.0 also confirm this bug)
cuequivariance_version : 0.10.0
GPU : RTX4090
System : Ubuntu 22.04
Additional context
If failing at some CUDA source file, please run compute-sanitizer and share CUDA coredump for us to analyze the exact problem. Please do this especially if you don't have a reproducer to share with us.

Add any other context about the problem here.

Contributor guide

Open the contributing guide

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.

Research direction

Run cuet_aoti_minimal_repro.py with CUDA and the default AOTI settings, then compare it with --keep-tensor-constants. Start at cuequivariance_torch.Linear and the aten.unsqueeze.default lowering failure involving a Constant without data; done means the default export completes without requiring always_keep_tensor_constants=True.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.