Skip to content

Fix sglang compat with vllm 0.4.3 - #487

Closed
Qubitium wants to merge 1 commit into
sgl-project:mainfrom
Qubitium:vllm_compat_cache_config
Closed

Qubitium wants to merge 1 commit into
sgl-project:mainfrom
Qubitium:vllm_compat_cache_config

Conversation

@Qubitium

@Qubitium Qubitium commented May 29, 2024 •

Copy link
Copy Markdown
Contributor

FIX vllm 0.4.3 compat with sglang main. Due to recent vllm refractor, dynamic model loader code now expects a cache_config: Optiona[CacheConfig] property for various prefix/kv caching usage. Sglang doesn't use this so safe to just add to def __init__() and ignore this.

  • PASSED Command-R loading/inference
  • PASSED Yi9B loading/inference

@merrymercy

Copy link
Copy Markdown
Collaborator

We do not always need to be compatible with the vllm main, but we will try to be compatible with the latest vllm release. Could you check the compatibility with vllm v0.4.3 https://github.com/vllm-project/vllm/releases/tag/v0.4.3 ?

@m0g1cian

m0g1cian commented Jun 2, 2024 •

Copy link
Copy Markdown

We do not always need to be compatible with the vllm main, but we will try to be compatible with the latest vllm release. Could you check the compatibility with vllm v0.4.3 https://github.com/vllm-project/vllm/releases/tag/v0.4.3 ?

I tried to run [email protected] with [email protected] today. SRT on single GPU is working fine.

SRT throws an error when using all GPUS (CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7) tensor parallelization (--tp) is enabled:

Initialization failed. router_init_state: Traceback (most recent call last):
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/manager.py", line 71, in start_router_process
    model_client = ModelRpcClient(server_args, port_args, model_overide_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 724, in __init__
    self.step = async_wrap("step")
                ^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 715, in async_wrap
    fs = [rpyc.async_(getattr(m, func_name)) for m in self.model_servers]
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 715, in <listcomp>
    fs = [rpyc.async_(getattr(m, func_name)) for m in self.model_servers]
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 707, in init_model
    return self.remote_services[i].ModelRpcServer(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/netref.py", line 239, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/netref.py", line 63, in syncreq
    return conn.sync_request(handler, proxy, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 744, in sync_request
    return _async_res.value
           ^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/async_.py", line 111, in value
    raise self._obj
_get_exception_class.<locals>.Derived: Invalid device string: 'cuda:-1'

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 369, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 863, in _handle_call
    return obj(*args, **dict(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 76, in __init__
    self.model_runner = ModelRunner(
                        ^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_runner.py", line 280, in __init__
    initialize_model_parallel(tensor_model_parallel_size=self.tp_size)
  File ".../lib/python3.11/site-packages/vllm/distributed/parallel_state.py", line 191, in initialize_model_parallel
    _TP_PYNCCL_COMMUNICATOR = PyNcclCommunicator(
                              ^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/vllm/distributed/device_communicators/pynccl.py", line 84, in __init__
    device = torch.device(f"cuda:{device}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Invalid device string: 'cuda:-1'

If only partial GPUs are used If --tp size is greater than that of ``CUDA_VISIBLE_DEVICES`, it no longer throws errors but hangs at loading forever.

Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
server started on [0.0.0.0]:10005
server started on [0.0.0.0]:10007
server started on [0.0.0.0]:10004
server started on [0.0.0.0]:10006
server started on [0.0.0.0]:10008
server started on [0.0.0.0]:10009
server started on [0.0.0.0]:10010
server started on [0.0.0.0]:10011
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
accepted ('127.0.0.1', 44580) with fd 48
welcome ('127.0.0.1', 44580)
accepted ('127.0.0.1', 42604) with fd 32
welcome ('127.0.0.1', 42604)
accepted ('127.0.0.1', 63054) with fd 25
welcome ('127.0.0.1', 63054)
accepted ('127.0.0.1', 51772) with fd 24
welcome ('127.0.0.1', 51772)
accepted ('127.0.0.1', 48132) with fd 24
welcome ('127.0.0.1', 48132)
accepted ('127.0.0.1', 36222) with fd 24
welcome ('127.0.0.1', 36222)
accepted ('127.0.0.1', 61092) with fd 29
welcome ('127.0.0.1', 61092)
accepted ('127.0.0.1', 46462) with fd 29
welcome ('127.0.0.1', 46462)

Update: I've notice no major performance difference whether --enable-flashinfer flag is used or not. Maybe a more solid benchmarking is needed here :)

@Qubitium

Qubitium commented Jun 3, 2024 •

Copy link
Copy Markdown
Contributor Author

We do not always need to be compatible with the vllm main, but we will try to be compatible with the latest vllm release. Could you check the compatibility with vllm v0.4.3 https://github.com/vllm-project/vllm/releases/tag/v0.4.3 ?

@merrymercy Just tested vllm 0.4.3 and and sglang (main) and without PR, exception will be throw due to new model code expecting a cache_config property. Sglang release/pip version however has no such issue. Updated the PR title to better reflect the new state.

@Qubitium Qubitium changed the title vllm master compat: add cache_config init property FIX sglang main compat with vllm 0.4.3: add missing cache_config init property Jun 3, 2024
@Qubitium

Qubitium commented Jun 3, 2024

Copy link
Copy Markdown
Contributor Author

@m0g1cian Can you check running your code on vllm 0.4.3 and this PR? This PR does not fix your nccl issue but the fix may already be part of sglang main. I would never recommend running sglang release with latest vllm due to the inter-dependency and cadence at which vllm updates their code.

@ZX-ModelCloud

Copy link
Copy Markdown
Contributor

We do not always need to be compatible with the vllm main, but we will try to be compatible with the latest vllm release. Could you check the compatibility with vllm v0.4.3 https://github.com/vllm-project/vllm/releases/tag/v0.4.3 ?

I tried to run [email protected] with [email protected] today. SRT on single GPU is working fine.

SRT throws an error when using all GPUS (CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7) tensor parallelization (--tp) is enabled:

Initialization failed. router_init_state: Traceback (most recent call last):
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/manager.py", line 71, in start_router_process
    model_client = ModelRpcClient(server_args, port_args, model_overide_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 724, in __init__
    self.step = async_wrap("step")
                ^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 715, in async_wrap
    fs = [rpyc.async_(getattr(m, func_name)) for m in self.model_servers]
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 715, in <listcomp>
    fs = [rpyc.async_(getattr(m, func_name)) for m in self.model_servers]
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 707, in init_model
    return self.remote_services[i].ModelRpcServer(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/netref.py", line 239, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/netref.py", line 63, in syncreq
    return conn.sync_request(handler, proxy, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 744, in sync_request
    return _async_res.value
           ^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/async_.py", line 111, in value
    raise self._obj
_get_exception_class.<locals>.Derived: Invalid device string: 'cuda:-1'

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 369, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 863, in _handle_call
    return obj(*args, **dict(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 76, in __init__
    self.model_runner = ModelRunner(
                        ^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_runner.py", line 280, in __init__
    initialize_model_parallel(tensor_model_parallel_size=self.tp_size)
  File ".../lib/python3.11/site-packages/vllm/distributed/parallel_state.py", line 191, in initialize_model_parallel
    _TP_PYNCCL_COMMUNICATOR = PyNcclCommunicator(
                              ^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/vllm/distributed/device_communicators/pynccl.py", line 84, in __init__
    device = torch.device(f"cuda:{device}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Invalid device string: 'cuda:-1'

If only partial GPUs are used If --tp size is greater than that of ``CUDA_VISIBLE_DEVICES`, it no longer throws errors but hangs at loading forever.

Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
server started on [0.0.0.0]:10005
server started on [0.0.0.0]:10007
server started on [0.0.0.0]:10004
server started on [0.0.0.0]:10006
server started on [0.0.0.0]:10008
server started on [0.0.0.0]:10009
server started on [0.0.0.0]:10010
server started on [0.0.0.0]:10011
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
accepted ('127.0.0.1', 44580) with fd 48
welcome ('127.0.0.1', 44580)
accepted ('127.0.0.1', 42604) with fd 32
welcome ('127.0.0.1', 42604)
accepted ('127.0.0.1', 63054) with fd 25
welcome ('127.0.0.1', 63054)
accepted ('127.0.0.1', 51772) with fd 24
welcome ('127.0.0.1', 51772)
accepted ('127.0.0.1', 48132) with fd 24
welcome ('127.0.0.1', 48132)
accepted ('127.0.0.1', 36222) with fd 24
welcome ('127.0.0.1', 36222)
accepted ('127.0.0.1', 61092) with fd 29
welcome ('127.0.0.1', 61092)
accepted ('127.0.0.1', 46462) with fd 29
welcome ('127.0.0.1', 46462)

Update: I've notice no major performance difference whether --enable-flashinfer flag is used or not. Maybe a more solid benchmarking is needed here :)

This PR should fix this issue.
#496

@m0g1cian

m0g1cian commented Jun 3, 2024

Copy link
Copy Markdown

We do not always need to be compatible with the vllm main, but we will try to be compatible with the latest vllm release. Could you check the compatibility with vllm v0.4.3 https://github.com/vllm-project/vllm/releases/tag/v0.4.3 ?

I tried to run [email protected] with [email protected] today. SRT on single GPU is working fine.
SRT throws an error when using all GPUS (CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7) tensor parallelization (--tp) is enabled:

Initialization failed. router_init_state: Traceback (most recent call last):
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/manager.py", line 71, in start_router_process
    model_client = ModelRpcClient(server_args, port_args, model_overide_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 724, in __init__
    self.step = async_wrap("step")
                ^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 715, in async_wrap
    fs = [rpyc.async_(getattr(m, func_name)) for m in self.model_servers]
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 715, in <listcomp>
    fs = [rpyc.async_(getattr(m, func_name)) for m in self.model_servers]
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 707, in init_model
    return self.remote_services[i].ModelRpcServer(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/netref.py", line 239, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/netref.py", line 63, in syncreq
    return conn.sync_request(handler, proxy, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 744, in sync_request
    return _async_res.value
           ^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/async_.py", line 111, in value
    raise self._obj
_get_exception_class.<locals>.Derived: Invalid device string: 'cuda:-1'

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 369, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/rpyc/core/protocol.py", line 863, in _handle_call
    return obj(*args, **dict(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_rpc.py", line 76, in __init__
    self.model_runner = ModelRunner(
                        ^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/sglang/srt/managers/router/model_runner.py", line 280, in __init__
    initialize_model_parallel(tensor_model_parallel_size=self.tp_size)
  File ".../lib/python3.11/site-packages/vllm/distributed/parallel_state.py", line 191, in initialize_model_parallel
    _TP_PYNCCL_COMMUNICATOR = PyNcclCommunicator(
                              ^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/vllm/distributed/device_communicators/pynccl.py", line 84, in __init__
    device = torch.device(f"cuda:{device}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Invalid device string: 'cuda:-1'

If only partial GPUs are used If --tp size is greater than that of ``CUDA_VISIBLE_DEVICES`, it no longer throws errors but hangs at loading forever.

Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
server started on [0.0.0.0]:10005
server started on [0.0.0.0]:10007
server started on [0.0.0.0]:10004
server started on [0.0.0.0]:10006
server started on [0.0.0.0]:10008
server started on [0.0.0.0]:10009
server started on [0.0.0.0]:10010
server started on [0.0.0.0]:10011
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
accepted ('127.0.0.1', 44580) with fd 48
welcome ('127.0.0.1', 44580)
accepted ('127.0.0.1', 42604) with fd 32
welcome ('127.0.0.1', 42604)
accepted ('127.0.0.1', 63054) with fd 25
welcome ('127.0.0.1', 63054)
accepted ('127.0.0.1', 51772) with fd 24
welcome ('127.0.0.1', 51772)
accepted ('127.0.0.1', 48132) with fd 24
welcome ('127.0.0.1', 48132)
accepted ('127.0.0.1', 36222) with fd 24
welcome ('127.0.0.1', 36222)
accepted ('127.0.0.1', 61092) with fd 29
welcome ('127.0.0.1', 61092)
accepted ('127.0.0.1', 46462) with fd 29
welcome ('127.0.0.1', 46462)

Update: I've notice no major performance difference whether --enable-flashinfer flag is used or not. Maybe a more solid benchmarking is needed here :)

This PR should fix this issue. #496

Just tested your patch and it did fix the issue. Thanks

@Qubitium Qubitium mentioned this pull request Jun 5, 2024
4 tasks done
@Qubitium Qubitium changed the title FIX sglang main compat with vllm 0.4.3: add missing cache_config init property Fix sglang compat with vllm 0.4.3 Jun 5, 2024
@Qubitium

Qubitium commented Jun 5, 2024

Copy link
Copy Markdown
Contributor Author

@merrymercy Please re-review. When the PR was made, 0.4.3 was not released but since official 0.4.3 release, this PR code is still relevant to make sure sglang can load models using vllm loader.

We do not always need to be compatible with the vllm main, but we will try to be compatible with the latest vllm release. Could you check the compatibility with vllm v0.4.3 https://github.com/vllm-project/vllm/releases/tag/v0.4.3 ?

@merrymercy Just tested vllm 0.4.3 and and sglang (main) and without PR, exception will be throw due to new model code expecting a cache_config property. Sglang release/pip version however has no such issue. Updated the PR title to better reflect the new state.

@merrymercy merrymercy mentioned this pull request Jun 7, 2024
@merrymercy

merrymercy commented Jun 7, 2024 •

Copy link
Copy Markdown
Collaborator

@Qubitium @ZhouXingg Thanks for the contributions. They are merged in #511.

@merrymercy merrymercy closed this Jun 7, 2024
@m0g1cian

m0g1cian commented Jun 12, 2024 •

Copy link
Copy Markdown

Well. vLLM just released 0.5.0 today 🤣

The good news is that our latest sglang 0.1.17 seems to be compat with it without any modification!
The bad news is that vLLM 0.5.0 doesn't seem to compat with the latest outlines and RegexFSM is seemingly broken. Per my initial testing, sglang 0.1.17 + vLLM 0.5.0 is outputing completely messed up sentences.

@Qubitium
Qubitium deleted the vllm_compat_cache_config branch June 12, 2024 07:33
EdwardXuy pushed a commit to shun8686/sglang that referenced this pull request May 9, 2026
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…rch guard stricter than upstream _varlen_arch_ok; rebase-gate list persisted; sgl-project#33348 root not shared by our replicated draft-KV path (loose end -> sgl-project#487); EAGLE 2x reserve carried unmodified -> sgl-project#486
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
… pool -- established unreachable, not fixed

sgl-project#487 audits whether the stock even-DCP allocator branch
(model_runner_kv_cache_mixin.py, the else of the allocator chain -- which
inflates both index space and page granularity by dcp_size, assuming a
token-sharded pool) can ever run against a draft worker at
--draft-kv-layout replicated (the default), whose pool sizing has the
opposite geometry (draft_pool_is_replicated) and which the allocator
selection never mentions. sgl-project#108 never audited this crossing.

Answer established WITHOUT a boot, by enumerating every producer of
is_draft_worker=True rather than assuming there is one shape: UNREACHABLE
on CUDA. Given dcp_size > 1 the stock branch is taken exactly when
rank_tp_ratio is None and not weightless_kv_active(); (1) a speculative
draft worker cannot exist in that shape because
ServerArgs._handle_dcp_validation refuses dcp_size>1 + speculation on CUDA
unless the boot is uneven-weighted DCP or the weightless fast lane; (2) a
sgl-project#274 dual-group-lane runner also sets is_draft_worker=True and is NOT
speculative, so leg 1 misses it -- closed instead by
_lane_server_args_view forcing view.dcp_size = 1. Leg 2 exists only
because "a draft pool implies a speculative algorithm" turned out false
once the producer set was enumerated, not assumed -- the new falsifier
pins that set so a third producer lands as a red test instead of a wrong
address. Residual, named rather than fixed: on HIP/ROCm leg 1 does not run
(is_hip() short-circuits before the CUDA branch), so the crossing IS
admitted there -- left alone, since this fork does not serve ROCm and a
desk-guessed change to address computation is exactly the sgl-project#345
right-token/wrong-slot class waiting to happen.

Also folds in docs(sgl-project#482): the ARM3_COMPUTE work-matched counter rule and
its script updates (scripts/dev/394_s2_proof/).

FEATURE_CATALOG.md §12 conflict as expected (this branch and the
already-merged sgl-project#510/sgl-project#513/sgl-project#511 all insert a new family paragraph at the
same point, right after the §12 header): kept all six additive paragraphs
in sequence (Unauthenticated-state-change sgl-project#510, Incomplete-cache-key sgl-project#513,
Unreachable-registration sgl-project#81/sgl-project#518, Byte-stride width sgl-project#109/sgl-project#112/sgl-project#512,
Tolerance-that-cannot-fail sgl-project#380/sgl-project#511, Reach-before-fix sgl-project#487). All 17
sections and every other previously-preserved additive paragraph
(two-axis §1, matrix doctrine §2, sgl-project#514's five families, sgl-project#499's
resolution-ordering, MERGE-DUTY owner-sites + SITREP §12, NVENC §13)
verified present.

Tests (CUDA_VISIBLE_DEVICES=99, PYTHONPATH pinned to this worktree):
- test_stock_dcp_allocator_reach_487.py alone: 20 passed.
- test/registered/unit/distributed/ (full, since
  model_runner_kv_cache_mixin.py is touched): 24 failed, 2167 passed,
  8 skipped, 723 subtests -- same 24 failing test IDs as the established
  baseline, byte-identical; the +20/+2 deltas are exactly this merge's own
  new test file.
- ruff check --select=F401,F821,UP037: clean.
- codespell: clean on all 8 touched/added files.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…en3.8 day-0 ratchets

docs(sgl-project#519): wheel-pin/expectation corrections in DESIGN_456_sparse_image_write.md,
TICKET_398_mxfp4_validation.md, and rig-runbook.md.

test(sgl-project#497): forward-compatibility-by-model_type, day-0 prep for a Qwen3.8
checkpoint that does not exist yet. The claim: the load path must key on
model_type and on config FIELDS, never on a version string in the model
name or a geometry constant -- then a new checkpoint reusing an existing
model_type loads with no code change at all. Audited and CONFIRMED for
both live paths: gguf_registry.create_gguf_adapter reads exactly
model_type (no name_or_path in the registry); ServerArgs.declared_layer_kinds
probes layer_types -> full_attention_interval -> all-attention from either
the top level or text_config, so a different depth/interval needs nothing.
Both now ratcheted with a literal sweep that ignores docstrings (parses
and looks only at string literals the module evaluates, since the family
is documented in prose everywhere -- a naive grep ratchet would be pure
noise).

Two findings recorded and deliberately NOT fixed: (1) an unregistered
architecture does not refuse, it silently falls back to
TransformersForCausalLM (models/registry.py:61-78), so a boot can succeed
on the generic backend with none of this fork's features -- assert the
resolved class at day 0 rather than trusting a green boot; (2) the M-RoPE
declaration gap vLLM PR sgl-project#50068 closes upstream exists here too --
model_is_mrope is decided from config alone (true for text-only
Qwen3.5/3.6) while qwen3_5.py sets is_mrope_enabled only on the
ForConditionalGeneration classes, so prefill_cuda_graph_runner.py computes
mrope positions and discards them. Closing it changes which positions a
captured graph replays and needs a boot; characterised by tests that flip
together when the fix lands, not fixed here.
docs/dev/ANALYSE_495_qwen38_forward_compat.md has the full analysis.

FEATURE_CATALOG.md §12 conflict as expected (this branch and all of
sgl-project#510/sgl-project#513/sgl-project#511/sgl-project#487, already merged, insert a new paragraph at the same
point after the §12 header): kept all seven additive paragraphs in
sequence, this branch's "Forward-compatibility-by-model_type" appended
last. All 17 sections and every other additive paragraph verified present.

Docs + one new ratchet test only -- no production python/sglang/srt source
touched (git diff --stat confirms empty for python/**/*.py), so no
regression surface beyond the new test file itself.

Tests (CUDA_VISIBLE_DEVICES=99, PYTHONPATH pinned to this worktree):
- test_qwen38_forward_compat_497.py alone: 21 passed.
- ruff check --select=F401,F821,UP037: clean.
- codespell: clean on all 6 touched/added files.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
… medians, honest server state

Three new server-side computed blocks the Monitor tab's landing poll now
returns (all server-side so a curl client sees exactly what the page
draws, per the runbook's "curl is a complete client" architecture rule):

- server_state.py: a four-state discriminator (not_running | starting |
  running_no_metrics | running_with_metrics) that keys off an explicit API
  probe, never a metrics-scrape failure alone -- a connection-refused
  scrape used to be rendered as "no --enable-metrics", which is a
  different diagnosis than "not running at all". running_no_metrics is
  only ever reported with a passing API probe.
- rate_medians.py: medians behind the rate tiles, windowed over
  PROCESSING polls only -- idle polls never enter the window, so an idle
  server still reports the median of what it did while working, not a
  zero-diluted average.
- spill_tiers.py / tier_occupancy.py: one row per spill/offload tier type
  x place, with absent tiers PRINTED alongside their reason rather than
  hidden or shown as zero. Two tiers are deliberately never populated:
  the sgl-project#407 memtier registry (no production consumer, so reading it would
  print zeros that look measured) and the sgl-project#286 short-term register (no
  reachable byte ledger in this build) -- both documented as absent-by-
  construction, not omissions.

webui.py and live_metrics.py wire these into the existing landing poll;
metrics_reporter.py and metrics_collector.py get the small hooks the new
blocks read from.

Clean auto-merge on both touched docs (FEATURE_CATALOG.md and
rig-runbook.md) -- neither had a conflicting edit on this line since this
branch's base (3e3aca2, the sgl-project#510 merge). rig-runbook.md gains new
§8.0 documenting the shell-only verification recipe (curl + three python3
one-liners for state/medians/tiers) and the restart requirement: the
dashboard serves from one long-lived process, so a change is live only
after that process restarts -- done as the merge step below, not
mid-session. All 17 catalog sections and all 21 previously-preserved
additive paragraphs verified present (two-axis §1, matrix doctrine §2,
all six §12 families from sgl-project#510/sgl-project#513/sgl-project#511/sgl-project#487/qwen38-prep, sgl-project#514's five
families + value-pinning, sgl-project#499's resolution-ordering, sgl-project#517's two sgl-project#459
paragraphs, MERGE-DUTY owner-sites + SITREP §12, NVENC §13).

Tests (CUDA_VISIBLE_DEVICES=99, PYTHONPATH pinned to this worktree):
- The six directly touched/new test files: 517 passed, 0 failed.
- test/registered/unit/planner/ (full, HTSGLANG_TEST_MODEL_DIR set):
  2337 passed, 1 skipped, 352 subtests -- no failures.
- ruff check --select=F401,F821,UP037: 1 finding
  (live_metrics.py's LiveSnapshot import), confirmed pre-existing --
  already unused in the pre-merge base, only mentioned in a docstring,
  the line just shifted from sgl-project#522's unrelated insertions above it.
- codespell: 1 hit (webui.py:1786 "unparseable"), confirmed pre-existing
  at the identical line in the pre-merge base, in unrelated SVG
  chess-piece-parsing code this branch never touches.
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.

4 participants