Skip to content

[Kernel][SM70] Default safe FP8 prescaled M1 decode - #316

Merged
yangzhuxinyzx merged 2 commits into
mainfrom
codex/v100-fp8-prescaled-m1-main-20260826-031636
Aug 26, 2026
Merged

yangzhuxinyzx merged 2 commits into
mainfrom
codex/v100-fp8-prescaled-m1-main-20260826-031636

Conversation

@yangzhuxinyzx

Copy link
Copy Markdown
Contributor

Purpose

Supersede #309 with a latest-main rebuild based on 1b1c9faeb82c30bf3d81158279404cd884bbfb19.

Absorb the exact E4M3 power-of-two exponent factor into reversible FP16 UE8M0 scales at load time for the measured SM70 M=1 tensor/runtime contract. Admission uses hardware, block layout, operator role, tensor shape, TP/PP topology, scheduler state, and actual scale values; it never reads model/checkpoint/type/architecture identity.

The route is default-on when its exact contract is available and remains behind the faster accepted QPN8 route. Missing old-extension capability or unsafe scale values fall back to ordinary TurboMind; explicit VLLM_SM70_FP8_PRESCALED_M1_DECODE=1 fails closed, and =0 is the rollback. A distinct M=1 operator schema prevents old 8K-prefill-only extensions from receiving the new shapes.

Test Plan

  • Reuse the recorded real-weight same-process CUDA Graph A/B/B/A operator screen.
  • Run focused admission, scale-reversibility, M=1 dispatch, and environment-default tests.
  • Run the complete repository pre-commit suite.
  • No end-to-end rerun, per current audit scope and because all V100s are occupied.

Test Result

  • Recorded real layer-0 TP4-rank0 screen: 320/320 changing-input comparisons bitwise equal across five M=1 shapes.
  • Fused WQA/WKV: 63.330 us to 20.577 us, 3.078x.
  • Five-shape weighted projection: -1.867 ms/token warm and -1.821 ms/token after cache scrub; production admission is intentionally narrower and does not claim endpoint TPOT.
  • pytest -q tests/quantization/test_sm70_fp8_prefill_exact_dense.py -k prescaled: 4 passed.
  • pytest -q tests/test_envs.py -k sm70_concurrency_tuning_envs: 1 passed.
  • pre-commit run -a: passed.
  • git diff --check origin/main: passed.

Evidence: /data/models/v100-dsv4-0731-pp2tp4-fp8-prescaled-decode-screen-20260826-r1/.

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
(cherry picked from commit b8d928d)
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx
yangzhuxinyzx marked this pull request as ready for review August 26, 2026 03:39
@yangzhuxinyzx
yangzhuxinyzx merged commit d9d0da2 into main Aug 26, 2026
4 checks passed
@yangzhuxinyzx
yangzhuxinyzx deleted the codex/v100-fp8-prescaled-m1-main-20260826-031636 branch August 26, 2026 03:39
yangzhuxinyzx added a commit that referenced this pull request Aug 27, 2026
#316 已合入受保护且默认开启的安全 prescale 实现。

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.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.

1 participant