Repository navigation
[Feature, Hardware] Enable SGLang on AMD GPUs via PyTorch for ROCm - #1420
Merged
Merged
Conversation
15 of 29 tasks
merrymercy
requested changes
Sep 14, 2024
Collaborator
There was a problem hiding this comment.
- We deprecated
--disable-flashinfer --disable-flashinfer-sampling. Please use--attention-backend triton --sampling-backend pytorchinstead. - Alternatively, you can set these backends automatically here https://github.com/HaiShaw/sglang/blob/8715deff22727382ce6f74768213e3e72f413f71/python/sglang/srt/server_args.py#L155
if is_hip():
self.attention_backend = "triton"
self.sampling_backend = "pytorch"- The sampler + cuda graph issue has been fixed by #1392. You can rebase and try it again.
python -m sglang.bench_latency --model-path TinyLlama/TinyLlama-1.1B-Chat-v0.4 --attention-backend triton --sampling-backend pytorchThis runs correctly.
merrymercy
requested changes
Sep 16, 2024
merrymercy
reviewed
Sep 17, 2024
merrymercy
approved these changes
Sep 17, 2024
|
rocm 6.1.2 |
Collaborator
|
@linqingxu try |
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 16, 2026
… the match walk names the child keys it has vs wants when it stops with key left (D reached 4314 of 98550 with the prefetched chain below); write_backup names its refusal branch (sweep refused=34 at in_flight=2, drain W3). Tests: 1417, 1175: 10 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 26, 2026
…NG_ANTHROPIC_INLINE_SYSTEM_IN_PLACE, default off) Claude Code 2.1.280 sends mid-conversation role:"system" messages (api_system: tool additions/removals, output_config). With the Qwen3.8 template (head-only system turn) the Anthropic adapter hoisted them into the head system turn, so the first turn that carries one re-renders every token behind the system text. Measured on D: radix sgl-project#1420 WALK-STOP and the arena key chain (sgl-project#1439 leading_complete) both stop at the end of the system turn -- depth 3876 (dkr27bnvfp4bar1agent09252328, weg2-14-16/-17) and 4655 (dkr27bbar1final09260145, weg2-12-12), stored (13,248046)=".<|im_end|>", new (13,198)=".\n" (the "\n".join of the hoist). The sgl-project#904 census then reads MambaComponent:absent at that depth, X-GATE W31, X-REQUEUE, one P epoch. The front's request_text renders the same message in place and credits the whole previous turn (presence_span 19335/20168), so it routes SHORT. Switch on: non-leading inline system messages become a user turn at their position, wrapped in <system-reminder>; the leading run is still merged into the head. Must be set identically on P and D (handoff keys are P's tokenization). Off = byte-identical to before. Tests (test27b.sh, CPU): test_inline_system_in_place.py 5 passed (off pins the break at ".\n", on pins turn N as a rendered prefix of turn N+1); anthropic/test_serving.py + test_anthropic_557.py + test_anthropic_rid_h90.py + weg2/test_weg2_messages_wire_rc7_0925.py: 100 passed together. UNIFY (UN6, Operator 26.09.): pick of desk/27b-mambaend-0926 (2303948, MZ, base 0644c6f) after the sgl-project#49-rest port, clean. dup_defs_gate: 0 new. test27b.sh: test_inline_system_in_place + anthropic/test_serving + test_anthropic_557 + test_anthropic_rid_h90 91 passed, 9 subtests.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 26, 2026
…gl-project#49 armed lines Every prefix miss of an agent-load boot gets a token receipt. With SGLANG_WEG2_PREFIX_TRACE=1 (min rest SGLANG_WEG2_PREFIX_TRACE_MIN_TOKENS, default 1024), read once per process (weg2/prefix_trace.py, armed line "#PT PREFIX-TRACE armed=<0|1> min_tokens=M group=G pid=P"): - sgl-project#1420 WALK-STOP: one line per (rid, stop depth) with rest >= min, no process cap, root stops included; appends "rid=<full> trace=1 stop_node=N stop_hash=H want_run=[..] have_run=[[..]]". A split stop now names the TRUE rest and want (the un-advanced key made depth+remaining exceed pt-1 by the split's matched part; also untraced). - sgl-project#1400/sgl-project#1416/#1416d/#1416e (and TK's sgl-project#1442 ADOPT / TK ABS-TOLD): full rid, 8/256 sampling lifted. - sgl-project#1442 HANDOFF-KEYS REG, sgl-project#1040 EXTENT STATE-ALIGN: one line per distinct (rid, matched, span) / (rid, extent). - sgl-project#1469 EVICT: uncapped (outside the 600), + parent, pages, hash_first, hash_last, key_len, trace=1. - sgl-project#1427 ARENA-DROP: uncapped, + "trace=1 claim=<stem> dropped=<lo64 hex,..>". - sgl-project#1439 ARENA-PRESENT: once per distinct (keys, leading, first stem) with rest >= min, + "trace=1 break_stem_full=<stem>" (joinable to dropped=). No traced line sits on the decode round path. Armed lines (once per process): "#MZ INLINE-SYSTEM-IN-PLACE armed= merge= group= pid=" (anthropic adapter, P and D HTTP process) and "WEG2-FRONT sgl-project#49 SPAN-INFLIGHT armed= role=front pid=" (front start). Tests (desk, CUDA_VISIBLE_DEVICES="", test27b.sh): Base: desk/27b-unified-0926 @ 2bddf04 (rebased from f4b6f21, clean). - new test/registered/unit/mem_cache/test_weg2_prefix_trace_in.py: 16 passed - rebased run, all files below plus test_weg2_store_told_{hold,positive}_tk: 324 passed - managers/test_weg2_store_told_{1400,paced_1416e}, test_weg2_p_twin_defer, test_prefetch_deferral_1068, test_weg2_p_burst_clock_h42c, test_weg2_p_multi_anchor_tails_h42, anthropic/test_inline_system_in_place, mem_cache/test_arena_{queue_refs_27b,inner_anchor_release_0924}, test_backup_ack_drain_tp_asymmetry_h74, test_hicache_drain_budget_27b, weg2/test_weg2_{p_intake_h91a,front_span_inflight_fs,arena_reset_release_h81, node_value_trail_1469}, test_producer_phase_census_wiring_1061: 232 passed - test_hicache_arena_claim_1427, test_weg2_handoff_1442, test_weg2_store_short_tail_xsn437, test_evict_frees_the_bound_allocator_941, test_weg2_p_trim_end_anchor_0924: 50 passed - test_unified_radix_cache_unittest.py, per class, against the base: identical FAILED sets (pre-existing on the CPU desk; ps128_sw4/sw128 OOM in the 3 GiB cgroup on both trees) Unify note (RM, pick onto 2a7f992): conflicts line by line (store_told: PF fallback forget kept + IN _rt(rid); front: IN line helper + the P49 request_text signature). The sgl-project#49 SPAN-INFLIGHT armed line also names agent_span (the inflight credit needs the sgl-project#49 span, profile field agent_span); its test pin follows.
4 of 5 tasks
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
Bypass
FlashInferbackend untill it is available on AMD/ROCmAdd proper fix for AMD FP8
e4m3fnuzto support Fused_MoEDependency over
vLLM>=0.5.5, I modifiedpyproject.tomljust to confirm that it works up to 0.6.0 as well.Misc.
TODO: follow-up to address one error (below) when
cuda-graphis enabled.How to run
Checklist