Skip to content

[Fix] [AMD] dsv41: Set moe act to fp8 by default - #45480

Merged
HaiShaw merged 4 commits into
sgl-project:mainfrom
1am9trash:v41-fp8-moe-act
Oct 21, 2026
Merged

HaiShaw merged 4 commits into
sgl-project:mainfrom
1am9trash:v41-fp8-moe-act

Conversation

@1am9trash

@1am9trash 1am9trash commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Dsv4.1's moe layers currently run on bf16 activations by default when a batch <= 256 tokens. Setting AITER_BF16_FP8_MOE_BOUND=0 or --monokernel-backend amd switches them to FP8.

InferenceX does not accept changing precision through flags like these, because they also change the precision of the dspark draft layers. (PR#4238)

This PR makes fp8 the default moe activation for V4.1 instead.

Modifications

The aiter moe runner passes quant_dtype_a=fp8 to fused_moe instead of letting AITER_BF16_FP8_MOE_BOUND pick bf16 for small batches.

Other models (ex: dsv4) and other platforms are unchanged.

Accuracy Tests

Test with sgl-project/sgl-amd-mono#17.

Server cmd:

TORCH_BLAS_PREFER_HIPBLASLT=1 HSA_NO_SCRATCH_RECLAIM=0 GPU_MAX_HW_QUEUES=2 TRITON_HIP_USE_ASYNC_COPY=0 \
SGLANG_ENABLE_DSV41_ENGRAM_HOST_TABLE=1 SGLANG_DSV41_ENGRAM_HOST_TABLE_LAYOUT=per_rank \
SGLANG_USE_AITER=1 ROCM_QUICK_REDUCE_QUANTIZATION=INT8 \
SGLANG_OPT_HIP_OPUS_SPARSE_PREFILL=true SGLANG_OPT_HIP_FLYDSL_MXFP8=1 \
SGLANG_HIP_FP4_INDEXER_ROWGROUP=1 SGLANG_HIP_DSV41_INDEX_K_PAGE8=1 \
python3 -m sglang.launch_server --model-path /models/DeepSeek-V4.1-Flash \
  --served-model-name /models/DeepSeek-V4.1-Flash --trust-remote-code --tp 2 \
  --speculative-algorithm DSPARK --speculative-dspark-block-size 5 \
  --monokernel-backend amd --enforce-shared-experts-fusion \
  --fp8-gemm-backend aiter --cuda-graph-max-bs-decode 64 \
  --enable-decoder-swa-bounded-replay --cuda-graph-backend-prefill disabled \
  --mem-fraction-static 0.80 --chunked-prefill-size 16384 --prefill-decode-interval 96 \
  --swa-prefix-tails 1024 --max-running-requests 32 \
  --host 0.0.0.0 --port 8000

GSM8k:

100%|█████████████████████████████| 1319/1319 [00:49<00:00, 26.57it/s]
Accuracy: 0.899
Invalid: 0.000
Latency: 49.747 s
Output throughput: 2471.309 token/s

Speed Tests and Profiling

No impact on perf. Same with setting AITER_BF16_FP8_MOE_BOUND=0 before.

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): ⏳ Run #39552505890
Latest PR Test (Extra): ❌ Run #39552505858
Latest PR Test (AMD ROCm 10): ⏳ Run #39552505913

@1am9trash
1am9trash marked this pull request as draft October 21, 2026 02:32
@1am9trash
1am9trash marked this pull request as ready for review October 21, 2026 03:21
@1am9trash 1am9trash added amd run-ci CI: run the baseline test suite on this PR labels Oct 21, 2026
Comment thread python/sglang/srt/models/deepseek_v4.py Resolved
@HaiShaw
HaiShaw merged commit bd5a445 into sgl-project:main Oct 21, 2026
107 of 124 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

amd deepseek run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants