Skip to content

Conversation

@WrRan
Copy link
Contributor

@WrRan WrRan commented Mar 20, 2025

as title said.

@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the v1 label Mar 20, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ctx must be set, or line-235 will fail because ctx is None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked the codebase. The BackgroundResources is only used by

self.resources = BackgroundResources(ctx=sync_ctx)

So it is ok to remove the defaults.

Copy link
Member

@njhill njhill 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 fixes @WrRan

Comment on lines 33 to 34
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this comment is necessary. Our pre-commit checks will catch 3.9 incompatibilities.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did we land code non-compatible with python 3.9 first, then turned on pre-commit checks? Just curious.

Copy link
Member

Choose a reason for hiding this comment

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

@houseroad I don't think so - the code here is compatible with 3.9. The comment was a hypothetical explanation about why we can't add TypeAlias here yet.

@njhill
Copy link
Member

njhill commented Mar 20, 2025

@WrRan you need to sign-off your commits, see https://github.com/vllm-project/vllm/pull/15208/checks?check_run_id=39103177991. And while you're updating perhaps remove that comment per my suggestion?

Copy link
Collaborator

@houseroad houseroad left a comment

Choose a reason for hiding this comment

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

Looks good.

@WrRan
Copy link
Contributor Author

WrRan commented Mar 21, 2025

@WrRan you need to sign-off your commits, see https://github.com/vllm-project/vllm/pull/15208/checks?check_run_id=39103177991. And while you're updating perhaps remove that comment per my suggestion?

Got and ready.

@njhill
Copy link
Member

njhill commented Mar 21, 2025

Thanks @WrRan. Could you force-push your commits again and include a signoff for the DCO (as described here)? It's fine to squash them into one.

@WrRan WrRan force-pushed the patch-7 branch 2 times, most recently from 1fdf30d to 28b5c34 Compare March 21, 2025 07:50
@WrRan
Copy link
Contributor Author

WrRan commented Mar 21, 2025

Got. And now commit history is clear. Happy. 😄 @njhill

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@njhill Have a look. Any includes None, so Optional is unnecessary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have a stricter bound for this? fwiw Any is equivalent as not adding type, as it doesn't give any contextual usage of the parameter (but for the sake of passing mypy)

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to keep the Optional here since None has a different meaning to any other value

Copy link
Collaborator

Choose a reason for hiding this comment

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

because this is a dataclass, you can gated the default value under dataclasses.field

ctx: zmq.Context = dataclasses.field(default=None)

Same for L216 and L217

Copy link
Collaborator

Choose a reason for hiding this comment

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

or you can apply the change to L216 and L217 instead of ctx, given that it seems ctx must not be None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because this is a dataclass, you can gated the default value under dataclasses.field

ctx: zmq.Context = dataclasses.field(default=None)

Same for L216 and L217

image Not good. mypy complains.

Copy link
Collaborator

Choose a reason for hiding this comment

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

touche.

Copy link
Collaborator

@aarnphm aarnphm left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

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

@WrRan could you revert that other optional change per my new comment.

Otherwise the changes look good to me, you just need to fix the DCO thing before we can merge it. Thanks again

image

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to keep the Optional here since None has a different meaning to any other value

@njhill njhill changed the title Fix Imprecise Type Annotations [BugFix][Typing] Fix Imprecise Type Annotations Mar 21, 2025
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
@WrRan
Copy link
Contributor Author

WrRan commented Mar 21, 2025

@njhill Got, and reverted. And I have known what is sign-off. 😅

Another question:

class UtilityOutput(
msgspec.Struct,
array_like=True, # type: ignore[call-arg]
gc=False): # type: ignore[call-arg]
call_id: int
# Non-None implies the call failed, result should be None.
failure_message: Optional[str] = None
result: Any = None

The UtilityOutput can be omit_defaults=True as EngineCoreOutputs to reduce serialization costs. Right? Or anything miss?

Additionally, I have been carefully reading (or more accurately, learning) vllm v1. The current architecture is elegant. THANKS FOR YOUR WORKS AND OPEN-SOURCE SPIRIT. ❤️ ❤️ ❤️

@WrRan
Copy link
Contributor Author

WrRan commented Mar 21, 2025

@aarnphm Got, and I will name PR accordingly.

@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 22, 2025
@vllm-bot vllm-bot merged commit dd861b9 into vllm-project:main Mar 22, 2025
35 of 39 checks passed
erictang000 pushed a commit to erictang000/vllm that referenced this pull request Mar 25, 2025
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
lk-chen pushed a commit to lk-chen/vllm that referenced this pull request Apr 29, 2025
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants