[PR #3582] [Benchmark] validate Ascend MoE and compensate S2 rounding #4698

Open
opened 2026-11-07 15:38:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3582
Author: @zhachar14h-cell
Created: 10/21/2026
Status: 🔄 Open

Base: main ← Head: codex/ascend-a2-s2-prototype


📝 Commits (3)

  • e1e5381 [Benchmark] add isolated Ascend 910B3 S2 decode and projection probes
  • 9a07eb5 [Benchmark] validate unchanged S2 probes on Ascend A3
  • 0d5287c bench: validate real-weight Ascend MoE and compensate S2 rounding

📊 Changes

135 files changed (+15977 additions, -0 deletions)

View changed files

➕ bench/ascend_a2_s2/CMakeLists.txt (+21 -0)
➕ bench/ascend_a2_s2/README.md (+71 -0)
➕ bench/ascend_a2_s2/RESULTS.md (+100 -0)
➕ bench/ascend_a2_s2/a3/RESULTS.md (+175 -0)
➕ bench/ascend_a2_s2/a3/evidence/EVIDENCE_MANIFEST.json (+29 -0)
➕ bench/ascend_a2_s2/a3/evidence/SOURCE_MANIFEST.a3.json (+21 -0)
➕ bench/ascend_a2_s2/a3/evidence/SUMMARY.json (+407 -0)
➕ bench/ascend_a2_s2/a3/evidence/build-settings.a3.json (+18 -0)
➕ bench/ascend_a2_s2/a3/evidence/decode-build.log (+174 -0)
➕ bench/ascend_a2_s2/a3/evidence/decode-configure.log (+9 -0)
➕ bench/ascend_a2_s2/a3/evidence/decode-run-1.json (+176 -0)
➕ bench/ascend_a2_s2/a3/evidence/decode-run-1.log (+16 -0)
➕ bench/ascend_a2_s2/a3/evidence/decode-run-2.json (+176 -0)
➕ bench/ascend_a2_s2/a3/evidence/decode-run-2.log (+16 -0)
➕ bench/ascend_a2_s2/a3/evidence/decode-run-3.json (+176 -0)
➕ bench/ascend_a2_s2/a3/evidence/decode-run-3.log (+16 -0)
➕ bench/ascend_a2_s2/a3/evidence/host-facts.a3.json (+38 -0)
➕ bench/ascend_a2_s2/a3/evidence/npu-smi-after.txt (+17 -0)
➕ bench/ascend_a2_s2/a3/evidence/npu-smi-before.txt (+17 -0)
➕ bench/ascend_a2_s2/a3/evidence/projection-build.log (+171 -0)

...and 80 more files

📄 Description

Problem and result

The isolated Ascend S2 prototype passed individual projection bounds but failed a real-weight expert chain: FP32 rounding moved an intermediate value across an INT8 half-integer boundary. Expert 423 exceeded the predeclared RMS limit in every baseline run. An opt-in compensated product/sum path now passes all 512 experts in three fresh A3 processes, using the same weights, input hashes and error limits. Its RMS error for expert 423 falls from 7.467131e-4 to 7.509644e-8.

This extends the existing A2/A3 projection benchmark with a complete layer-zero MoE harness: router/top-10, routed gate/up/SwiGLU/down, gated shared expert and weighted output. Weights are the installer's pinned Q2_0 GGUF; inputs are synthetic hidden states. It does not add an inference backend.

Approach

STRATA_S2_COMPENSATED=ON retains product and addition low parts using Dekker splitting and TwoSum. The FP16-derived weight scale times each exact integer chunk dot is exactly representable in FP32. CANN's ascendc_compile_* interface passes the macro and non-reassociation/non-contraction settings to the device compiler. OFF remains the default. Its rebuilt A3 library is byte-identical to the original (e49fd7ae…cf86b9). The MoE collector also returns exit 1 after saving a numerical failure, instead of printing FAIL and returning 0.

The independent oracle uses existing Strata C++ weight decoders and FP64 computation. Each native projection is additionally checked with its actual quantized input. All eight tensor hashes match independent Hugging Face origin and pinned ModelScope reads. Weight binaries are not committed.

Validation

Measured on A3 / Ascend910_9362, CANN 9.0.0, driver 25.5.5, aarch64 Ubuntu 20.04.5; Python 3.11.4, torch 2.7.1+cpu, torch_npu 2.7.1.post4, NumPy 1.26.4; HF32 disabled; logical NPU zero only. Final fix measured on 2026-10-22.

Passed:

  • Final ON path, three fresh processes: 21/21 complete MoE fixtures; 1536/1536 forced expert fixtures; 6480/6480 FP64 projection bounds; 4320/4320 quantizer checks (exact codes, scales within one ULP). Inputs/weights/guards passed and output hashes were stable. Maximum expert relative RMS: 1.279868e-7; maximum complete-layer RMS: 2.161990e-6. Limits remain max normalized 1e-3, RMS 5e-4.
  • Clean OFF and ON A3 builds each passed the original 21 synthetic projection cases. OFF library SHA-256 matches the original binary. Two added cancellation cases returned independently known results 1 and -2^-22 exactly with ON.
  • Existing 2026-10-21 A2/A3 OFF measurements remain: three 21-case projection runs on each target; all 21 output hashes match across targets. Their timing and rejected attempts remain in the original reports; no ON performance claim is made.
  • Python syntax, source/binary/evidence hashes, raw-report preservation, local links, private-path scan and git diff --check.

Exact commands, source and binary hashes, raw reports and comparisons: real-weight MoE report, final summary, build/commands/evidence manifest. Earlier A2 projection and A3 report retain their original scope and dates. The upstream reference is 9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4; these are isolated prototype measurements, not a run of the latest engine.

Failed, retained:

  • Same-day OFF baseline reproduced expert 423's RMS failure and exit 1. OFF also failed both new cancellation cases as an expected negative control; final ON returned 0.
  • Ordinary CMake target options did not reach CANN's device compiler; that purported ON binary was unchanged and three runs reproduced the failure. A sum-only compensation candidate fixed 423 but failed expert 328. Both rejected configurations, sources and measurements are archived.
  • Earlier real-weight OFF runs remain passed: false. The initial exact-scale precheck failed at one ULP; failed transfers and earlier A2 prototype failures also remain documented. No thresholds were relaxed for the fix.

Not run / limits:

ON performance or A2 execution; arbitrary/subnormal/overflow inputs outside the documented compensation assumptions; original BF16 model weights; prompt activations; other layers; attention/GDN/QSA/cache/residual integration; default AVX/shared-activation parity; full inference/token generation; vision, HCCL or the second chip. Shared mixed-format weights are host-decoded then run with FP32 NPU operations; expert dispatch is a host loop. No model-quality or throughput claim. CUDA/HIP/SYCL/Metal and production engine, installer and root build files are untouched; their binaries were not rebuilt. The full 37.6 GB shard was not downloaded or independently hashed.

Scope

This updates the existing standalone benchmark PR. Initial open/closed searches found no matching Ascend/910B thread. No default or production backend change is requested; a full backend would need separate scope agreement. AI assistance was used for implementation, investigation and reporting.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3582 **Author:** [@zhachar14h-cell](https://github.com/zhachar14h-cell) **Created:** 10/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/ascend-a2-s2-prototype` --- ### 📝 Commits (3) - [`e1e5381`](https://github.com/Niko1221/Strata/commit/e1e538174af1ec65ec5f9c124d2fee35f6f2b79f) [Benchmark] add isolated Ascend 910B3 S2 decode and projection probes - [`9a07eb5`](https://github.com/Niko1221/Strata/commit/9a07eb56b5efe0116b6c4137899f44c6a61dd5c2) [Benchmark] validate unchanged S2 probes on Ascend A3 - [`0d5287c`](https://github.com/Niko1221/Strata/commit/0d5287c3641fa8b873df71c2a84625c254498e28) bench: validate real-weight Ascend MoE and compensate S2 rounding ### 📊 Changes **135 files changed** (+15977 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `bench/ascend_a2_s2/CMakeLists.txt` (+21 -0) ➕ `bench/ascend_a2_s2/README.md` (+71 -0) ➕ `bench/ascend_a2_s2/RESULTS.md` (+100 -0) ➕ `bench/ascend_a2_s2/a3/RESULTS.md` (+175 -0) ➕ `bench/ascend_a2_s2/a3/evidence/EVIDENCE_MANIFEST.json` (+29 -0) ➕ `bench/ascend_a2_s2/a3/evidence/SOURCE_MANIFEST.a3.json` (+21 -0) ➕ `bench/ascend_a2_s2/a3/evidence/SUMMARY.json` (+407 -0) ➕ `bench/ascend_a2_s2/a3/evidence/build-settings.a3.json` (+18 -0) ➕ `bench/ascend_a2_s2/a3/evidence/decode-build.log` (+174 -0) ➕ `bench/ascend_a2_s2/a3/evidence/decode-configure.log` (+9 -0) ➕ `bench/ascend_a2_s2/a3/evidence/decode-run-1.json` (+176 -0) ➕ `bench/ascend_a2_s2/a3/evidence/decode-run-1.log` (+16 -0) ➕ `bench/ascend_a2_s2/a3/evidence/decode-run-2.json` (+176 -0) ➕ `bench/ascend_a2_s2/a3/evidence/decode-run-2.log` (+16 -0) ➕ `bench/ascend_a2_s2/a3/evidence/decode-run-3.json` (+176 -0) ➕ `bench/ascend_a2_s2/a3/evidence/decode-run-3.log` (+16 -0) ➕ `bench/ascend_a2_s2/a3/evidence/host-facts.a3.json` (+38 -0) ➕ `bench/ascend_a2_s2/a3/evidence/npu-smi-after.txt` (+17 -0) ➕ `bench/ascend_a2_s2/a3/evidence/npu-smi-before.txt` (+17 -0) ➕ `bench/ascend_a2_s2/a3/evidence/projection-build.log` (+171 -0) _...and 80 more files_ </details> ### 📄 Description ## Problem and result The isolated Ascend S2 prototype passed individual projection bounds but failed a real-weight expert chain: FP32 rounding moved an intermediate value across an INT8 half-integer boundary. Expert 423 exceeded the predeclared RMS limit in every baseline run. An opt-in compensated product/sum path now passes **all 512 experts in three fresh A3 processes**, using the same weights, input hashes and error limits. Its RMS error for expert 423 falls from `7.467131e-4` to `7.509644e-8`. This extends the existing A2/A3 projection benchmark with a complete layer-zero MoE harness: router/top-10, routed gate/up/SwiGLU/down, gated shared expert and weighted output. Weights are the installer's pinned Q2_0 GGUF; inputs are synthetic hidden states. It does not add an inference backend. ## Approach `STRATA_S2_COMPENSATED=ON` retains product and addition low parts using Dekker splitting and TwoSum. The FP16-derived weight scale times each exact integer chunk dot is exactly representable in FP32. CANN's `ascendc_compile_*` interface passes the macro and non-reassociation/non-contraction settings to the device compiler. OFF remains the default. Its rebuilt A3 library is byte-identical to the original (`e49fd7ae…cf86b9`). The MoE collector also returns exit 1 after saving a numerical failure, instead of printing FAIL and returning 0. The independent oracle uses existing Strata C++ weight decoders and FP64 computation. Each native projection is additionally checked with its actual quantized input. All eight tensor hashes match independent Hugging Face origin and pinned ModelScope reads. Weight binaries are not committed. ## Validation Measured on A3 / `Ascend910_9362`, CANN 9.0.0, driver 25.5.5, aarch64 Ubuntu 20.04.5; Python 3.11.4, torch 2.7.1+cpu, torch_npu 2.7.1.post4, NumPy 1.26.4; HF32 disabled; logical NPU zero only. Final fix measured on **2026-10-22**. **Passed:** - Final ON path, three fresh processes: **21/21 complete MoE fixtures; 1536/1536 forced expert fixtures; 6480/6480 FP64 projection bounds; 4320/4320 quantizer checks** (exact codes, scales within one ULP). Inputs/weights/guards passed and output hashes were stable. Maximum expert relative RMS: `1.279868e-7`; maximum complete-layer RMS: `2.161990e-6`. Limits remain max normalized `1e-3`, RMS `5e-4`. - Clean OFF and ON A3 builds each passed the original 21 synthetic projection cases. OFF library SHA-256 matches the original binary. Two added cancellation cases returned independently known results `1` and `-2^-22` exactly with ON. - Existing 2026-10-21 A2/A3 OFF measurements remain: three 21-case projection runs on each target; all 21 output hashes match across targets. Their timing and rejected attempts remain in the original reports; no ON performance claim is made. - Python syntax, source/binary/evidence hashes, raw-report preservation, local links, private-path scan and `git diff --check`. Exact commands, source and binary hashes, raw reports and comparisons: [real-weight MoE report](https://github.com/zhachar14h-cell/Strata/blob/0d5287c3641fa8b873df71c2a84625c254498e28/bench/ascend_a2_s2/moe/RESULTS.md), [final summary](https://github.com/zhachar14h-cell/Strata/blob/0d5287c3641fa8b873df71c2a84625c254498e28/bench/ascend_a2_s2/moe/evidence/compensated/SUMMARY.json), [build/commands/evidence manifest](https://github.com/zhachar14h-cell/Strata/blob/0d5287c3641fa8b873df71c2a84625c254498e28/bench/ascend_a2_s2/moe/evidence/compensated/EVIDENCE_MANIFEST.json). Earlier [A2 projection](https://github.com/zhachar14h-cell/Strata/blob/9a07eb56b5efe0116b6c4137899f44c6a61dd5c2/bench/ascend_a2_s2/fused/RESULTS.md) and [A3 report](https://github.com/zhachar14h-cell/Strata/blob/9a07eb56b5efe0116b6c4137899f44c6a61dd5c2/bench/ascend_a2_s2/a3/RESULTS.md) retain their original scope and dates. The upstream reference is `9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4`; these are isolated prototype measurements, not a run of the latest engine. **Failed, retained:** - Same-day OFF baseline reproduced expert 423's RMS failure and exit 1. OFF also failed both new cancellation cases as an expected negative control; final ON returned 0. - Ordinary CMake target options did not reach CANN's device compiler; that purported ON binary was unchanged and three runs reproduced the failure. A sum-only compensation candidate fixed 423 but failed expert 328. Both rejected configurations, sources and measurements are archived. - Earlier real-weight OFF runs remain `passed: false`. The initial exact-scale precheck failed at one ULP; failed transfers and earlier A2 prototype failures also remain documented. No thresholds were relaxed for the fix. **Not run / limits:** ON performance or A2 execution; arbitrary/subnormal/overflow inputs outside the documented compensation assumptions; original BF16 model weights; prompt activations; other layers; attention/GDN/QSA/cache/residual integration; default AVX/shared-activation parity; full inference/token generation; vision, HCCL or the second chip. Shared mixed-format weights are host-decoded then run with FP32 NPU operations; expert dispatch is a host loop. No model-quality or throughput claim. CUDA/HIP/SYCL/Metal and production engine, installer and root build files are untouched; their binaries were not rebuilt. The full 37.6 GB shard was not downloaded or independently hashed. ## Scope This updates the existing standalone benchmark PR. Initial open/closed searches found no matching Ascend/910B thread. No default or production backend change is requested; a full backend would need separate scope agreement. AI assistance was used for implementation, investigation and reporting. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4698
No description provided.