Skip to content

[CI] Add more multi-gpu tests - #1280

Merged
merrymercy merged 13 commits into
mainfrom
multi-gpu-tests
Sep 1, 2024
Merged

merrymercy merged 13 commits into
mainfrom
multi-gpu-tests

Conversation

@merrymercy

Copy link
Copy Markdown
Collaborator
  • Add multi-GPU accuracy tests
  • Rename moe-test.yml -> e2e-test-multi-gpu.yml

@merrymercy merrymercy changed the title Add more mulit-gpu tests [CI] Add more mulit-gpu tests Sep 1, 2024
@merrymercy merrymercy changed the title [CI] Add more mulit-gpu tests [CI] Add more multi-gpu tests Sep 1, 2024
@merrymercy
merrymercy merged commit 1b5d56f into main Sep 1, 2024
@merrymercy
merrymercy deleted the multi-gpu-tests branch September 1, 2024 07:27
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 14, 2026
…s/copy_ms/sync_ms

Coordinator order: before sgl-project#1369 (ring teardown) and sgl-project#1354 (remap flip)
both decide policy over this leg's time, the leg must say which pass it
spent that time in. resume()'s pass 1 (VMM cu_mem_create/cuMemMap/
cu_mem_set_access per allocation, core.cpp:335-ish before this commit)
was timed already (S7 sgl-project#1273, weg2_map_t0/t1) but pass 2 (async H2D
issue) and pass 3 (the single blocking cudaStreamSynchronize) were
lumped into one "copy_ms" -- so a per-tag ms could not say whether a
slow leg was wire-bound (the PCIe/duplex-limited sync) or map-bound
(pass 1's VMM cost, which scales with allocation count). On the x4
card this leg measured 2.35 s = 100% of the leg wall with no way to
tell which.

New: one additional std::chrono::steady_clock::now() read
(weg2_copy_issue_t1) between pass 2's issue loop and pass 3's
synchronise, and one more (weg2_sync_t1) right after the synchronise
returns -- splitting the old lumped window into copy_ms (issue alone)
and sync_ms (the synchronise alone). Plus weg2_leg_bytes, a host-only
sum computed before pass 1 even starts, as allocs='s companion
denominator for a GB/s reading. Printed as one new, unconditional line
(matching host_ring.cpp's existing WEG2-RING-OPEN/-ATTACH precedent,
not gated behind TMS_DEBUG_LOG):

  WEG2-RING LEG tag=<tag> remap_ms=<f> copy_ms=<f> sync_ms=<f> allocs=<n> bytes=<n>

HARD BOUNDARY HELD: no device call was added. Both new timestamps are
pure host-side chrono reads, in positions verified (by source-order
test, not assumed) to never move the pre-existing single
cudaStreamSynchronize or add a second one. note_resume()'s own S7
call site, arguments, and position are byte-for-byte unchanged; the
new print runs strictly AFTER it so the print's own (unbounded-latency)
stderr write cannot leak into S7's existing copy_ms reading.

Every field is a genuine measurement, never a fabricated 0: a tag that
touches zero allocations or needs zero H2D copies still produces a
real (near-zero) duration for that pass, following the exact
convention S7's own map_ms/copy_ms already established
(weight_updater.py's WEG2-FLIP-TAG line, allocations=0 map_ms=0.0 is
real, not absent). "n/a" is reserved for the ROCm build, which never
reaches this code path at all (rocm_resume is structurally different)
-- it prints nothing here, never a fabricated n/a line. Noted
explicitly in-comment: this line's own `copy_ms` (issue alone) is a
DIFFERENT quantity from WEG2-FLIP-TAG's `copy_ms` (issue+sync
combined) -- the two lines are deliberately not merged into one
publication path, to avoid a second, parallel ctypes/adapter
signature change for an already-wired instrument.

Tests: test_weg2_1280_ring_leg_split.py (12, hermetic, source-scan,
CUDA_VISIBLE_DEVICES=""): the hard boundary (exactly one
cudaStreamSynchronize remains), both new timestamps are plain chrono
reads, their source-order relative to pass 2/3 and to note_resume(),
the byte sum's position and its device-call-free window, the line's
field set/order, the duration formulas' endpoint pairs, unconditional
placement (no TMS_DEBUG_LOG guard), single call site, and the build
script's source list. Mutant proven: injected an extra
cudaStreamSynchronize immediately before weg2_sync_t1 --
test_no_new_device_synchronisation_was_added went red immediately;
reverted, git diff empty, 12/12 green again.
test_weg2_ring_hotpath_1235.py (18, pre-existing, C3/C4/C5/C6/R20/R12):
unaffected, still green -- the pre-existing single-synchronise/ordering
invariants this file already pinned are untouched.

Build (d): the preload .so is content-addressed
(sha256 of the 9 vendored tms_csrc sources, scripts/weg2/tms/
build_tms_preload.sh). This source edit changes the hash automatically
-- old 70b359a3e9ed, NEW fc7edac1bc86 -- and
scripts/weg2/tms/build_tms_preload.sh ran clean, producing
/spinning/gpu-arb/weg2/tms/torch_memory_saver_hook_mode_preload_cu13_ring_fc7edac1bc86.so
(g++ -fsyntax-only checked first). The boot seat must point
SGLANG_WEG2_TMS_PRELOAD_SO at the NEW hash, or it boots against the
pre-sgl-project#1280 hook and never sees this line.

Full trace and file:line: this commit message is the record (no
separate ANALYSE doc -- this posten built code, unlike the prior two
this session).
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