Skip to content

[AscendScheduler][Bugfix] Remove num_draft_tokens while allocating slots #1718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025
Merged
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
2 changes: 1 addition & 1 deletion docs/source/tutorials/multi_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ hccn_tool -i 0 -ping -g address 10.20.0.20
```

## Run with docker
Assume you have two Altas 800 A2(64G*8) nodes, and want to deploy the `deepseek-v3-w8a8` quantitative model across multi-node.
Assume you have two Atlas 800 A2(64G*8) nodes, and want to deploy the `deepseek-v3-w8a8` quantitative model across multi-node.

```shell
# Define the image and container name
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/singlecard/test_aclgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
from tests.conftest import VllmRunner
from tests.model_utils import check_outputs_equal

MODELS = ["Qwen/Qwen2.5-0.5B-Instruct", "vllm-ascend/Qwen3-30B-A3B-Puring"]
MODELS = [
"Qwen/Qwen2.5-0.5B-Instruct",
# TODO: REVERT ME when oom is fixed
# "vllm-ascend/Qwen3-30B-A3B-Puring"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just tested locally, the test passed. I guess it's the resource release problem on CI system.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe, will raise another pr to fix it

]


@pytest.mark.skipif(os.getenv("VLLM_USE_V1") == "0",
Expand Down
26 changes: 17 additions & 9 deletions vllm_ascend/core/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
from vllm.v1.request import Request, RequestStatus
from vllm.v1.structured_output import StructuredOutputManager

from vllm_ascend.utils import vllm_version_is


class AscendScheduler(Scheduler):
"""This Scheduler extends vllm's original v1 scheduler
Expand Down Expand Up @@ -281,17 +283,23 @@ def skip_cur_request():
# allow the lower-priority requests to be scheduled.
req_index += 1
continue

num_draft_tokens = max(
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use vllm_version_is to keep it both work on 0.9.2 and main

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

num_new_tokens + request.num_computed_tokens -
request.num_tokens, 0)
if vllm_version_is("0.9.2"):
num_draft_tokens = max(
num_new_tokens + request.num_computed_tokens -
request.num_tokens, 0)

while True:
new_blocks = self.kv_cache_manager.allocate_slots(
request,
num_new_tokens,
num_draft_tokens=num_draft_tokens,
num_lookahead_tokens=self.num_lookahead_tokens)
if vllm_version_is("0.9.2"):
new_blocks = self.kv_cache_manager.allocate_slots(
request,
num_new_tokens,
num_draft_tokens=num_draft_tokens,
num_lookahead_tokens=self.num_lookahead_tokens)
else:
new_blocks = self.kv_cache_manager.allocate_slots(
request,
num_new_tokens,
num_lookahead_tokens=self.num_lookahead_tokens)
if new_blocks is None:
# The request cannot be scheduled.
# Preempt the lowest-priority request.
Expand Down
Loading