mirror of
https://github.com/wassname/vllm.git
synced 2026-08-06 13:40:27 +08:00
Co-authored-by: simon-mo <xmo@berkeley.edu> Co-authored-by: Chang Su <chang.s.su@oracle.com> Co-authored-by: Simon Mo <simon.mo@hey.com> Co-authored-by: Roger Wang <136131678+ywang96@users.noreply.github.com> Co-authored-by: Roger Wang <ywang@roblox.com>
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
'''
|
|
Worker-related helper functions.
|
|
'''
|
|
|
|
from vllm.utils import STR_NOT_IMPL_ENC_DEC_ERR_STRS
|
|
from vllm.worker.model_runner import GPUModelRunnerBase
|
|
|
|
|
|
def assert_enc_dec_mr_supported_scenario(
|
|
enc_dec_mr: GPUModelRunnerBase) -> None:
|
|
'''
|
|
Asserted that the provided encoder/decoder model runner instance reflects
|
|
a supported scenario.
|
|
'''
|
|
|
|
if enc_dec_mr.cache_config.enable_prefix_caching:
|
|
raise NotImplementedError(
|
|
STR_NOT_IMPL_ENC_DEC_ERR_STRS['STR_NOT_IMPL_ENC_DEC_PREFIX_CACHE'])
|
|
|
|
if enc_dec_mr.sliding_window is not None:
|
|
raise NotImplementedError(
|
|
STR_NOT_IMPL_ENC_DEC_ERR_STRS['STR_NOT_IMPL_ENC_DEC_SWA'])
|
|
|
|
if enc_dec_mr.scheduler_config.chunked_prefill_enabled:
|
|
raise NotImplementedError(STR_NOT_IMPL_ENC_DEC_ERR_STRS[
|
|
'STR_NOT_IMPL_ENC_DEC_CHUNKED_PREFILL'])
|
|
|
|
if getattr(enc_dec_mr.model_config.hf_config, 'attn_logit_softcapping',
|
|
None) is not None:
|
|
raise NotImplementedError(
|
|
STR_NOT_IMPL_ENC_DEC_ERR_STRS['STR_NOT_IMPL_ENC_DEC_LOGIT_SOFTCAP']
|
|
)
|
|
|
|
if enc_dec_mr.lora_config is not None:
|
|
raise NotImplementedError(
|
|
STR_NOT_IMPL_ENC_DEC_ERR_STRS['STR_NOT_IMPL_ENC_DEC_LORA'])
|
|
|
|
if enc_dec_mr.parallel_config.pipeline_parallel_size > 1:
|
|
raise NotImplementedError(
|
|
STR_NOT_IMPL_ENC_DEC_ERR_STRS['STR_NOT_IMPL_ENC_DEC_PP'])
|
|
|
|
if enc_dec_mr.scheduler_config.num_lookahead_slots > 0:
|
|
raise NotImplementedError(
|
|
STR_NOT_IMPL_ENC_DEC_ERR_STRS['STR_NOT_IMPL_ENC_DEC_SPEC_DEC'])
|
|
|
|
if enc_dec_mr.prompt_adapter_config is not None:
|
|
raise NotImplementedError(STR_NOT_IMPL_ENC_DEC_ERR_STRS[
|
|
'STR_NOT_IMPL_ENC_DEC_PROMPT_ADAPTER'])
|