Skip to content

Fix the integer overflow in fused softmax - #60

Merged
ptrendx merged 1 commit into
NVIDIA:mainfrom
ptrendx:pr_softmax_overflow
Jan 27, 2023
Merged

ptrendx merged 1 commit into
NVIDIA:mainfrom
ptrendx:pr_softmax_overflow

Conversation

@ptrendx

@ptrendx ptrendx commented Jan 26, 2023

Copy link
Copy Markdown
Member

Based on the same fix in APEX made by @cyanguwa (NVIDIA/apex#1568)

Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
@ptrendx
ptrendx requested a review from ksivaman January 26, 2023 22:48
@ptrendx

ptrendx commented Jan 26, 2023

Copy link
Copy Markdown
Member Author

/te-ci

@ksivaman ksivaman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ptrendx

ptrendx commented Jan 27, 2023

Copy link
Copy Markdown
Member Author

The failure in CI is unrelated (precision issue in ONNX export).

@ptrendx
ptrendx merged commit f63b27e into NVIDIA:main Jan 27, 2023
cyanguwa pushed a commit to cyanguwa/TransformerEngine that referenced this pull request Feb 13, 2023
Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>
ksivaman added a commit that referenced this pull request Feb 22, 2023
* add flash attention to TransformerLayer

Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Add docs for FP8 calibration (#61)

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Fix the integer overflow in fused softmax (#60)

Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* prefix flash attn env var with NVTE_

Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Address steady memory increase and bloated checkpoints (#63)

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* fix env var logic

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* fix flash attn env var logic again

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* remove d2d copies (#64)

* remove d2d copies

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* cleanup

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

---------

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Increase number of FP8 tensors per GEMM (#22)

* Increase number of FP8 tensors per GEMM

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Enable FP8 output tensor for fp8_gemm

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* [BERT FP8] Initial TE review comments

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Temporary fix for cuda graph non convergence

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Address review comments-2

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Review comments-3

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Cleanup

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Change for New API

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Remove unnecessary clone for D_scale, D_amax

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Avoid Roll for AMAX history size = 1

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Update onnx_te_gemm API

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Fix Lint errors

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

---------

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Bug fixes from PR 22 (#65)

* Bug fixes from PR 22

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Add FP8 tests to ci

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* bundle unittests for ci

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

---------

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* replace rearrange with transpose

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* QKV parameters unfused path fixes and optimization (#66)

* Bug fixes from PR 22

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Add FP8 tests to ci

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Better QKV parameter fusion

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* small fix

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* keep original param for unfused case to retain externally set attrs

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* lint fix

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Fix ONNX exports

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* improve arg naming

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* No need to set data pointers

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* lint

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Assert memory loc in NoopCat

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Handle case of different memory in param and buffer

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix assert always true

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Reassign params memory to avoid more concats

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

---------

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Fix gradients when using AMP (#70)

retain grad related attrs while casting

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* fix pylint violations 

fixed pyline violations such as trailing white spaces and too long lines 

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>

* fix pylint violation on line 264 with R1719

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>

* fix two more pylint violations

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>

* DotProductAttention API

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Add docs for attention

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix assert always true

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* check for correct flash-attn version

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* address review comments

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* lint+build fixes, correct settings for default flash-attn

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* correct version

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* review comments and fixes

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix onnx and disable flash-attn export test

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* remove einops dependency

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* cleanup internal API; rm duplication

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* only install TE wheel (exclude flash-attn to rm conflicts)

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* forgot to change install wheel path

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* next round review comments

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix flash_attn output

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix QK layer scaling

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* update docs

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* review comments and fixes to selective checkpointing

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

---------

Signed-off-by: Charlene Yang <charleney@nvidia.com>
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: cyanguwa <cyang.uwa@gmail.com>
Co-authored-by: Charlene Yang <charleney@nvidia.com>
Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
zhiyu-deep pushed a commit to zhiyu-deep/TransformerEngine that referenced this pull request Sep 3, 2024
…lows the variant pack to be mentioned as pair of "uid, device pointer". In order to use this, the expectation is user will provide the uid for the tensors created. (NVIDIA#60)

```
error_t
cudnn_frontend::graph::Graph::execute(cudnnHandle_t handle,
            std::unordered_map<int64_t, void*>& tensor_to_pointer_map, void *workspace) const;
```

[New API] Serialization: Graph class can now be serialized once the final plan is built. The corresponding deserialized plan requires the handle to be created on the same device the original graph was created with. Serialization is only supported on Runtime compiled engines. This support may be extended to other engines in future. New samples showcasing this have been added in `samples/cpp/serialization.cpp`

```
error_t
cudnn_frontend::graph::Graph::serialize(std::vector<uint8_t>& data) const;

error_t
cudnn_frontend::graph::Graph::deserialize(cudnnHandle_t handle,
                   std::vector<uint8_t> const& data);
```

[New API] Autotuning: If the graph allows multiple engine configs for a given topology, each of this can now be built and executed in parallel. The expected flow is user queries the number of plans present and spawns a new thread for each plan to be finalized in parallel. The set of APIs to support this are as follows:

```
int64_t
Graph::get_execution_plan_count() const;

error_t
Graph::build_plan_at_index(cudnnHandle_t const &handle, int64_t index);

error_t
Graph::execute_plan_at_index(cudnnHandle_t const &handle,
                         std::unordered_map<int64_t, void*>& ,
                         void* workspace,
                         int64_t plan_index) const;

int64_t
get_workspace_size_plan_at_index(int64_t plan_index) const;
```

[New feature] sdpa_node now allows ragged offset to be set in the input and output tensors.

[Bug Fix] Certain parts of the FE code, used to throw excpetion even with `DISABLE_EXCEPTION` flag set. This has been cleaned up.

[Bug Fix] For sdpa node, cudnn now correctly returns `NOT_SUPPORTED` when s_q is not a multiple of 64 and padding mask is on.

[Bug Fix] For sdpa backward node, cudnn now correctly returns `NOT_SUPPORTED` when s_q is less than 64.

[Bug Fix] Fixed an issue with pointwise Modulo operation.

[Bug Fix] Fixed an issue in sdpa node, where the intermediate data types were wrong.

[Samples] Added a sample to showcase matmul with int8 and FP8 precisions.

[Cleanup] Python samples have moved from `samples/python` to `tests/python_fe`.

[Cleanup] Removed the `cudnn_frontend::throw_if` function.
xiaoteng-cui-mt pushed a commit to MooreThreads/MT-TransformerEngine that referenced this pull request Oct 9, 2026
Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
xiaoteng-cui-mt pushed a commit to MooreThreads/MT-TransformerEngine that referenced this pull request Oct 9, 2026
* add flash attention to TransformerLayer

Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Add docs for FP8 calibration (NVIDIA#61)

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Fix the integer overflow in fused softmax (NVIDIA#60)

Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* prefix flash attn env var with NVTE_

Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Address steady memory increase and bloated checkpoints (NVIDIA#63)

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* fix env var logic

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* fix flash attn env var logic again

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* remove d2d copies (NVIDIA#64)

* remove d2d copies

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* cleanup

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

---------

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Increase number of FP8 tensors per GEMM (NVIDIA#22)

* Increase number of FP8 tensors per GEMM

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Enable FP8 output tensor for fp8_gemm

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* [BERT FP8] Initial TE review comments

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Temporary fix for cuda graph non convergence

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Address review comments-2

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Review comments-3

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Cleanup

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Change for New API

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Remove unnecessary clone for D_scale, D_amax

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Avoid Roll for AMAX history size = 1

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Update onnx_te_gemm API

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

* Fix Lint errors

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>

---------

Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Bug fixes from PR 22 (NVIDIA#65)

* Bug fixes from PR 22

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Add FP8 tests to ci

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* bundle unittests for ci

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

---------

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* replace rearrange with transpose

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* QKV parameters unfused path fixes and optimization (NVIDIA#66)

* Bug fixes from PR 22

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Add FP8 tests to ci

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Better QKV parameter fusion

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* small fix

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* keep original param for unfused case to retain externally set attrs

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* lint fix

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Fix ONNX exports

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* improve arg naming

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* No need to set data pointers

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* lint

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Assert memory loc in NoopCat

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Handle case of different memory in param and buffer

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix assert always true

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Reassign params memory to avoid more concats

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

---------

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* Fix gradients when using AMP (NVIDIA#70)

retain grad related attrs while casting

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: Charlene Yang <charleney@nvidia.com>

* fix pylint violations 

fixed pyline violations such as trailing white spaces and too long lines 

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>

* fix pylint violation on line 264 with R1719

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>

* fix two more pylint violations

Signed-off-by: cyanguwa <cyang.uwa@gmail.com>

* DotProductAttention API

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* Add docs for attention

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix assert always true

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* check for correct flash-attn version

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* address review comments

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* lint+build fixes, correct settings for default flash-attn

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* correct version

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* review comments and fixes

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix onnx and disable flash-attn export test

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* remove einops dependency

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* cleanup internal API; rm duplication

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* only install TE wheel (exclude flash-attn to rm conflicts)

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* forgot to change install wheel path

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* next round review comments

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix flash_attn output

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* fix QK layer scaling

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* update docs

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

* review comments and fixes to selective checkpointing

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>

---------

Signed-off-by: Charlene Yang <charleney@nvidia.com>
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: cyanguwa <cyang.uwa@gmail.com>
Co-authored-by: Charlene Yang <charleney@nvidia.com>
Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
zhaoyinglia pushed a commit to zhaoyinglia/TransformerEngine that referenced this pull request Nov 23, 2026
…ton, NPU and FlagOS portability issues it exposed (NVIDIA#160)

## Summary

This PR runs the plugin test suite and the shared QA suites on every
platform through the unified FlagCICD pipeline. Every platform gets the
same dispatch order and the same test flow, and every omission is
explicit.

**Before this PR:**

- `tests/plugin/` ran in a manual CUDA-only workflow, or as hand-picked
files inside each platform launcher.
- The launchers and `qa/` scripts carried `-k` expressions, `--deselect`
lists, skip arrays and platform branches. These silently removed shared
`tests/pytorch/` cases.
- Each platform pinned its own `TE_FL_PREFER`.

A platform could be green while large parts of the suite never ran. Two
platforms running "the same" test were often running two different
implementations.

After this PR, four rules hold on all nine platforms:

1. **Same flow.**
- Every platform runs the whole `tests/plugin/` tree, one process per
file, through a shared preset.
- The `debug`, `distributed` and `onnx` jobs run the shared `qa/`
scripts with no platform branches. They do this on eight platforms; the
exceptions are listed under Follow-ups.
   - Platforms differ only by image, environment and `ignored_tests`.
2. **Same dispatch order.** `flagos -> vendor -> reference` everywhere.
Where FlagOS is wrong on a device, the case is quarantined; the order
stays the same.
3. **One place for omissions.** `.github/configs/<platform>.yml`
(`ignored_tests`, `ignored_test_groups`) is the only place a test can be
skipped. The planner validates every entry and reports it in the plan
summary as a coverage gap, so it never counts as passing evidence.
4. **Every failure is either fixed or recorded.** Each quarantine
carries its first error, the owning component, the run that observed it
and the condition for restoring it.

**Source changes:** one source file changes, the FlagOS Adam
implementation (section 9).
`transformer_engine/plugin/core/backends/vendor/` and TE core are
untouched. Defects found in core, FlagGems, FlagTree and vendor runtimes
are recorded with their owners, not patched here.

## 1. Plugin tests run everywhere, one file per process

`tests/test_utils/run_ci_test_group.py` gains:

- the step options `isolate_files`, `ignore`, `env_by_path` and
`unset_env_by_path`;
- a shared `plugin-unit` preset (`TE_TEST_GROUP_PRESET`) with
`--list-targets` and `--target-env`.

Every `tests/plugin/**/test_*.py` file runs in its own process and
writes its own JUnit file. This prevents `flag_gems` MagicMock leakage
between files and stops reports from overwriting each other. All
platform launchers and the L0 QA scripts use the preset.

Exit-code handling:

- **Crashes:** a file that dies from SIGSEGV, SIGABRT, SIGBUS, SIGFPE or
SIGILL is reported as `[CRASH]` and fails the group, but the remaining
files still run. Cancellation, timeouts and OOM still stop the group.
- **Exit code 5:** accepted only when the report contains skipped cases
exclusively (module-level `importorskip`). An empty collection or an
error still fails.

## 2. One dispatch order on every platform

`policy.py`'s `PREFER_DEFAULT` is `flagos -> vendor -> reference`.
Before this PR the CI entry points overrode it per platform: `reference`
on Hygon and Enflame, `vendor` on KunlunXin and MUSA, `vendor` for every
MCore integration run, and `flagos` elsewhere.

Now:

- **Environment scripts:** every
`tests/plugin/backend/<platform>/set_env.sh` sets
`TE_FL_PREFER="${TE_FL_PREFER:-flagos}"`.
`qa/L1_pytorch_mcore_integration/test.sh` defaults to `flagos` too.
- **Images:** the CUDA, Hygon and Iluvatar Dockerfiles no longer bake
`TE_FL_PREFER` into the image ENV. `cuda.yml` passes `-e
TE_FL_PREFER=flagos` until the online image is rebuilt from the new
recipe.
- **Setup scripts:**
- `setup_hygon.sh`, `setup_kunlun.sh` and `setup_musa.sh` no longer
assert which implementation `generic_gemm` resolves to. They print the
selection, and still assert that the vendor backend is importable and
available.
  - `setup_iluvatar.sh` asserts only the two ops it pins.
- **Exceptions are per op, each with a reason and a removal condition:**

| Platform | Pin | Reason |
|---|---|---|
| Enflame, MUSA |
`TE_FL_PER_OP="layernorm_fwd=reference\|flagos\|vendor;layernorm_bwd=reference\|flagos\|vendor"`
| FlagGems layernorm does not compile on GCU (`arith.extsi` cannot be
legalized). The backward fell back while the forward succeeded, and that
mixed pair produced NaN losses in MCore training (run 43798250037). The
forward/backward pair stays together. MUSA carried this pin before this
PR. |
| Iluvatar |
`TE_FL_PER_OP="generic_gemm=reference;multi_tensor_unscale_l2norm=reference"`
| Pre-existing in `set_env.sh`; the new image recipe sets the same
value. Covers the GEMM compatibility cases and the unscale/L2-norm op
missing from IXTE |
| Enflame MCore job |
`TE_FL_PREFER="${ENFLAME_MCORE_PREFER:-reference}"` in
`run_integration_tests.sh` | Under the shared order the loss turns NaN
at iteration 3. The same image trained normally on `reference.torch`
(run 43759073663). The job keeps running, so it still shows that MCore
training works end to end on GCU. The candidate ops are listed in the
script. |

## 3. One place for omissions: `ignored_tests`

`unsupported_test_groups` is renamed to `ignored_test_groups`, and the
old key is rejected with a migration error. A new top-level
`ignored_tests` list holds file-level and case-level omissions. An entry
can be as narrow as the failure:

| Form | Example |
|---|---|
| Directory, file | `tests/pytorch/nvfp4/`,
`tests/pytorch/test_checkpoint.py` |
| Function, class, method | `...::TestFusedSGD`,
`...::TestBasicOps::test_bias` |
| Name pattern | `...::test_export_linear*` |
| One parameter case | `...::test_dropout[dtype0-shape2-None-True-0.5]`
|
| Parameter pattern | `...::test_rmsnorm[*-True-dtype2-in_shape1-*]` |
| Scoped to some jobs | a group: `- jobs: [pytorch_debug]` followed by
`tests: [...]` |

```yaml
ignored_tests:
  # applies to every job
  - tests/pytorch/test_checkpoint.py
  # applies to one job only; the comment is the first error of the tests below it
  - jobs: [pytorch_debug]
    tests:
      # AssertionError: Outputs not close enough ...
      - tests/pytorch/test_numerics.py::test_layernorm_accuracy[*-*-*-*-dtype1]
```

**Matching rules:**

- Bracket parameter IDs are matched literally unless they contain `*` or
`?`.
- A bare function name matches its own parameter cases, but not a longer
name that starts with it.
- Job-scoped entries exist because the old launcher filters were
parameter-level and job-scoped. Without them, migrating a filter would
have widened it into a whole-function ignore.

**Validation of the group form:**

- Each platform has at most one group per job, so `jobs:` is written
once.
- The legacy per-entry `{test, jobs}` form is rejected.
- Job names are checked against `unit_test_matrix` and
`integration_test_matrix` when the config is loaded, so a typo such as
`pytorch_debgu` fails immediately.

**How the planner and the runner apply entries:**

- The planner validates every entry and merges it into each execution
group's ignored targets. It records which targets another group's ignore
suppressed (`ignored_group_test_targets`), and lists all of it in the
plan summary.
- `ci_pytest_selection.py` applies file-level ignores at collection
time, before the file is imported, so a case that crashes on import can
still be skipped. Node-level ignores are applied at `modifyitems`, and
each removed case prints `[IGNORE]`.
- If node-level ignores remove every case in a file, the run exits 0
instead of reporting an empty collection.

Current entries, as resolved by the planner:

| Platform | For all jobs | Job-scoped | Ignored groups |
|---|---|---|---|
| Iluvatar | 120 | 8 | quantization |
| MUSA | 57 | 0 | quantization, normalization |
| PPU | 54 | 3 | quantization |
| CUDA | 45 | 12 | quantization |
| Enflame | 27 | 23 | quantization |
| MetaX | 22 | 22 | attention, quantization |
| KunlunXin | 20 | 2 | quantization, optimizer, attention |
| Hygon | 8 | 46 | attention, quantization |
| Ascend | 3 | 29 | quantization |

No launcher, test file or `qa/` script quarantines a test any more:

- The `-k "not (...)"` expressions, `PLUGIN_IGNORE_TEST_NODES` arrays,
`*_SKIP_K` maps and `--deselect` lists are gone.
- `tests/plugin/conftest.py` is back to its `main` content.
- The `-k` expressions that remain in a few launchers select which cases
run; they remove none.

`.github/scripts/ci/README.md` documents how to ignore a test on one
platform, and `.github/configs/template.yml` carries a commented
example.

## 4. The shared QA scripts run on every platform

**Hidden exclusions removed.** `qa/L0_pytorch_unittest/test.sh`,
`qa/L0_pytorch_debug_unittest/test.sh` and
`qa/L1_pytorch_distributed_unittest/test.sh` carried exclusions added in
NVIDIA#60 and NVIDIA#73:

- an `IS_CUDA_BACKEND` block that skipped six files;
- a `PLATFORM=metax` file list;
- a `METAX_IGNORED_TESTS` array;
- `-k 'not (...)'` filters.

None of them appeared in the plan. They are now entries in `cuda.yml`
and `metax.yml`, and the scripts run the same commands on every
platform.

The migration was checked to be exactly equivalent. For each platform
and job, the set of removed test functions was computed before and
after. Each `-k` substring was resolved through the AST of the target
files, and each config entry through the planner's matcher:

| Platform / job | Functions ignored before | After | Mismatches |
|---|---|---|---|
| CUDA unit / debug / distributed | 120 / 10 / 0 | 120 / 10 / 0 | 0 |
| MetaX unit / debug / distributed | 203 / 46 / 3 | 203 / 46 / 3 | 0 |

**Debug, distributed and onnx run the shared scripts on eight
platforms.**

- Before, only CUDA and MetaX ran them:
- Enflame, Hygon, Iluvatar, KunlunXin and PPU ran private file lists
from their launchers.
- Ascend ran `qa/*/test_ascend.sh` variants that skipped every shared
test, because `TE_TEST_PYTEST_COMMAND` is set nowhere.
- Those launchers now call the shared scripts, and the Ascend debug,
distributed and onnx variants are deleted. KunlunXin `debug` and all
MUSA jobs are the remaining exceptions; see Follow-ups.
- The ignores for the newly covered cases come from the alignment run in
section 6.

Changes to the shared scripts themselves:

- **`qa/L1_pytorch_distributed_unittest/test.sh`:**
- It now runs `distributed/test_fusible_ops.py` and
`debug/test_distributed.py`.
- Four steps stay commented out because they fail on all eight
platforms, so they are not a platform difference:
`distributed/test_sanity.py`, `test_comm_gemm_overlap.py`,
`test_fusible_ops_with_userbuffers.py` and
`attention/test_attention_with_cp.py`.
- The CUDA runtime prelude (the `LD_LIBRARY_PATH` prepend and the
`libcudart` preload) runs only when `TE_FL_SKIP_CUDA != 1`. On KunlunXin
it shadowed the vendor runtime, and every distributed file failed to
collect.
- `nvdlfw-inspect` is reinstalled with `--force-reinstall --no-deps`,
best effort, and readiness is checked by import alone. On Enflame, PEP
668 refused pip, and the debug steps had been skipped silently.
- **`qa/L1_pytorch_onnx_unittest/test.sh`:** keeps the image's pytest
when pip is refused under PEP 668.

## 5. Group definitions no longer overlap by accident

- **attention vs. distributed.** `attention`'s `test_targets` listed the
directory `tests/pytorch/attention/`. A platform that ignored the
attention group therefore also suppressed `test_cp_utils.py`, which
belongs to `distributed`. On Hygon, KunlunXin and MetaX the distributed
job became empty as a result. The targets are now listed per file, and
those three platforms run their distributed job again.
- **Ownership.** `plugin_core` now owns `triton_dispatch/`,
`backends/__init__.py` and `pytorch/triton/`; `reference_backend` owns
`tests/plugin/accuracy/`.
- **Missing targets.** `debug`, `distributed` and `onnx` had `paths` but
no `test_targets`, so node-level ignores could not be expressed inside
them. They now declare their targets.

## 6. Shared-flow alignment run and what CI exposed after it

**How the ignore entries were produced.** Every step of the three shared
scripts ran on 8 platforms, including the steps that were commented out.
MUSA was excluded because of a machine network problem. Conditions
matched CI:

- commit `deb7ee4d`;
- each platform's CI image, container options, setup script and
`set_env.sh`, with setup's `GITHUB_ENV` loaded first;
- one process per file, with no ignore list, on idle devices.

Process deaths and hangs were handled as follows:

- A step whose process died from a device fault was rerun with the
faulting case deselected.
- A step with no new result for 15 minutes was killed, and its last case
was recorded as a hang.

Entries came from the JUnit results:

- An existing entry that hid passing cases no longer applies to that
job.
- Each new failure got the narrowest job-scoped pattern that matches no
passing case.

Debug job, cases passing in the alignment run, with the CI count before
this change in parentheses:

| PPU | MetaX | Iluvatar | Enflame | Hygon | Ascend |
|---|---|---|---|---|---|
| 4906 (24) | 4881 (11) | 3287 (2770) | 2748 (3) | 19 (4) | 11 (1) |

Root causes shared by several platforms. None is patched here; each
owner is named:

| Cause | Platforms | Owner |
|---|---|---|
| `transformer_engine/pytorch/quantization.py:181` calls
`float(torch.version.cuda)` once compute capability >= 9.0, and
`torch.version.cuda` is `None` on DCU/NPU, so whole files fail to
collect | Hygon, Ascend | TE core; a one-line `is not None` guard |
| FP8 ops missing (`quantize`,
`fused_amax_and_scale_update_after_reduction`) | Hygon, Ascend | backend
op coverage |
| `torch.compile` has no device backend (`KeyError: 'gcu'`,
`BackendCompilerFailed`) | Enflame, Ascend | vendor torch integration |
| Shared tests address CUDA directly (`torch.cuda.device_count()` skips,
`_cuda_setDevice`) | Ascend | shared tests (device abstraction) |
| FlagGems norm kernels miss the FP16/BF16 tolerance in
`test_layernorm_accuracy` | Iluvatar, MetaX | FlagGems norm |
| float16-only LayerNorm accuracy failures (`test_layernorm_accuracy`,
LayerNorm relu/reglu `test_layernorm_mlp_accuracy`); float32 passes |
Enflame | not isolated yet (layernorm is pinned to reference on Enflame)
|
| `test_gpt_accuracy` / `test_mha_accuracy` abort in
`topsatenScaledDotProductEfficientAttentionBackward` (NOT_SUPPORT) |
Enflame | Enflame topsaten |

The first CI runs after the alignment exposed five gaps between the
experiment and CI. Each is fixed:

| Gap | Effect in CI | Fix |
|---|---|---|
| Steps ran as bare pytest commands, so the script's own prelude never
ran | KunlunXin: the CUDA `LD_LIBRARY_PATH` prepend shadowed the XPU
runtime ("NVIDIA driver too old") | The prelude runs only when
`TE_FL_SKIP_CUDA != 1` |
| Cases that kill the process leave no JUnit result | Enflame and Hygon
debug jobs aborted on cases with no entry | Re-scanned every report for
such cases and added `test_fake_quant`, `test_statistics_collection`,
`test_statistics_multi_run` (Enflame) and
`test_logging_zero_numel_tensor` (Hygon) |
| An abort hides every later case | Enflame `test_numerics.py` ran to
the end for the first time in CI: 32 float16 layernorm cases failed, 483
passed | Job-scoped entries for the float16 layernorm cases (`dtype1`) |
| Running the experiment's pre-installed `nvdlfw_inspect` hid the
script's reinstall step | Enflame distributed was green but skipped its
debug steps | Best-effort reinstall; readiness is the import alone |
| Fewer devices than CI; `test_fusible_ops` puts `device_count()` into
the node ID | The CUDA `[4]` entry never matched the `[8]` that CI
collects | Entry changed to `[8]` |

## 7. A100 MCore: diagnostics off, like every other platform

The unified order moved `multi_tensor_l2norm` on A100 from `vendor.cuda`
to FlagOS. `integration-a100-pytorch_mcore_integration` then failed at
iteration 1:

```
megatron/training/utils/common_utils.py:158 calc_params_l2_norm
    norm_2 += sharded_norm_2
RuntimeError: output with shape [] doesn't match the broadcast shape [1]
```

**Evidence:**

- **The TE contract.** The native kernel returns the total norm with
shape `[1]`
(`transformer_engine/pytorch/csrc/extensions/multi_tensor/l2norm.cpp:21`,
`at::empty({1})`). The FlagOS and reference implementations both return
a 0-dim scalar. The values are correct; only the shape differs.
- **Same error on both backends.** The job failed identically on
`default.flagos` (run 43899242175) and on `reference.torch` (run
44108177180). Pinning the op to reference, which an earlier commit in
this PR did, therefore could not help.
- **The Megatron side** (Megatron-LM-FL `main` 24a8d194,
`calc_params_l2_norm`):
- With no distributed optimizer, `sharded_norm_2` is Megatron's own
`torch.zeros((1,))`.
- `norm_2 += sharded_norm_2` updates the 0-dim `norm_2` in place, and
that is what fails.
- The function runs only with `--log-params-norm` (`training.py:3938`),
after `train_step`.
- `175ae90e`, the previous `MCORE_REF` default, has the same code, so
the Megatron version is not the cause.
- **Why the other platforms pass.** All eight other MCore jobs log
`log_params_norm False`, because their launchers set
`ENABLE_DIAGNOSTICS=0`. They reach the same FlagOS op only through the
grad-norm clip, which squares, all-reduces and `.item()`s the result, so
a 0-dim result works there. Before this PR the job passed on A100 with
`vendor.cuda` (run 44054326358).

**Fix.** `tests/plugin/backend/cuda/run_integration_tests.sh` sets
`ENABLE_DIAGNOSTICS=0`, so A100 runs the same MCore arguments and the
same dispatch order as the other eight platforms. A per-op pin to
`vendor` was rejected: it would not cover the FlagOS path either, and it
would make A100 the only platform with a different flow.

**Cost.** `--log-params-norm`, `--log-num-zeros-in-grad` and
`--log-memory-to-tensorboard` now run on no platform. They return for
all platforms together once FlagOS and reference return shape `[1]` and
a shape-parity test against the native kernel exists (Follow-ups).

## 8. Plan transport and gate

- **Plan as an artifact.** Jobs receive the plan as an artifact
(`plan_artifact`, `FLAGCICD_PLAN_FILE`) instead of a job output. This
applies to `ci`, `ci-requested`, `nightly`, `release-acceptance`,
`all_tests_common`, `test_groups_common` and the plan/gate actions.
- **pytest 9 JUnit summaries.** The gate now accepts them. pytest 9
counts subtest reports in a suite's `tests` attribute but writes no
`<testcase>` element for them, so a PPU report was rejected although
every test passed.
- `failures`, `errors` and `skipped` must still equal their element
counts exactly.
  - `tests` may not be lower than the number of `<testcase>` elements.
  - A report that cannot be used prints its file and the reason.
- **Other changes:**
  - Unit jobs no longer retry the whole suite.
  - `PLATFORM` is passed explicitly.
  - The FlagOps upload is skipped when its token is absent.
  - The duplicate `te-plugin-tests.yml` is removed.

## 9. Source fix: FlagOS Adam

`transformer_engine/plugin/core/backends/flagos/impl/fused_adam.py` is
the only source file this PR changes.

**Large tensors.**

- **Symptom:**
`tests/pytorch/test_fused_optimizer.py::test_large_tensor`
(2,359,332,864 FP16 elements) failed on PPU for 211,849,189 elements,
starting exactly at index 2^31.
- **Cause:** `multi_tensor_adam_fl` handed the whole tensor to FlagGems,
whose vendor elementwise kernels index with 32-bit offsets.
- **Fix:** `_elementwise_chunks` updates tensors above 2^28 elements
through aligned flat views of the same storage. Adam is purely
elementwise, so chunking gives the same result as one launch. Tensors at
or below the threshold keep the previous single-launch path.

**In-place scaling.**

- **Cause:** FlagTree's Triton 3.6 vendor builds benchmark autotune
candidates on the live arguments without restoring them. The first
`flag_gems.mul_` tuned in a process therefore scaled its input 25 to 103
times.
- **Effect:** on the first step after a checkpoint resume, the relative
Adam update error was 77% on PPU, 87% on Iluvatar and 99% on Hygon. CUDA
was exact.
- **Fix:** `_scale_()` computes the product out of place and writes it
back with `copy_`, which gives the same result however often a launch
repeats. All three platforms then measure 4.5e-6, the same as CUDA. The
root fix belongs to the FlagTree vendor backends; the docstring records
when to switch back to `mul_`.

## 10. Tests and documentation

- **Triton dispatch numerics tests.** `tests/plugin/utils.py` adds
`triton_device_unavailable_reason`, and these tests run only when the
active Triton driver works. Under `torch_gcu`,
`torch.cuda.is_available()` returns True even when the image's Triton
has no matching backend.
- **Dispatch entry tests.** They clear every `TE_FL_*` policy variable
inside the fixture, because Enflame's image bootstrap sets
`TE_FL_PREFER` at interpreter start.
- **CI self-tests.** The Lint job runs 154 tests, covering:
  - crash continuation and nested `PYTHONPATH` restoration;
  - `ignored_tests` reaching the plan;
- parameter-pattern matching, job-scoped groups and job-name validation;
  - cross-group overlaps;
  - pytest 9 subtest summaries and the gate's error message.

Run them with `python -m unittest discover -s .github/scripts/ci -p
'test_*.py'`.

## 11. CI images

Single-file `base/release/dev/ci` recipes, with base images pinned by
digest:

| Platform | Image | Notes |
|---|---|---|
| CUDA | `v2.17.0-cuda-ci` | flagos-runtime CUDA 13.3; flag_gems 5.4.0,
flagtree 0.7.0, triton 3.7.1 |
| Ascend | `v2.17.0-ascend-ci` | CANN 9.0.0, 910C |
| MetaX | `v2.17.0-metax-ci` | MACA 3.7.2.1, torch 2.8 |
| Hygon | `v2.17.0-hygon-ci` | DTK 26.10 |
| Iluvatar | `v2.17.0-iluvatar-ci` | CoreX 4.5.0 |
| Enflame | `v2.17.0-enflame-ci-gems5.0.2-20261112` | torch 2.10,
torch_gcu 3.7, FlagGems 5.0.2. The standalone `migration` package
supplies the vendor TE patches; the bootstrap's `TE_FL_PREFER=reference`
default is dropped. |
| PPU, MUSA, KunlunXin | `v2.17.0-thead-ci`, `f826afe-musa-dev`,
`b98d43b-kunlun-dev` | recipes not in this repository |

`metax.yml` no longer passes `-e LD_LIBRARY_PATH`. Actions hands
container options to docker without a shell, so the literal value
replaced the image's path and torch could not load `libmxomp.so`.

## Behaviour changes

- Platform configs must use `ignored_test_groups` and `ignored_tests`.
`unsupported_test_groups` and the per-entry `{test, jobs}` form are
rejected, and job names in `ignored_tests` groups must exist.
- Every platform and every MCore integration run defaults to
`TE_FL_PREFER=flagos`. A deviation must be stated per op with a reason
(`TE_FL_PER_OP`), or the case must be quarantined.
- Debug, distributed and onnx run the shared `qa/` scripts on eight
platforms. Newly covered failures are quarantined per case and per job.
- MCore diagnostics (`ENABLE_DIAGNOSTICS`) are off on every platform.
- The Hygon, KunlunXin and MUSA setup scripts no longer fail when
`generic_gemm` resolves to a different implementation.
- Unit jobs no longer retry automatically.
- FlagOS Adam allocates one temporary per moment update and splits
tensors above 2^28 elements. The math is unchanged.

## Validation

- **CI:** the last full run, 44108177180 at `672dbf54`, finished 91 jobs
green. The only failure was
`integration-a100-pytorch_mcore_integration`, plus the gate jobs that
depend on it. Section 7 fixes it in `806acc2d`. Run 44206162328 at
`806acc2d` is queued; this head is verified once it is green.
- **Equivalence of the qa migration:** checked function by function,
with 0 mismatches across 6 platform/job combinations (section 4).
- **`ignored_tests` grouping refactor:** for all 60 platform × job
lists, the resolved ignore list is identical before and after.
- **Coverage baseline:** measured from the JUnit artifacts of the last
pre-PR run and of a run on this branch before the order was unified, on
the same image digests. These counts predate the order change and the
shared-script migration, so they are a baseline, not the current pass
count.

  | Hygon | KunlunXin | MUSA | Enflame | Ascend | PPU | Iluvatar |
  |---|---|---|---|---|---|---|
  | +393 | +575 | +385 | +88 | +35 | +14 | +12 |

- **FlagOS Adam figures:** from a probe run in fresh processes on A100,
PPU, Iluvatar and Hygon. It compares the first step after a simulated
checkpoint resume against the analytic Adam formula. `test_large_tensor`
exercises the large-tensor fix on PPU, the only platform with enough
memory; it skips elsewhere.
- **Self-tests and formatting:** 154 CI self-tests pass locally with the
Lint job's command, and `pre-commit run --all-files` passes.

## Known gaps, recorded in the configs

Every entry lives in a platform config with its first error, and appears
in the plan summary as a coverage gap.

| Area | Platforms | Owner |
|---|---|---|
| FP8 / quantization group | all nine | no FP8-capable runner (A100 has
no FP8) |
| `quantization.py:181` `float(torch.version.cuda)` on DCU/NPU | Hygon,
Ascend | TE core |
| FP8 ops missing from the backend | Hygon, Ascend | FlagOS / vendor
plugin |
| `torch.compile` has no device backend | Enflame, Ascend | vendor torch
integration |
| SDPA efficient-attention backward NOT_SUPPORT aborts the process |
Enflame | Enflame topsaten |
| FlagGems norm in FP16/BF16 (accuracy, weight gradients, dependent ONNX
exports) | MetaX, Iluvatar | FlagGems |
| float16 LayerNorm accuracy | Enflame | not isolated yet |
| `multi_tensor_l2norm` returns 0-dim where the native kernel returns
`[1]`; MCore diagnostics off everywhere | all (exposed on A100) | FlagOS
/ reference backends |
| MCore training NaN under the shared order; job pinned to reference |
Enflame | FlagGems / FlagTree Enflame |
| FlagGems GEMM illegal memory access on a zero-token operand | CUDA |
FlagGems CUDA GEMM |
| XCCL watchdog timeout on the first ALLGATHER, intermittent | KunlunXin
| KunlunXin XCCL |
| FlagTune injects an undeclared config, so the `torch.compile` grid is
`None` | PPU, Hygon, Iluvatar, CUDA | FlagTree / FlagTune |
| FP32 to float8 casts fail in the runtime | Ascend, Enflame | torch_npu
/ CANN, torch_gcu |
| No evidence for the multi-tensor scale contract | Ascend, Enflame,
KunlunXin (whole file), MUSA (one case) | vendor TE extensions |
| `num_warps=32` exceeds the MACA compiler limit | MetaX | MACA Triton
compiler |
| Shared distributed steps that fail on all platforms (section 4) | all
| shared tests |

## Follow-ups, not in this PR

- **Remaining private flows:**
- The unit job still runs launcher-specific lists on Hygon, Iluvatar,
Enflame, KunlunXin, PPU and MUSA, and Ascend's unit variant skips the
shared tests.
- KunlunXin `debug` and all MUSA jobs still use private lists. Their
alignment runs are pending.
- **`multi_tensor_l2norm` shape:** make FlagOS and reference return
shape `[1]` (including the noop return), add a shape-parity test against
the native kernel, then turn MCore diagnostics on for all platforms
together.
- **`quantization.py:181`:** a one-line guard in TE core would restore
whole files on Hygon and Ascend.
- **Enflame MCore:** name the faulty op, pin only that op, and return
the job to the shared order.
- **Per-test timeout:** the shared scripts have none, so a hang uses the
whole job timeout (90 min on KunlunXin, Enflame, Hygon, MetaX and
Ascend).
- **Megatron drift:** `MCORE_REF` defaults to `main`, so MCore
integration results drift with Megatron-LM-FL.
- **Images:**
  - CI images are referenced by tag; pin `@sha256:` once they are final.
  - PPU, MUSA and KunlunXin images are built outside this repository.
- **Small leftovers:**
- `musa.yml` still passes an unexpanded `$LD_LIBRARY_PATH`, the pattern
that broke MetaX.
- `tests/pytorch/test_mhc.py` and `test_torch_compile.py` run on no
platform.
- `cuda.yml` keeps a legacy `test_matrix.l0_pytorch.ignored_tests` list
that the planner does not read.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: AlexMa616 <19025408700@163.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: canghaiX <59075364+canghaiX@users.noreply.github.com>
Co-authored-by: Gemini 3.8 Flash <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: CJH <570372819@qq.com>
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