Skip to content

feat(cambricon): link Apex rms_norm - #886

Merged
voltjia merged 1 commit into
feat/linked-moore-rms-normfrom
feat/linked-cambricon-rms-norm
Aug 7, 2026
Merged

feat(cambricon): link Apex rms_norm#886
voltjia merged 1 commit into
feat/linked-moore-rms-normfrom
feat/linked-cambricon-rms-norm

Conversation

@voltjia

@voltjiavoltjia commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Cambricon Apex rms_norm_affine as linked rms_norm implementation slot 16.
  • Resolve a second Apex DSO, fused_layer_norm_cuda*.so, without changing the existing glu_activation*.so mapping.
  • Map Apex empty-bias, axis, and vector<Tensor> return semantics inside the provider adapter.

Motivation

This PR validates that the linked architecture works across operators and across materially different provider ABIs. InfiniOps keeps:

rms_norm(input, weight, epsilon, out)

Cambricon Apex exports:

std::vector<at::Tensor> rms_norm_affine(
const at::Tensor& input, const at::Tensor& bias,
const at::Tensor& weight, double epsilon, long axis);

nm -D -C, readelf, DWARF, and direct small-tensor calls confirmed this ABI. The adapter supplies an empty FP32 CPU bias, uses axis = input.dim() - 1, and copies result element 0 to out; element 1 is auxiliary inverse RMS.

Depends on #885. N/A - no linked issue.

Type of Change

  • feat - new feature / new operator / new platform
  • fix - bug fix
  • perf - performance improvement (no behavioral change)
  • refactor - code restructuring without behavior change
  • test - adding or fixing tests only
  • docs - documentation only
  • build / ci - build system or CI configuration
  • chore - tooling, formatting, or other non-code changes
  • Breaking change

Platforms Affected

  • CPU (WITH_CPU)
  • NVIDIA (WITH_NVIDIA)
  • Iluvatar (WITH_ILUVATAR)
  • MetaX (WITH_METAX)
  • Cambricon (WITH_CAMBRICON)
  • Moore (WITH_MOORE)
  • Ascend (WITH_ASCEND)
  • PyTorch C++ bindings (WITH_TORCH)
  • Build system / CMake / CI
  • Python bindings / user-facing API

Smoke Test Result

Pending: operator-pruned Cambricon linked build, tests/test_rms_norm.py, and the existing smoke set.
The source upload to the Cambricon validation host requires explicit authorization.

Test Results on Supported Platforms

PlatformAffectedBuild / Smoke ResultFull Result / Notes
NVIDIANoN/A - not affectedHost-independent clang-format/Ruff checks only
IluvatarNoN/A - not affectedN/A
MetaXNoN/A - not affectedSeparate draft PR
CambriconYesPending remote linked buildSix direct provider calls passed for FP32/FP16/BF16 and 2D/3D inputs
MooreNoN/A - not affectedSeparate draft PR
AscendNoN/A - not affectedN/A
Static validation and provider evidence
DSO: fused_layer_norm_cuda.cpython-310-aarch64-linux-gnu.so
SHA256: 04efea65896ff222f2cbc85f27eccadcab83ae56ff9132223b086e86428682fd
required symbol:
rms_norm_affine(at::Tensor const&, at::Tensor const&, at::Tensor const&, double, long)
clang-format 21 --dry-run --Werror <changed C++ files>
exit 0
ruff 0.15.22 format --check tests/test_rms_norm.py
1 file already formatted
ruff 0.15.22 check tests/test_rms_norm.py
All checks passed!
git diff --cached --check
exit 0

Benchmark / Performance Impact

N/A - this PR validates linked integration correctness and makes no performance claim.

Notes for Reviewers

  • The shared TorchRmsNorm<Backend> remains provider-neutral; only ApexRmsNorm::Call knows about bias synthesis, axis, and the auxiliary return.
  • This proves that one Python distribution may resolve multiple linked DSOs without combining their mappings.
  • This is the seventh PR in the linked-operator stack and depends on feat(moore): link vLLM rms_norm #885; its diff contains only the Cambricon provider, second Apex DSO mapping, and MLU stream coverage.

@voltjia
voltjiaforce-pushed the feat/linked-cambricon-rms-norm branch from 2b3fc14 to 1e93a4fCompareAugust 6, 2026 11:50
@voltjia
voltjia changed the base branch from feat/linked-cambricon-silu-and-mul to feat/linked-moore-rms-normAugust 6, 2026 11:51
@voltjiavoltjia changed the title feat(cambricon): link Apex rms_normfeat(cambricon): link Apex rms_normAug 6, 2026
@voltjia
voltjia marked this pull request as ready for review August 6, 2026 12:10
@voltjia
voltjia requested a review from a teamAugust 6, 2026 12:10
@voltjia
voltjia merged commit cb4c658 into masterAug 7, 2026
10 checks passed
@voltjia
voltjia deleted the feat/linked-cambricon-rms-norm branch August 7, 2026 11:00
Sign up for freeto 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.

3 participants

@voltjia@whjthu@Ziminli