NVIDIA / NVIDIA/TransformerEngine
Examples: Using TE with LLaMA-Factory
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 831
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 65
Description
Is your feature request related to a problem? Please describe.
When trying to integrate TE FP8 training with frameworks built on Hugging Face Trainer (like LLaMA-Factory), because there's no documentation showing the correct integration pattern, this led to bugs in LLaMA-Factory where:
- FP8 training silently fell back to BF16
- When FP8 was activated, it used torchao backend instead of TE
Without official documentation showing best practices for framework integration, it was implemented incorrectly, leading to poor user experiences and TE getting blamed for performance issues that are actually integration bugs.
Related issue: https://github.com/hiyouga/LLaMA-Factory/issues/9500
Describe the solution you'd like
Add official documentation/examples in the TE repository showing how to integrate TE with frameworks built on Hugging Face Trainer. Specifically:
- Integration Guide Page covering:
- Architecture: TE → HF Accelerate → HF Trainer
- Why config files are recommended over programmatic setup
- Common pitfalls when wrapping Trainer
- Framework-Specific Examples:
- examples/llamafactory/ - LLaMA-Factory integration
- examples/axolotl/ - Axolotl integration example
Describe alternatives you've considered
N/A
Additional context
Key Findings:
- When properly configured, TE delivers the expected 1.3-1.5x speedup on H100/B200
- The accelerate launch --config_file approach is more reliable than programmatic config
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 with the requested integration path, accelerate launch --config_file, and the proposed examples/llamafactory/ and examples/axolotl/ directories. Document the TE → HF Accelerate → HF Trainer architecture, explain why configuration files are preferred, and cover the listed Trainer-wrapping pitfalls. Done means the guide and both framework examples clearly show reliable TE FP8 setup and avoid BF16 fallback or torchao selection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation, machine-learning
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100