Skip to content

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

Closed
zhachar14h-cell wants to merge 3 commits into
Niko1221:mainfrom
zhachar14h-cell:codex/ascend-a2-s2-prototype
Closed

zhachar14h-cell wants to merge 3 commits into
Niko1221:mainfrom
zhachar14h-cell:codex/ascend-a2-s2-prototype

Conversation

@zhachar14h-cell

@zhachar14h-cell zhachar14h-cell commented Oct 21, 2026 •

Copy link
Copy Markdown

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.

@zhachar14h-cell zhachar14h-cell changed the title [Benchmark] add an isolated Ascend 910B3 S2 projection probe [Benchmark] add isolated Ascend A2/A3 S2 projection probes Oct 21, 2026
Add an opt-in compensated product/sum path, retain failed candidates,
and validate all 512 real experts on A3 in three fresh processes.
Keep the default projection binary byte-identical and return failure
status for completed MoE collections with numerical failures.
@zhachar14h-cell zhachar14h-cell changed the title [Benchmark] add isolated Ascend A2/A3 S2 projection probes [Benchmark] validate Ascend MoE and compensate S2 rounding Oct 22, 2026
@zhachar14h-cell

Copy link
Copy Markdown
Author

@Niko1221 Could you approve the pending CI runs when you have a moment?

The PR includes A3 real-weight MoE validation, a same-day baseline, and an opt-in accuracy fix with unchanged defaults. Feedback on whether this standalone benchmark scope fits the project would also be appreciated. Thanks!

@Niko1221

Copy link
Copy Markdown
Owner

Thank you for the benchmark. The results are saved in our benchmark records, so I'm closing this pull request without merging it.

@Niko1221 Niko1221 closed this Nov 18, 2026
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