Skip to content

fix batch error for llava-hd - #98

Merged
merrymercy merged 2 commits into
mainfrom
fix-llava-hd
Jan 25, 2024
Merged

merrymercy merged 2 commits into
mainfrom
fix-llava-hd

Conversation

@caoshiyi

Copy link
Copy Markdown
Contributor

No description provided.

@merrymercy
merrymercy merged commit 0147f94 into main Jan 25, 2024
@merrymercy
merrymercy deleted the fix-llava-hd branch January 25, 2024 15:56
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
renxinx added a commit to renxinx/sglang that referenced this pull request Apr 2, 2025
NorthmanPKU pushed a commit to NorthmanPKU/sglang that referenced this pull request May 16, 2025
…d input/output strides for kernel graphs. (sgl-project#98)

* initial docs

* update path

* add doxygen files

* add more

* update docs

* add more files

* fix typo

* link update

* add gated mlp

* add more tutorials

* format

* add transpiler docs

* .

* .

* .

* .

* .

* update RMSNorm example

* adjust image width

* Update LoRA tutorial

* update files

* fix typo

* transpiler doc fix (sgl-project#89)

* transpiler doc fix

* fmt

* .

* checkpoint

* Add files via upload

* Update README.md

* add file

* add demo

* update demo

* minor changes

* add input_strides into KNInputOp

* support output_strides

* transpiler add input/output stride (sgl-project#101)

---------

Co-authored-by: Xinhao Cheng <[email protected]>
Co-authored-by: Zhihao Jia <[email protected]>
pi314ever pushed a commit to pi314ever/sglang that referenced this pull request Aug 5, 2025
* [LLama3.1-70b][2x] resolve functional failure

* Syntax fix
sammysun0711 pushed a commit to sammysun0711/sglang that referenced this pull request Dec 16, 2025
vschandramourya pushed a commit to vschandramourya/sglang that referenced this pull request Feb 3, 2026
* fix mpt weight loading for nvfp4 target model.

* fix cutlass fp4

---------

Co-authored-by: Jue Wang <[email protected]>
vschandramourya pushed a commit to vschandramourya/sglang that referenced this pull request Feb 3, 2026
blzheng pushed a commit to blzheng/sglang that referenced this pull request Feb 4, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Jul 26, 2026
… group collective

Found by booting it: Nordstern L0 S4 (TP=5 over two hosts, EAGLE3, solo draft
placement, --disable-cuda-graph). Ranks 1-4 reached "Tree cache initialized"
and started their health checks; rank 0 went silent for 8 minutes until the
launcher killed it. py-spy on the solo rank:

    all_gather_object (distributed_c10d.py)
    _harmonize_cuda_graph_plan (model_runner.py:1098)
    init_cuda_graphs (model_runner.py) <- tp_worker <- eagle_worker_v2

Under --speculative-draft-placement solo only the solo rank owns a real draft
runner; the shadow ranks get a stub (install_shadow_draft_runner_surface) and
never call init_cuda_graphs on it. The harmonisation's all_gather_object is
group-wide, so the solo rank entered a collective no other rank would ever
join. This is independent of nnodes -- it is a property of solo placement.

Fix: skip the harmonisation when spec_solo_rank_local_graphs is set. That flag
already declares exactly this ("this runner's graphs are captured rank-locally,
the shadow ranks skip draft capture entirely") and already suppresses the
capture backends' per-warmup TP barrier; the harmonisation is a second group
collective in the same category. It also MUTATES the shared cuda_graph_config,
so letting the draft runner harmonise could disable a phase for the target
runner too.

Also in this commit, from the same window:

* sgl-project#76 GUARD HARDENED (sgl-project#98 sighting). The trigger is no longer "topk > 1" but
  "anything that would activate a tree-masked verify", via the new
  ServerArgs.tree_verify_activation_reason(). Upstream carries three
  unconsolidated PRs (sgl-project#31069/sgl-project#29587/sgl-project#29907) adding
  --speculative-dflash-tree-verify, a SECOND door onto the terrain sgl-project#76 fenced
  off. It does not exist here yet, so it is read with getattr: the guard is
  armed for its arrival instead of waiting to be remembered during a merge.
  The refusal is not theoretical -- see the byte-gate numbers below.
* l0_rank.sh: --max-total-tokens is now optional (MAXTOK=0 leaves the KV pool
  uncapped) because a tok/s number without the context it was reached at is not
  a result (harness rule sgl-project#4).
* l0_launch.sh: forward MAXTOK/MEMFRAC/EXTRA to the second host. They were not
  forwarded, so MAXTOK=0 applied to the main rig only: rank 0 sized its pool to
  133802 tokens while ranks 3/4 silently kept the 2048 default. A capacity
  number measured that way means nothing.

TESTED

CPU: test_uneven_tp_args.py -- 13 passed (TreeSpec*), both directions. The new
flag is rejected under uneven DCP WITH topk=1 (i.e. exactly the case the old
guard would have let through), the healthy path (chain, no tree verify) stays
open with the flag false AND with it absent, the original topk door still
rejects, the message names which flag tripped it, and a single-GPU tree run is
untouched. Full suites: server_args + spec kernel backend -- 271 passed.

GPU, RTX 5090, byte gate step 1 (native sgl_kernel vs Triton spec kernels,
identical inputs, bit comparison of every output tensor of build and verify):
  topk=1 chains  16/16 EXACT   (bs 1-2, steps 2-3, FULL_MASK and QLEN_ONLY)
  topk=2,4 trees 8/32 exact -- tree_mask differs by 6-13 elements, and one
                 case raised a CUDA error inside the Triton kernel
So the group-decision's refusal of topk>1 on the Triton path is now measured,
not precautionary, and this guard's subject matter is the same computation.

GPU, five ranks, both hosts (Llama-3.1-8B fp16, ratio 4,3,3,2,1, ctx 2048,
eager, HTCCL/gloo): S4 (solo) and S3 (split) BOTH BOOT AND SERVE after this
fix. That is the first live proof of the narrowed nnodes gate (f34a343) and
of the capability-keyed spec kernels (4bcb310) -- ranks 3 and 4 have no
sgl_kernel, so the group ran the Triton path end to end.
yicyang added a commit to yicyang/sglang that referenced this pull request Nov 10, 2026
* Fix R-Fork weight loading on MI308X (sgl-project#67)

* [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]>

* R-Fork: adapt the cherry-picked scripts to qwen4_v0.5.21

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]>

* [CI] Add a same-container TP2 R-Fork case to the Qwen4 CI

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]>

* R-Fork cross-container launcher: drop the private workspace mount

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]>

* [CI] Run the R-Fork case in the daily schedule only; drop README footnotes

- 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]>

---------

Signed-off-by: yicyang <[email protected]>
Signed-off-by: Ethan Yang <[email protected]>
Co-authored-by: yicyang <[email protected]>
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.

2 participants