Skip to content

docs for npu support#34

Merged
addsubmuldiv merged 6 commits intodevfrom
doc_npu
Feb 6, 2026
Merged

docs for npu support#34
addsubmuldiv merged 6 commits intodevfrom
doc_npu

Conversation

@addsubmuldiv
Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @addsubmuldiv, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces new documentation aimed at guiding users through the integration of the Twinkle framework with Huawei Ascend NPU hardware. The added guides cover the entire process from environment setup and installation to running specific training examples, understanding NPU-specific configurations, and reviewing feature compatibility. This significantly enhances the framework's usability for users leveraging Ascend NPUs for deep learning tasks, providing a clear path to get started and troubleshoot common issues.

Highlights

  • NPU Support Documentation: Added comprehensive documentation for setting up and utilizing the Twinkle framework within Huawei Ascend NPU environments, available in both Chinese and English.
  • Installation and Verification Guide: Provided detailed instructions for installing the NPU environment, including dependencies like Ascend drivers, CANN toolkit, PyTorch, and torch_npu, along with a script to verify successful installation.
  • Quick Start Examples: Included quick-start guides and verified code examples for common deep learning tasks such as SFT LoRA fine-tuning and GRPO reinforcement learning on NPU.
  • NPU-Specific Configurations: Documented essential NPU-specific configurations, including environment variables, device mesh setup, and device group configurations for distributed training.
  • Feature Compatibility Matrix: Presented a clear feature support matrix outlining the verification status of various parallelism strategies (DP, FSDP, TP, PP) and other functionalities (QLoRA, Flash Attention) when running on NPU compared to GPU.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/source/GetStarted/NPU-setup.md
    • New documentation file providing a comprehensive guide for NPU (Ascend) setup in Chinese.
  • docs/source_en/GetStarted/NPU-setup.md
    • New documentation file providing a comprehensive guide for NPU (Ascend) setup in English.
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request since its creation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds comprehensive documentation for setting up and using the Twinkle framework on Ascend NPUs. The documentation is provided in both Chinese and English, covering environment requirements, installation, usage examples, and troubleshooting. The guides are well-structured and detailed. My review focuses on improving the clarity and accuracy of external links to ensure users have a smooth setup experience. I've suggested updates to several links that were either pointing to outdated versions, non-direct pages, or incorrect language versions.

**问题**:CANN 版本与 torch_npu 不兼容。

**解决方案**:
- 参考[昇腾社区版本配套表](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC1alpha002/softwareinstall/instg/atlasdeploy_03_0015.html)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The link to the "昇腾社区版本配套表" (Ascend Community Version Compatibility Table) points to a documentation page for a specific and potentially outdated version of CANN (80RC1alpha002). This can be confusing for users, especially since the guide recommends CANN 8.3.RC1 or higher. It's better to link to a more general version mapping page that is kept up-to-date.

Consider using a link like https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/versionmmapping.html.

Suggested change
- 参考[昇腾社区版本配套表](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC1alpha002/softwareinstall/instg/atlasdeploy_03_0015.html)
- 参考[昇腾社区版本配套表](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/versionmmapping.html)

## 参考资源

- [昇腾社区官网](https://www.hiascend.com/)
- [CANN 软件安装指南](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC1alpha002/softwareinstall/instg/atlasdeploy_03_0001.html)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This link to the CANN Software Installation Guide is for a specific, outdated version (80RC1alpha002). This can mislead users. Please link to the main documentation portal where users can select the appropriate version for their setup.

A better link would be the main software installation page for the latest version: https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/latest/softwareinstall/instg/atlasdeploy_03_0001.html.

Suggested change
- [CANN 软件安装指南](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC1alpha002/softwareinstall/instg/atlasdeploy_03_0001.html)
- [CANN 软件安装指南](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/latest/softwareinstall/instg/atlasdeploy_03_0001.html)

**Problem**: CANN version incompatible with torch_npu.

**Solution**:
- Refer to [Ascend Community version compatibility table](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC1alpha002/softwareinstall/instg/atlasdeploy_03_0015.html)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The link to the "Ascend Community version compatibility table" points to a Chinese documentation page for a specific and outdated CANN version (80RC1alpha002). This is incorrect for an English document and can be confusing. Please use an up-to-date, English link.

Consider using the English version mapping table: https://www.hiascend.com/document/detail/en/CANNCommunityEdition/versionmmapping.html.

Suggested change
- Refer to [Ascend Community version compatibility table](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC1alpha002/softwareinstall/instg/atlasdeploy_03_0015.html)
- Refer to [Ascend Community version compatibility table](https://www.hiascend.com/document/detail/en/CANNCommunityEdition/versionmmapping.html)

## References

- [Ascend Community Official Website](https://www.hiascend.com/)
- [CANN Software Installation Guide](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC1alpha002/softwareinstall/instg/atlasdeploy_03_0001.html)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This link to the CANN Software Installation Guide points to a Chinese page for an outdated version (80RC1alpha002). This should be corrected to point to the latest English documentation.

A better link would be: https://www.hiascend.com/document/detail/en/CANNCommunityEdition/latest/softwareinstall/instg/atlasdeploy_03_0001.html.

Suggested change
- [CANN Software Installation Guide](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC1alpha002/softwareinstall/instg/atlasdeploy_03_0001.html)
- [CANN Software Installation Guide](https://www.hiascend.com/document/detail/en/CANNCommunityEdition/latest/softwareinstall/instg/atlasdeploy_03_0001.html)


NPU 环境的安装包括昇腾驱动、CANN 工具包、PyTorch 和 torch_npu。

**📖 完整安装教程**:[torch_npu 官方安装指南](https://gitcode.com/Ascend/pytorch/overview)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The link to the torch_npu installation guide points to the project's overview page. For a better user experience, it would be more helpful to link directly to the installation documentation. Also, for consistency with other links in this file (e.g., line 327), consider using the GitHub repository link instead of GitCode.

A more direct link would be: https://github.com/Ascend/pytorch/blob/master/docs/zh/install.md.

Suggested change
**📖 完整安装教程**[torch_npu 官方安装指南](https://gitcode.com/Ascend/pytorch/overview)
**📖 完整安装教程**[torch_npu 官方安装指南](https://github.com/Ascend/pytorch/blob/master/docs/zh/install.md)


NPU environment installation includes Ascend driver, CANN toolkit, PyTorch, and torch_npu.

**📖 Complete Installation Guide**: [torch_npu Official Installation Guide](https://gitcode.com/Ascend/pytorch/overview)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The link to the torch_npu installation guide points to the project's overview page on GitCode. For a better user experience and consistency with other links (e.g., line 327 which uses GitHub), it would be more helpful to link directly to the English installation documentation on GitHub.

A more direct link would be: https://github.com/Ascend/pytorch/blob/master/docs/en/install.md.

Suggested change
**📖 Complete Installation Guide**: [torch_npu Official Installation Guide](https://gitcode.com/Ascend/pytorch/overview)
**📖 Complete Installation Guide**: [torch_npu Official Installation Guide](https://github.com/Ascend/pytorch/blob/master/docs/en/install.md)

@addsubmuldiv addsubmuldiv marked this pull request as ready for review February 5, 2026 12:37
Copilot AI review requested due to automatic review settings February 5, 2026 12:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive documentation for NPU (Huawei Ascend) support in the Twinkle framework, providing both English and Chinese versions of the setup guide.

Changes:

  • Added English NPU setup guide with installation instructions, requirements, examples, and troubleshooting
  • Added Chinese NPU setup guide (translation of the English version)
  • Documents supported hardware, parallelism strategies, and feature support matrix for NPU environments

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/source_en/GetStarted/NPU-setup.md English documentation for NPU setup, including installation steps, verification, quick start examples, parallelism strategies, troubleshooting, and references
docs/source/GetStarted/NPU-setup.md Chinese translation of the NPU setup guide with identical content structure and information

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +307 to +308
- 📖 Read [Quick Start](Quick-start.md) for more training examples
- 📖 Read [Installation Guide](Installation.md) for other platform installations
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references "Installation.md" and "Quick-start.md" files that do not exist in the docs/source_en/GetStarted/ directory. These links will be broken for readers of the English documentation. Consider either creating these files in the English documentation directory or updating the links to point to valid resources (such as the Chinese versions or external documentation).

Suggested change
- 📖 Read [Quick Start](Quick-start.md) for more training examples
- 📖 Read [Installation Guide](Installation.md) for other platform installations
- 📖 Read the **Quick Start** section in [Twinkle Documentation](https://twinkle.readthedocs.io/) for more training examples
- 📖 Read the **Installation Guide** in [Twinkle Documentation](https://twinkle.readthedocs.io/) for other platform installations

Copilot uses AI. Check for mistakes.
@addsubmuldiv addsubmuldiv merged commit a91aa70 into dev Feb 6, 2026
6 checks passed
@tastelikefeet tastelikefeet deleted the doc_npu branch February 13, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants