Repository navigation
Fix bench latency benchmark - #1225
Merged
Merged
Conversation
Collaborator
|
Add this to CI? It breaks very frequently |
Collaborator
Author
|
@merrymercy Sure. Is the torch-compiled latency test needed or not? |
Collaborator
|
@hnyls2002 This is a critical fix. Please revert your CI change and merge it soon. |
zhyncs
reviewed
Aug 27, 2024
Contributor
|
I encountered an error when using this branch of the code (bench_latency.py only). python3 bench_latency.py --model google/gemma-2-2b --correct --output-len 16 --trust-remote-code
Init nccl begin.
Load weight begin. avail mem=78.74 GB
WARNING 08-27 13:09:48 interfaces.py:132] The model (<class 'sglang.srt.models.gemma2.Gemma2ForCausalLM'>) contains all LoRA-specific attributes, but does not set `supports_lora=True`.
INFO 08-27 13:09:49 weight_utils.py:236] Using model weights format ['*.safetensors']
Loading safetensors checkpoint shards: 0% Completed | 0/3 [00:00<?, ?it/s]
Loading safetensors checkpoint shards: 33% Completed | 1/3 [00:00<00:01, 1.73it/s]
Loading safetensors checkpoint shards: 67% Completed | 2/3 [00:01<00:00, 1.44it/s]
Loading safetensors checkpoint shards: 100% Completed | 3/3 [00:01<00:00, 2.10it/s]
Loading safetensors checkpoint shards: 100% Completed | 3/3 [00:01<00:00, 1.91it/s]
Load weight end. type=Gemma2ForCausalLM, dtype=torch.bfloat16, avail mem=73.54 GB
Memory pool end. avail mem=9.20 GB
Capture cuda graph begin. This can take up to several minutes.
max_total_num_tokens=646246
input_ids=[[2, 651, 6037, 576, 6081, 603], [2, 651, 6037, 576, 573, 3520, 11392, 537, 603], [2, 15528, 603, 476, 30619, 1744, 578, 590, 1154]]
[rank0]: Traceback (most recent call last):
[rank0]: File "/data/zhyncs/back/sglang/bench_latency.py", line 493, in <module>
[rank0]: main(server_args, bench_args)
[rank0]: File "/data/zhyncs/back/sglang/bench_latency.py", line 453, in main
[rank0]: work_func(server_args, bench_args, 0)
[rank0]: File "/data/zhyncs/venv/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
[rank0]: return func(*args, **kwargs)
[rank0]: ^^^^^^^^^^^^^^^^^^^^^
[rank0]: File "/data/zhyncs/back/sglang/bench_latency.py", line 235, in correctness_test
[rank0]: next_token_ids, next_token_logits, batch = extend(reqs, model_runner)
[rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: File "/data/zhyncs/back/sglang/bench_latency.py", line 207, in extend
[rank0]: sample_output = sampler.forward_cuda(logits_output, batch.sampling_info)
[rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: File "/data/zhyncs/back/sglang/python/sglang/srt/layers/sampler.py", line 80, in forward_cuda
[rank0]: probs = self._get_probs(logits, sampling_info)
[rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: File "/data/zhyncs/back/sglang/python/sglang/srt/layers/sampler.py", line 56, in _get_probs
[rank0]: logits = logits.contiguous()
[rank0]: ^^^^^^^^^^^^^^^^^
[rank0]: AttributeError: 'tuple' object has no attribute 'contiguous' |
merrymercy
force-pushed
the
fix-latency-bench
branch
from
August 28, 2024 07:26
9c844f8 to
d110dc6
Compare
merrymercy
approved these changes
Aug 28, 2024
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
Hide-on-bushsh
pushed a commit
to Hide-on-bushsh/sgl-project
that referenced
this pull request
Sep 7, 2026
…5-models test(npu): remove 86 legacy model test cases
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 16, 2026
…ads only frames in flight (_pp_launched_batches + chunked_req), a busy-PP0 vote keeps the hold, a second abort joins an open hold A1: pp0_inflight_reqs read mbs / last_batch / running_*, which keep a COMPLETED batch until the slot is planned again. A rid that ran on every rank and was requeued on every rank (#968b requeue, void park, retreat) then stamped True; PP0 popped it at receipt and the followers held an abort no frame ever ends (reviewer probe P2: still held after 50 frameless passes, released only by the next idle-PP0 lap). Now: _pp_launched_batches (set at the launch on every rank, popped when the slot's result is consumed, sgl-project#1225) plus chunked_req. A2: negative test for weg2_791c_release_on_idle_vote -- a vote with PP0 busy keeps the hold, the frame stays executable, the admitting plan applies PP0's abort (kills R2). Defence: a second abort of a rid whose hold is open joins the hold instead of popping at receipt on a later stamp (reviewer P1, unreachable under the ring invariant). Tests: test_weg2_pp_waiting_abort_k14_1015.py 30/30 (6 new: A1 completed-slot + requeued rid -> stamp False, no zombie; A1 mutant (old inflight form) -> zombie after 50 passes; A2 busy vote keeps the hold; A2 mutant R2 -> sgl-project#1180; second abort joins; mutant no-join -> sgl-project#1180). Specimen tests stay green.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 16, 2026
…like the live loop; S10b puts a COMPLETED slot-2 batch of the requeued rid in mbs/last_batch (nf-review-k14-1016 A1) S10/S10c: PP0's launched slot-2 batch is also registered in _pp_launched_batches (sgl-project#1225, set at the launch on every rank). S10b: the rid ran everywhere, slot 2 delivered (mbs and last_batch still hold the completed batch, _pp_launched_batches does not), requeued everywhere, then the abort -- G10 is red if a follower is left holding it (the zombie). Matrix: fa7d8e1 (K14 + Nachbesserung) 35/35 GRUEN; 6d2ca68 S10b ROT 'G10 ABORT-UNIFORM' (the A1 zombie), rest GRUEN; 1cfbf32 S10 and S10c ROT GRUPPENSTOPP sgl-project#1180, rest GRUEN.
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.
Motivation
Modifications
Checklist