Skip to content
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

improved code readability #72

Merged
merged 3 commits into from
Jan 27, 2025
Merged

improved code readability #72

merged 3 commits into from
Jan 27, 2025

Conversation

yannicks1
Copy link
Contributor

@yannicks1 yannicks1 commented Jan 27, 2025

this PR improves code readability by

  • commit 1: removing the batch size argument in the load_model function here since unused in SpyreModelRunner (here) as well as in SpyreEmbeddingModelRunner (here).
  • -- commit 2: function renaming to better distinguish between the imported function init_distributed_environment from vllm.distributed and our own function self.init_distributed_environment. -- (reverted since this seems to be a convention introduced in other worker classes)

Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.
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 do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@@ -59,7 +59,7 @@ def __init__(
self.is_driver_worker)
self._env_initialized = False

def init_distributed_environment(self) -> None:
def init_distributed_spyre_environment(self) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

all the workers have names init_distributed_environment, imo it is better to keep it that way for consistency

Copy link
Member

Choose a reason for hiding this comment

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

ref: openvino, cpu, neuron

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 agree. I thought it was a Spyre specific thing that we introduced. If its their convention to have the same name for the two functions I guess we just stick to it too.

Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
Copy link
Member

@tdoublep tdoublep left a comment

Choose a reason for hiding this comment

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

LGTM

@tdoublep tdoublep merged commit 857b127 into tpa-executor Jan 27, 2025
4 checks passed
tdoublep pushed a commit that referenced this pull request Jan 28, 2025
this PR improves code readability by

- [commit
1](0c9bec0):
removing the batch size argument in the load_model function
[here](https://github.com/IBM/vllm/blob/124f3a961d1a9ce2628c01fe56dfcc589a49c8dd/vllm/worker/spyre_worker.py#L135)
since unused in `SpyreModelRunner`
([here](https://github.com/IBM/vllm/blob/124f3a961d1a9ce2628c01fe56dfcc589a49c8dd/vllm/worker/spyre_model_runner.py#L104))
as well as in `SpyreEmbeddingModelRunner`
([here](https://github.com/IBM/vllm/blob/124f3a961d1a9ce2628c01fe56dfcc589a49c8dd/vllm/worker/spyre_embedding_model_runner.py#L52)).
- -- _[commit
2](beadbd5):
function renaming to better distinguish between the imported function
`init_distributed_environment` from `vllm.distributed` and our own
function `self.init_distributed_environment`._ -- (**reverted since this
seems to be a convention introduced in other worker classes**)

---------

Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
@yannicks1 yannicks1 deleted the ysc-better-readability branch January 29, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants