Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/long_term/spec_decode_v1/test_v1_mtp_correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ def test_mtp_correctness(
},
max_model_len=256,
gpu_memory_utilization=0.8,
enforce_eager=True)
enforce_eager=True,
additional_config={
"ascend_scheduler_config": {
"enabled": True
},
})
spec_outputs = spec_llm.chat(test_prompts, sampling_config)
matches = 0
misses = 0
Expand Down
1 change: 1 addition & 0 deletions tests/singlecard/core/test_ascend_scheduler_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def model() -> LLM:
MODEL,
enforce_eager=True,
enable_prefix_caching=True,
max_model_len=200,
max_num_batched_tokens=200,
max_num_seqs=3,
additional_config={"ascend_scheduler_config": {
Expand Down
7 changes: 7 additions & 0 deletions vllm_ascend/ascend_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ def check_ascend_config(vllm_config, enforce_eager):
"Ascend scheduler is only supported for V1 Engine.")
# for v1 engine
else:
# TODO(yexiong): remove this verification after mtp model supports original vllm scheduler
if (not ascend_config.ascend_scheduler_config.enabled
and vllm_config.speculative_config
and vllm_config.speculative_config.method == 'deepseek_mtp'):
raise NotImplementedError(
"Currently deepseek MTP model is only supported for ascend scheduler."
)
# for eager mode
if enforce_eager:
# torchair_graph cannot be enabled with eager mode.
Expand Down
10 changes: 10 additions & 0 deletions vllm_ascend/core/schedule_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ def __post_init__(self) -> None:
self.max_num_encoder_input_tokens = self.max_num_batched_tokens
self.encoder_cache_size = self.max_num_batched_tokens
self.chunked_prefill_enabled = self.enable_chunked_prefill
if (self.max_num_batched_tokens < self.max_model_len
and not self.chunked_prefill_enabled):
raise ValueError(
"Ascend scheduler is enabled without chunked prefill feature. "
f"Argument max_num_batched_tokens ({self.max_num_batched_tokens}) is "
f"smaller than max_model_len ({self.max_model_len}). "
"This effectively limits the maximum sequence length to "
"max_num_batched_tokens and makes vLLM reject longer "
"sequences. Please increase max_num_batched_tokens or "
"decrease max_model_len.")
if self.policy != "fcfs":
raise NotImplementedError(
f"currently AscendScheduler only supports fcfs policy, got {self.policy}"
Expand Down
8 changes: 7 additions & 1 deletion vllm_ascend/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from vllm.logger import logger
from vllm.platforms import Platform, PlatformEnum

import vllm_ascend.envs as envs_ascend
from vllm_ascend.ascend_config import check_ascend_config, init_ascend_config
from vllm_ascend.utils import (ASCEND_QUATIZATION_METHOD,
check_torchair_cache_exist,
Expand Down Expand Up @@ -147,14 +148,19 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:

check_ascend_config(vllm_config, enforce_eager)

if vllm_config.speculative_config and envs_ascend.VLLM_ASCEND_ENABLE_DBO:
raise ValueError(
"DBO and mtp can't work at the same time. Please `export VLLM_ASCEND_ENABLE_DBO=0`"
)

if enforce_eager or compilation_config.level == CompilationLevel.NO_COMPILATION:
logger.info("Compilation disabled, using eager mode by default")
compilation_config.level = CompilationLevel.NO_COMPILATION
elif compilation_config.level != CompilationLevel.PIECEWISE:
logger.warning(
"NPU does not support %s compilation level. Setting level to NO_COMPILATION",
compilation_config.level)
compilation_config.level = CompilationLevel.NO_COMPILATION
compilation_config.level = CompilationLevel.NfvO_COMPILATION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There appears to be a typo in the compilation level. NfvO_COMPILATION should be NO_COMPILATION. This will likely cause an AttributeError at runtime.

Suggested change
compilation_config.level = CompilationLevel.NfvO_COMPILATION
compilation_config.level = CompilationLevel.NO_COMPILATION

elif ascend_config.torchair_graph_config.enabled:
logger.info(
"Torchair compilation enabled on NPU. Setting level to NO_COMPILATION"
Expand Down
3 changes: 0 additions & 3 deletions vllm_ascend/worker/model_runner_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ def __init__(self, vllm_config: VllmConfig, device: torch.device):
self.spec_token_num = 0
self.decode_token_per_req = 1
if self.speculative_config:
if envs_ascend.VLLM_ASCEND_ENABLE_DBO:
raise NotImplementedError(
"DBO and mtp can't work at the same currently")
self.use_spec_decode = True
self.spec_token_num = self.speculative_config.num_speculative_tokens
assert self.spec_token_num > 0
Expand Down