NVIDIA / NVIDIA/TransformerEngine
Increase MAX_TENSOR_NUM
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 831
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 65
Description
The original setting in transformer_engine/common/transformer_engine.cpp is:
const size_t MAX_TENSOR_NUM = 20 * 1024 * 1024 / sizeof(Tensor);
When I used TransformerEngine for LoRA fine-tuning Qwen3-Next, which has many experts (512+1), I encountered this error:
transformer_engine.cpp:249 in function Allocate: Cannot allocate a new NVTETensor. Maximum number of tensors reached: 81920. There is probably a memory leak in your application.
We may need to increase this hard-coded limit.
Contributor 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.
Research direction
Start in transformer_engine/common/transformer_engine.cpp and inspect the MAX_TENSOR_NUM constant and the Allocate path that reports the limit. Reproduce or validate against the reported LoRA fine-tuning workload for Qwen3-Next, then confirm that the new limit avoids the maximum-tensor error without introducing a new allocation failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100