-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[Bugfix] Allow CUDA_VISIBLE_DEVICES=''
in Platform.device_id_to_physical_device_id
#18979
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
22fdba1
Fix FlashMLA detection in ray environment
eicherseiji 979129b
Move FlashMLA capability check to GPU worker
eicherseiji 5055e5b
Unit test
eicherseiji 9e943ea
reate helper function _resolve_hardware_dependent_config
eicherseiji b812cd1
Add V0 support under env flag
eicherseiji 4e4e092
Parameterize _get_and_verify_dtype by defer_to_worker
eicherseiji baadec8
Change parameter name to 'defer_auto_to_worker'
eicherseiji 8df7253
Add _resolve_hardware_dependent_config for V0 Worker
eicherseiji b2fea3c
Resolve lora dtype
eicherseiji 6500644
Move V1 supported type check into auto resolution's if block
eicherseiji 8c30841
Move config resolution to WorkerBase
eicherseiji 7ff5dae
Fix kwargs list
eicherseiji ceccc0d
Inline init_config with init_worker
eicherseiji c191299
Testing without V0-specific flag
eicherseiji 190f9f7
Remove whitespace changes
eicherseiji ab58431
Avoid modifying _get_and_verify_dtype signature for the sake of testing
eicherseiji 5f87e53
Only check V1 supported dtypes in V1
eicherseiji e77592c
Move config fixup logic to VllmConfig.resolve_config_with_hardware, f…
eicherseiji 8e0f77b
Support inplace model weights loading
eicherseiji d5f88bb
Try resolving dtype on worker in ray
eicherseiji afe0e01
Treat empty device control env var as unset
eicherseiji 66bd1fb
Allow empty string CUDA_VISIBLE_DEVICES
eicherseiji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
import pytest | ||
|
||
from vllm.engine.arg_utils import EngineArgs | ||
from vllm.model_executor.layers.quantization.quark.utils import deep_compare | ||
|
||
|
||
def test_cuda_empty_vs_unset_configs(monkeypatch: pytest.MonkeyPatch): | ||
"""Test that configs created with normal (untouched) CUDA_VISIBLE_DEVICES | ||
and CUDA_VISIBLE_DEVICES="" are equivalent. This ensures consistent | ||
behavior regardless of whether GPU visibility is disabled via empty string | ||
or left in its normal state. | ||
""" | ||
|
||
def create_config(): | ||
engine_args = EngineArgs(model="deepseek-ai/DeepSeek-V2-Lite", | ||
trust_remote_code=True) | ||
return engine_args.create_engine_config() | ||
|
||
# Create config with CUDA_VISIBLE_DEVICES set normally | ||
normal_config = create_config() | ||
|
||
# Create config with CUDA_VISIBLE_DEVICES="" | ||
with monkeypatch.context() as m: | ||
m.setenv("CUDA_VISIBLE_DEVICES", "") | ||
empty_config = create_config() | ||
|
||
normal_config_dict = vars(normal_config) | ||
empty_config_dict = vars(empty_config) | ||
|
||
# Remove instance_id before comparison as it's expected to be different | ||
normal_config_dict.pop("instance_id", None) | ||
empty_config_dict.pop("instance_id", None) | ||
|
||
assert deep_compare(normal_config_dict, empty_config_dict), ( | ||
"Configs with normal CUDA_VISIBLE_DEVICES and CUDA_VISIBLE_DEVICES=\"\"" | ||
" should be equivalent") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.