-
-
Notifications
You must be signed in to change notification settings - Fork 4k
feat(vllm): expose AsyncEngineArgs via generic engine_args YAML map #9563
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
Draft
richiejp
wants to merge
2
commits into
master
Choose a base branch
from
feat/vllm-conf
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,9 @@ | ||
| https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu12torch2.7cxx11abiTRUE-cp310-cp310-linux_x86_64.whl | ||
| # flash-attn wheels are ABI-tied to a specific torch version. vllm forces | ||
| # torch==2.10.0 as a hard dep, but flash-attn 2.8.3 (latest) only ships | ||
| # prebuilt wheels up to torch 2.8 — any wheel we pin here gets silently | ||
| # broken when vllm upgrades torch during install, producing an undefined | ||
| # libc10_cuda symbol at import time. FlashInfer (required by vllm) covers | ||
| # attention, and rotary_embedding/common.py guards the flash_attn import | ||
| # with find_spec(), so skipping flash-attn is safe and the only stable | ||
| # choice until upstream ships a torch-2.10 wheel. | ||
| vllm |
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| accelerate | ||
| torch==2.7.0 | ||
| torch | ||
| transformers | ||
| bitsandbytes |
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
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,61 @@ | ||
| package backend | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
| "testing" | ||
|
|
||
| "github.com/mudler/LocalAI/core/config" | ||
| ) | ||
|
|
||
| func TestGrpcModelOpts_EngineArgsSerialization(t *testing.T) { | ||
| threads := 1 | ||
| cfg := config.ModelConfig{ | ||
| Threads: &threads, | ||
| LLMConfig: config.LLMConfig{ | ||
| EngineArgs: map[string]any{ | ||
| "data_parallel_size": 8, | ||
| "enable_expert_parallel": true, | ||
| "speculative_config": map[string]any{ | ||
| "method": "ngram", | ||
| "num_speculative_tokens": 4, | ||
| }, | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| opts := grpcModelOpts(cfg, "/tmp/models") | ||
|
|
||
| if opts.EngineArgs == "" { | ||
| t.Fatal("EngineArgs proto field is empty; expected JSON-marshalled map") | ||
| } | ||
|
|
||
| var round map[string]any | ||
| if err := json.Unmarshal([]byte(opts.EngineArgs), &round); err != nil { | ||
| t.Fatalf("EngineArgs is not valid JSON: %v", err) | ||
| } | ||
|
|
||
| if round["data_parallel_size"].(float64) != 8 { | ||
| t.Errorf("data_parallel_size lost in roundtrip: %v", round["data_parallel_size"]) | ||
| } | ||
| if round["enable_expert_parallel"].(bool) != true { | ||
| t.Errorf("enable_expert_parallel lost in roundtrip: %v", round["enable_expert_parallel"]) | ||
| } | ||
| spec, ok := round["speculative_config"].(map[string]any) | ||
| if !ok { | ||
| t.Fatalf("speculative_config not preserved as nested object: %T", round["speculative_config"]) | ||
| } | ||
| if spec["method"].(string) != "ngram" { | ||
| t.Errorf("speculative_config.method lost in roundtrip: %v", spec["method"]) | ||
| } | ||
| } | ||
|
|
||
| func TestGrpcModelOpts_EngineArgsEmptyWhenUnset(t *testing.T) { | ||
| threads := 1 | ||
| cfg := config.ModelConfig{Threads: &threads} | ||
|
|
||
| opts := grpcModelOpts(cfg, "/tmp/models") | ||
|
|
||
| if opts.EngineArgs != "" { | ||
| t.Errorf("expected empty EngineArgs when unset, got %q", opts.EngineArgs) | ||
| } | ||
| } |
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
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
Oops, something went wrong.
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.
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.
while I'm ok with it in general, we already carry a
repeated string Options = 62;that is used already for this purpose (which calls already for refactoring, as would make much more sense to have amap<string, string>instead)