Skip to content

[CICD] Add Ascend NPU unit test support#91

Open
AlexMa616 wants to merge 12 commits into
flagos-ai:mainfrom
BrianPei:feature/ascend-unit-ci
Open

[CICD] Add Ascend NPU unit test support#91
AlexMa616 wants to merge 12 commits into
flagos-ai:mainfrom
BrianPei:feature/ascend-unit-ci

Conversation

@AlexMa616

Copy link
Copy Markdown

Summary

This PR adds Ascend NPU Unit CI support for TransformerEngine-FL through torch_npu and the FlagOS backend. It extends the existing CI workflow to execute real TE workloads and selected shared PyTorch tests on Ascend 910C.

Changes

Ascend NPU testing

Add real NPU coverage for:

Linear forward and backward
LayerNorm, RMSNorm, and LayerNormLinear
LayerNormMLP
GEMM, softmax, and multi-tensor operations
Unfused Dot Product Attention and MultiheadAttention
TransformerLayer debug and ONNX export paths
Reuse selected portable sanity and numerics tests from the existing PyTorch suites.

Distributed testing

Add support for:

Two-process HCCL execution
TE Linear gradient synchronization
Context Parallel utility tests
Initial non-FP8 distributed numerical validation
CI and coverage

Add Ascend-specific Unit test entry points.
Add raw and aggregated coverage collection.
Fail explicitly when torch_npu or flag_gems is unavailable.
Keep unsupported CUDA-specific features explicitly excluded.
Testing

Verified on Ascend 910C:

PyTorch Unit test execution passed.
PyTorch Debug passed.
PyTorch ONNX passed.
PyTorch Distributed is under validation.
The current PyTorch Unit job failure occurred during coverage artifact upload after the test execution had passed.

Limitations

CUDA Graphs, Flash/Fused Attention, FP8, MXFP8, NVFP4, block scaling, TensorRT integration, and Integration tests are not included in the current Ascend Unit scope.

Comment thread .github/configs/ascend.yml Outdated
display_name: 'Huawei Ascend NPU'

# CI image for the Ascend environment
ci_image: harbor.baai.ac.cn/transformerengine-fl/flagscale:te-fl-triton311

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rename the ci_image in accordance with the FlagCICD container image solution

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

updated

Comment thread .github/workflows/unit_tests_common.yml Outdated

# Ascend installs the Python/plugin layer and does not need CUDA submodules
- name: Checkout Source Code on Ascend
if: inputs.platform == 'ascend'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Check if you can merge these three Checkout Source Code steps into one. Pulling source code shouldn't be a platform-related operation

Comment thread .github/workflows/unit_tests_common.yml Outdated
# Coverage setup: Ascend unit jobs must always produce raw coverage.
COVERAGE_ENABLED=false
if pip3 install coverage pytest-cov --quiet 2>/dev/null; then
if [ "${{ inputs.platform }}" = "ascend" ]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Better preinstall dependencies in the image and reduce platform-related implementation in the workflow

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

updated

@CLAassistant

CLAassistant commented Jul 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

5 participants