Repository navigation
Qwen4 v0.5.21 rfork and CI test case - #98
Merged
Merged
Conversation
yicyang
commented
Nov 9, 2026
Collaborator
- Cherry pick of Fix R-Fork weight loading on MI308X #67
- Add TP2 R-Fork test case in CI
* [AMD] Make R-Fork (remote_instance, nccl) work for Qwen3.8-Flash-Next FP8 on MI308X - Client runs quant post-processing before receiving so tensor layout/dtype (fnuz, PyHIP GR packing) matches the seed. - Recompute load-time derived buffers (gemma_weight) after the raw copy. - Exchange a (name, shape, dtype) manifest digest before broadcasting; a mismatch now fails fast on both sides instead of deadlocking RCCL (seed RoPE caches grow at runtime). - Seed no longer crashes when a send group failed to init; client checks build_group result. - SGLANG_DEBUG_WEIGHT_CHECKSUM_DIR: per-rank post-load checksums. - Client launch script and validation report (benchmark/rfork_mi308x). * [AMD] Validate ModelExpress-style startup paths on MI308X; fix Mooncake HIP R-Fork - R-Fork transfer_engine: on ROCm register whole allocator segments, working around Mooncake HIP transport resolving addresses from the IPC allocation base (silently wrong weights otherwise); add standalone repro. - R-Fork transfer_engine: recompute derived buffers after the copy. - Benchmark tools: startup timer, per-model page-cache eviction, first-request latency, raw fastsafetensors throughput, weight-cache daemon shim. - Report: kernel-cache transfer, storage loaders (fastsafetensors, runai, prefetch, no-mmap), Mooncake vs RCCL, weight_cache limitation. * benchmark/rfork_mi308x: add per-phase startup time breakdown * Add weight-iterator timing debug switch; report per-rank disk read vs load_weights and full launch commands SGLANG_DEBUG_WEIGHT_ITER_TIMING logs time blocked on the checkpoint iterator vs time in load_weights, and splits fastsafetensors into file read and per-tensor distribution. * benchmark/rfork_mi308x: add bench_startup.py startup-time matrix * benchmark/rfork_mi308x: add TP2 results and seed-stall finding * benchmark/rfork_mi308x: correct runai/no-mmap memory note (peak only, KV unaffected) * remote_instance: refresh KV-cache scale floats after receiving weights Receivers run process_weights_after_loading before the copy, which sets k_scale_float/v_scale_float from the -1 placeholders (1.0). The copy then brings the seed's final k/v_scale tensors, but the floats consumed by the attention backends stayed at 1.0 for checkpoints with non-unit KV scales. Refresh them from the received tensors next to the alias rebind. * benchmark/rfork_mi308x: make bench_startup cache/GPU state explicit - warm page cache is now prepared (read in) and verified like cold; abort if residency is not reached (O_DIRECT loaders left "warm" runs cold) - remove a stale log before launch so an old "fired up" is not taken as ready - non-R-Fork runs use HIP_VISIBLE_DEVICES (fastsafetensors uses cuda:rank and ignores --base-gpu-id); R-Fork ranges must be contiguous, equal size, disjoint - refuse to launch on GPUs with >2 GiB in use; interleave repeats * benchmark/rfork_mi308x: add verify_rfork.py; rewrite README with TP2/TP4 rerun Full rerun at 378743602 with the same scripts and table layout for TP2 and TP4: startup matrix (6 configs x page cache warm/cold x 2), cold kernel cache, per-rank checksums and GSM8K for disk/RCCL/Mooncake. README shortened; adds script usage. * benchmark/rfork_mi308x: clarify R-Fork cold page-cache cells were not run * benchmark/rfork_mi308x: measure R-Fork configs with a cold page cache too * Trim PR to necessary changes Drop what was only used for analysis or convenience: - RCCL transfer manifest check (guarded a buffer-transfer variant that is not used; parameters-only transfer as before) - SGLANG_DEBUG_WEIGHT_ITER_TIMING and the iterator/fastsafetensors timers - rfork client launch script and analysis-only benchmark tools * benchmark/rfork_mi308x: README with usage and results only * benchmark/rfork_mi308x: drop prefetch config and results (no gain measured) * benchmark/rfork_mi308x: stop the seed when a run aborts * load_model_utils: correct the checksum peak-memory comment * scripts: add a reference launcher for the fast-startup options * scripts: add a cross-container R-Fork reference launcher Starts the new instance in its own container on the same node (host network, shared IPC, GPU devices) and runs MODE=rfork against a seed in another container. CROSS_CONTAINER.md lists the requirements, usage and one TP2 measurement. * Drop Mooncake, storage loaders and seed-startup options; keep R-Fork over RCCL - transfer_engine path is back to the base branch: no whole-segment registration workaround, no pre-receive processing or derived-state restore for it (both now NCCL only) - remove mooncake_hip_offset_repro.py - bench_startup.py: configs disk and rfork_nccl only; drop the kernel-cache option; place every run with HIP_VISIBLE_DEVICES - verify_rfork.py: disk seed + RCCL instance only - launcher renamed to launch_qwen38_flash_next_fp8_mi308x_rfork.sh with MODE=seed|rfork; cross-container launcher is RCCL only - README: R-Fork scale-out effect, dependencies (none beyond ROCm), usage * benchmark/rfork_mi308x: README results from the TP2 re-run at the RCCL-only head * benchmark/rfork_mi308x: README TP2 results re-measured at the rebased head --------- Co-authored-by: yicyang <[email protected]> (cherry picked from commit 6ca1975 on qwen38-flash-next-amd-current-fix-install) Conflicts resolved in loader.py (post_load_weights rename, import block) and load_model_utils.py (PLE offload condition now read via get_exec()). Signed-off-by: yicyang <[email protected]> Signed-off-by: Ethan Yang <[email protected]>
Launch scripts live in evaluation/ on this branch, so move the R-Fork launchers there and point bench_startup.py at evaluation/. The base launch script defaults MTP=1 here; R-Fork is validated without the MTP draft model, so the R-Fork launcher and bench_startup.py default MTP=0. Signed-off-by: yicyang <[email protected]>
Qwen3.8-Flash-TP2-RFork starts a TP2 seed from disk, then a TP2 instance on two other idle GPUs that pulls the seed's weights over RCCL (--load-format remote_instance). It fails unless the new instance loads via R-Fork, every rank's per-tensor checksums match the seed, and the new instance passes the TP2 GSM8K gate (reference 98.0%). The summary also reports the new instance's startup time and load_weight. Under --pressure it only checks loading and checksums. Signed-off-by: yicyang <[email protected]>
yicyang
force-pushed
the
qwen4_v0.5.21-rfork
branch
from
November 9, 2026 08:39
1f5d51a to
6a6ceed
Compare
sammysun0711
reviewed
Nov 9, 2026
The launcher no longer requires or mounts a host workspace directory. The new container runs the image's SGLang at REPO_DIR (default /opt/sglang); DOCKER_ARGS passes extra docker run arguments, e.g. a mount for a host checkout used with REPO_DIR. Signed-off-by: yicyang <[email protected]>
…notes - Qwen3.8-Flash-TP2-RFork is daily-only: PR runs skip it, the daily schedule and an explicit case selection run it. matrix_cases() in qwen4_ci.py now builds the Actions matrix and is unit tested. - Under --pressure the R-Fork case also checks the complete seed and server logs after shutdown, like the other pressure cases. - README: remove the measurement footnotes. Signed-off-by: yicyang <[email protected]>
Collaborator
|
RFork mainly focus on ModelExpress feature implementation, model performance and accuracy should keep flat w/ run-to-run variance.. MI308X CI: PR #90 baseline → PR #98
Changes are
Additional CI summary metrics:
|
sammysun0711
approved these changes
Nov 10, 2026
apinge
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.