Repository navigation
[Fix] humming: Free replaced MoE weights after each sublayer transform - #45200
Conversation
|
@jinzhen-lin @BBuf Could you take a look when you have time? |
6a0c46f to
f9f2e1f
Compare
BBuf
left a comment
There was a problem hiding this comment.
[BBuf Review Agent] LGTM. Please wait for the related CPU CI.
|
/tag-and-rerun-ci |
|
/rerun-failed-ci |
|
[BBuf Review Agent] @DarkraiHL these CI failures look related to this change, could you take a look?
|
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
The Humming transform swaps every MoE sublayer tensor for a padded, repacked copy of a different size. The sublayer helpers drop the originals when they return, but their blocks stay in the CUDA cache, later allocations split them, and the remainders stay reserved for the process lifetime. Empty the CUDA cache after each sublayer.
f9f2e1f to
1c38e9a
Compare
|
[BBuf Review Agent] @DarkraiHL these CI failures look related to this change, could you take a look?
|
Motivation
--moe-runner-backend hummingreplaces every MoE sublayer tensor with a padded, repacked copy of a different size while loading. The originals stay referenced until the next sublayer, and later allocations split their cached blocks, so much of that memory is never returned. On 8× H20-3e (141 GB), DeepSeek-V4.1-Flash with TP-sharded experts holds 100.6 GB per GPU after loading at TP4 (81.8–82.2 GB with this PR) and 57.1 GB at TP8 (50.0 GB). At TP4, with or without DSpark, the server fails to start with the default--mem-fraction-static 0.8(TP4 + DSpark shown):Modifications
torch.cuda.empty_cache(), in both Humming MoE paths. Padding, kernels and the forward pass are unchanged.test_humming_moe_release_replaced.py: no replaced tensor is still referenced when the cache is emptied, for both paths. It fails on main.Accuracy Tests
GSM8K (
python -m sglang.test.few_shot_gsm8k, 1319 questions):Speed Tests and Profiling
8× H20-3e,
lmsysorg/sglang:nightly-dev-20261019-3c560089, the DeepSeek-V4.1-Flash H200 low-latency cookbook recipe with--moe-runner-backend humming --ep-size 1,SGLANG_HUMMING_INPUT_QUANT_CONFIG='{"dtype": "float8e4m3"}'andSGLANG_ENABLE_DSV41_ENGRAM_HOST_TABLE=1. Decode:python -m sglang.bench_serving --dataset-name random-ids --random-input-len 1024 --random-output-len 512; TP8 is the mean of 3 alternating runs on one node.With #45083 (TP4 + CP4 + DSpark), KV grows from 4.88M to 10.88M tokens. Loading is not slower. With Humming's generic SM90 heuristics (the ones H100/H200 select) forced on the same machine, the memory numbers are the same and TP4 + DSpark starts.
Checklist
CI States
Latest PR Test (Base): ❌ Run #41305143474
Latest PR Test (Extra): ❌ Run #41305143468
Latest PR Test (AMD ROCm 10): ❌ Run #41305143371
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: