Skip to content

Conversation

@KKSK-DON
Copy link
Contributor

@KKSK-DON KKSK-DON commented Sep 3, 2025

This pr is point 1 and point 3 of #23869

Purpose

This pr move Processor to API server. So the next step #23873 can be benefit from it

Test Plan

unit test
I think it already be covered

manual test

python -m vllm.entrypoints.openai.api_server \
  --model meta-llama/Llama-3.2-3B-Instruct \
  --host 0.0.0.0 --port 8000

curl -s -X POST http://127.0.0.1:8000/v1/chat/completions \
  -H "Authorization: Bearer dummy" \
  -H "Content-Type: application/json" \
  -d '{
    "model":"meta-llama/Llama-3.2-3B-Instruct",
    "messages":[{"role":"user","content":"Give me two short facts about GPU memory."}],
    "max_tokens":64
  }'

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@KKSK-DON KKSK-DON changed the title 1. add Processor to API server 2. add deprecate warning into AsyncLLM [Refactor] Move Processor out of AsyncLLM Sep 3, 2025
@KKSK-DON KKSK-DON marked this pull request as ready for review September 3, 2025 23:39
@KKSK-DON KKSK-DON changed the title [Refactor] Move Processor out of AsyncLLM [Renderer] Move Processor out of AsyncLLM Sep 4, 2025
Copy link
Member

@ywang96 ywang96 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! By moving Processor out of AsyncLLM, I meant that this following call should by default happening at the API server layer or under LLM class

# Convert Input --> Request.
prompt_str, request = self.processor.process_inputs(
request_id, prompt, params, arrival_time, lora_request,
tokenization_kwargs, trace_headers, priority, data_parallel_rank)

This means we will need to change the input type of add_request to support both EngineCoreRequest and PromptType, the change should look something like the following for AsyncLLM.add_request

async def add_request(
    self,
    request_id: str,
    request: Union[EngineCoreRequest, PromptType], # passed from upper layer
    prompt_str: Optional[str],  # passed from upper layer
    params: Union[SamplingParams, PoolingParams],
    arrival_time: Optional[float] = None,
    lora_request: Optional[LoRARequest] = None,
    tokenization_kwargs: Optional[dict[str, Any]] = None,
    trace_headers: Optional[Mapping[str, str]] = None,
    priority: int = 0,
    data_parallel_rank: Optional[int] = None,
) -> RequestOutputCollector:
    ...
    if isinstance(request, PromptType):
        assert prompt_str is None
        logger.warning_once(...) # deprecation warning
        prompt_str, request = self.processor.process_inputs(...)
    ...

Let me know if you have any questions!

@KKSK-DON KKSK-DON force-pushed the refactor/move-processor branch from 65bd313 to 491cf3a Compare September 4, 2025 23:43
@KKSK-DON KKSK-DON changed the title [Renderer] Move Processor out of AsyncLLM WIP [Renderer] Move Processor out of AsyncLLM Sep 5, 2025
@mergify
Copy link

mergify bot commented Sep 6, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @KKSK-DON.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Sep 6, 2025
@KKSK-DON KKSK-DON force-pushed the refactor/move-processor branch from 14a402c to 94394af Compare September 6, 2025 00:39
@mergify mergify bot removed the needs-rebase label Sep 6, 2025
@mergify
Copy link

mergify bot commented Sep 6, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @KKSK-DON.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@KKSK-DON KKSK-DON force-pushed the refactor/move-processor branch from 72358ec to f786d14 Compare September 8, 2025 17:36
@KKSK-DON KKSK-DON changed the title WIP [Renderer] Move Processor out of AsyncLLM [Renderer] Move Processor out of AsyncLLM Sep 8, 2025
@KKSK-DON KKSK-DON changed the title [Renderer] Move Processor out of AsyncLLM WIP[Renderer] Move Processor out of AsyncLLM Sep 8, 2025
@KKSK-DON KKSK-DON requested a review from ywang96 September 9, 2025 03:15
…r processor management

Signed-off-by: Yang <lymailforjob@gmail.com>
…alization

Signed-off-by: Yang <lymailforjob@gmail.com>
auto-merge was automatically disabled October 2, 2025 16:51

Head branch was pushed to by a user without write access

@KKSK-DON KKSK-DON force-pushed the refactor/move-processor branch from 8003baf to 6a1fddb Compare October 2, 2025 16:51
Signed-off-by: Yang <lymailforjob@gmail.com>
@KKSK-DON KKSK-DON requested a review from NickLucche as a code owner October 3, 2025 02:35
Signed-off-by: Yang <lymailforjob@gmail.com>
@mergify
Copy link

mergify bot commented Oct 3, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @KKSK-DON.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Oct 3, 2025
@DarkLight1337
Copy link
Member

DarkLight1337 commented Oct 3, 2025

Let's wait for the entrypoints test results, then update the PR according to #26097 (note the updated return type of self.processor.process_inputs)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337
Copy link
Member

I have helped you update it

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) October 3, 2025 08:11
@mergify mergify bot removed the needs-rebase label Oct 3, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337 DarkLight1337 merged commit 812b7f5 into vllm-project:main Oct 3, 2025
51 checks passed
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
tomeras91 pushed a commit to tomeras91/vllm that referenced this pull request Oct 6, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Tomer Asida <57313761+tomeras91@users.noreply.github.com>
karan pushed a commit to karan/vllm that referenced this pull request Oct 6, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Karan Goel <3261985+karan@users.noreply.github.com>
southfreebird pushed a commit to southfreebird/vllm that referenced this pull request Oct 7, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
Signed-off-by: Yang <lymailforjob@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation frontend ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants