-
-
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 4 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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
|
||
import copy | ||
import dataclasses | ||
import gc | ||
import time | ||
import weakref | ||
|
@@ -1692,6 +1693,15 @@ def generate_draft_token_ids( | |
draft_token_ids.append(drafter_output.tolist()) | ||
return draft_token_ids | ||
|
||
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. this function feels a bit scary to to be really honest. due to: potentially we can limit updates to limited known good configs first 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.
|
||
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: | ||
logger.info("Starting to load model %s...", self.model_config.model) | ||
with DeviceMemoryProfiler() as m: # noqa: SIM117 | ||
|
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 | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.