Repository navigation
feat: Allow passing any arguments to vllm and sglang engines - #368
Merged
Merged
Conversation
grahamking
requested review from
GuanLuo,
alec-flowers,
biswapanda,
kkranen,
nnshah1,
paulhendricks,
piotrm-nvidia,
ptarasiewiczNV,
rmccorm4,
ryanolson,
tanmayv25,
tedzhouhk and
tmonty12
as code owners
March 24, 2025 20:06
grahamking
force-pushed
the
gk-extra-engine-args
branch
from
March 24, 2025 20:12
bd38186 to
d84a1eb
Compare
grahamking
enabled auto-merge (squash)
March 24, 2025 21:20
grahamking
force-pushed
the
gk-extra-engine-args
branch
from
March 25, 2025 12:13
fec487a to
88e5206
Compare
paulhendricks
approved these changes
Mar 25, 2025
| with open(extra_engine_args) as f: | ||
| json_map = json.load(f) | ||
| except FileNotFoundError: | ||
| logging.debug(f"File {extra_engine_args} not found.") |
Contributor
There was a problem hiding this comment.
When I pass invalid file name, then no error is displayed. How can I know that something is wrong?
root@eos0001:/workspace# dynamo-run out=vllm Qwen/Qwen2.5-3B-Instruct --extra-engine-args invalid_file_name.json
INFO 03-25 10:30:37 __init__.py:190] Automatically detected platform cuda.
INFO 03-25 10:30:37 nixl.py:16] NIXL is available
Loading safetensors checkpoint shards: 0% Completed | 0/2 [00:00<?, ?it/s]
Loading safetensors checkpoint shards: 50% Completed | 1/2 [00:00<00:00, 3.38it/s]
Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:00<00:00, 2.20it/s]
Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:00<00:00, 2.32it/s]
Capturing CUDA graph shapes: 100%|██████████| 35/35 [00:06<00:00, 5.22it/s]
2025-03-25T17:31:00.319867Z INFO dynamo_run::input::text: Ctrl-c to exit
Contributor
Author
There was a problem hiding this comment.
It does not raise FileNotFoundError? What is the fix?
Contributor
There was a problem hiding this comment.
Should catch the exception and print a message to the user to stdout and then quit
| except FileNotFoundError: | ||
| logging.debug(f"File {extra_engine_args} not found.") | ||
| except json.JSONDecodeError as e: | ||
| logging.debug(f"Invalid JSON in {extra_engine_args}: {e}") |
Contributor
There was a problem hiding this comment.
Also, when I pass corrupted file no error is printed:
root@eos0001:/workspace# cat sglang_extra.json
INVALID JSON SYNTAX
root@eos0001:/workspace# dynamo-run out=vllm Qwen/Qwen2.5-3B-Instruct --extra-engine-args sglang_extra.json
INFO 03-25 10:32:36 __init__.py:190] Automatically detected platform cuda.
INFO 03-25 10:32:36 nixl.py:16] NIXL is available
Loading safetensors checkpoint shards: 0% Completed | 0/2 [00:00<?, ?it/s]
Loading safetensors checkpoint shards: 50% Completed | 1/2 [00:00<00:00, 3.33it/s]
Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:00<00:00, 2.18it/s]
Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:00<00:00, 2.30it/s]
Capturing CUDA graph shapes: 100%|██████████| 35/35 [00:07<00:00, 4.92it/s]
2025-03-25T17:33:00.328763Z INFO dynamo_run::input::text: Ctrl-c to exit
? User ›
Contributor
Author
There was a problem hiding this comment.
Can you give an example of corrupted file?
Contributor
|
The only JSON this code hates is with some magic Unicode in the file name: This file is fine and here it works nicely for cat: |
kylehh
pushed a commit
to kylehh/dynamo
that referenced
this pull request
Apr 11, 2025
…mo#368) Put the arguments in a JSON file: ``` { "dtype": "half", "trust_remote_code": true } ``` Pass it like this: ``` dynamo-run out=sglang ~/llm_models/Llama-3.2-3B-Instruct --extra-engine-args sglang_extra.json ``` Requested here ai-dynamo#290 (`dtype`) and here ai-dynamo#360 (`trust_remote_code`).
This branch was previously deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Put the arguments in a JSON file:
Pass it like this:
Requested here #290 (
dtype) and here #360 (trust_remote_code).