-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
[Core] Add update_config
RPC method
#20095
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
Changes from 3 commits
9b56a6f
4709e7a
e17a929
7129f12
ee6b2bb
9a8d179
17284b8
a7362af
df819bf
fd6353e
7729cc8
32ad258
494b017
f924529
d0e00c5
3d1ef20
ef7fc53
7776bc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
import bisect | ||
import dataclasses | ||
import gc | ||
import time | ||
from typing import TYPE_CHECKING, Optional, cast | ||
from typing import TYPE_CHECKING, Any, Optional, cast | ||
from unittest.mock import patch | ||
|
||
import numpy as np | ||
|
@@ -968,6 +969,15 @@ def execute_model( | |
|
||
return model_runner_output | ||
|
||
def update_config(self, overrides: dict[str, Any]) -> None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the update_config logic is different from gpu one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated, missed it after a few updates. @Chenyaaang @yaochengji perhaps worth refactoring to inherit from a base class as TPU code shares a lot common logic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think maybe different hardware has its own specific logic of checking the configuration. E.g. https://github.com/vllm-project/vllm/blob/main/vllm/platforms/tpu.py#L99 We can add a TODO here |
||
for config_name, config_overrides in overrides.items(): | ||
try: | ||
config = getattr(self, config_name) | ||
except AttributeError as exc: | ||
raise ValueError(f"Unknown config {config_name}") from exc | ||
new_config = dataclasses.replace(config, **config_overrides) | ||
setattr(self, config_name, new_config) | ||
22quinn marked this conversation as resolved.
Show resolved
Hide resolved
aarnphm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
def load_model(self) -> None: | ||
self.device = self.device_config.device | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function feels a bit scary to to be really honest. due to:
1/ not every config would be updatable even if they exist -- for example updating
parallel_config
probably wouldn't work :(2/ do we guarantee that the model runner always read values from
self.xxxx_config
notvllm_config.xxxx_config
?3/ how do we ensure the new config is a valid config for its type?
potentially we can limit updates to limited known good configs first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
load_config
andmodel_config
for now, to fulfill our purpose of model/weights updatedataclasses.replace