-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
df253f7
feat(vllm): expose AsyncEngineArgs via generic engine_args YAML map
richiejp 109da91
chore(vllm): pin cublas13 to vLLM 0.20.0 cu130 wheel
richiejp bcf627a
ci(vllm): bot job to bump cublas13 vLLM wheel pin
richiejp ecfc956
docs(vllm): document engine_args and speculative decoding
richiejp 60de8e1
Merge branch 'master' into feat/vllm-conf
mudler d88d099
Merge branch 'master' into feat/vllm-conf
mudler 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,45 @@ | ||
| #!/bin/bash | ||
| # Bump the cublas13 vLLM wheel pin in requirements-cublas13-after.txt. | ||
| # | ||
| # vLLM's PyPI wheel is built against CUDA 12 so the cublas13 build pulls a | ||
| # cu130-flavoured wheel from vLLM's per-tag index at | ||
| # https://wheels.vllm.ai/<TAG>/cu130/. That URL segment is itself version-locked | ||
| # (no /latest/ alias upstream), so bumping vLLM means rewriting both the URL | ||
| # segment and the version constraint atomically. bump_deps.sh handles git-sha | ||
| # vars in Makefiles; this script handles the two-value rewrite specific to the | ||
| # vLLM requirements file. | ||
| set -xe | ||
| REPO=$1 # vllm-project/vllm | ||
| FILE=$2 # backend/python/vllm/requirements-cublas13-after.txt | ||
| VAR=$3 # VLLM_VERSION (used for output file names so the workflow can read them) | ||
|
|
||
| if [ -z "$FILE" ] || [ -z "$REPO" ] || [ -z "$VAR" ]; then | ||
| echo "usage: $0 <repo> <requirements-file> <var-name>" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # /releases/latest returns the most recent non-prerelease tag. | ||
| LATEST_TAG=$(curl -sS -H "Accept: application/vnd.github+json" \ | ||
| "https://api.github.com/repos/$REPO/releases/latest" \ | ||
| | python3 -c "import json,sys; print(json.load(sys.stdin)['tag_name'])") | ||
|
|
||
| # Strip leading 'v' (vLLM tags are 'v0.20.0', the URL/version use '0.20.0'). | ||
| NEW_VERSION="${LATEST_TAG#v}" | ||
|
|
||
| set +e | ||
| CURRENT_VERSION=$(grep -oE '^vllm==[0-9]+\.[0-9]+\.[0-9]+' "$FILE" | head -1 | cut -d= -f3) | ||
| set -e | ||
|
|
||
| # sed both lines unconditionally — peter-evans/create-pull-request opens no PR | ||
| # when the working tree is clean, so a no-op rewrite is safe. | ||
| sed -i "$FILE" \ | ||
| -e "s|wheels\.vllm\.ai/[^/]*/cu130|wheels.vllm.ai/$NEW_VERSION/cu130|g" \ | ||
| -e "s|^vllm==.*|vllm==$NEW_VERSION|" | ||
|
|
||
| if [ -z "$CURRENT_VERSION" ]; then | ||
| echo "Could not find vllm==X.Y.Z in $FILE." | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Changes: https://github.com/$REPO/compare/v${CURRENT_VERSION}...${LATEST_TAG}" >> "${VAR}_message.txt" | ||
| echo "${NEW_VERSION}" >> "${VAR}_commit.txt" |
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
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,7 @@ | ||
| --extra-index-url https://download.pytorch.org/whl/cu130 | ||
| vllm | ||
| # vLLM's PyPI wheel is built against CUDA 12 (libcudart.so.12) and won't load | ||
| # on a cu130 host. Pull the cu130-flavoured wheel from vLLM's per-tag index | ||
| # instead — the cublas13 case in install.sh adds --index-strategy=unsafe-best-match | ||
| # so uv consults this index alongside PyPI. | ||
| --extra-index-url https://wheels.vllm.ai/0.20.0/cu130 | ||
| vllm==0.20.0 |
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,44 @@ | ||
| package backend | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
|
|
||
| "github.com/mudler/LocalAI/core/config" | ||
|
|
||
| . "github.com/onsi/ginkgo/v2" | ||
| . "github.com/onsi/gomega" | ||
| ) | ||
|
|
||
| var _ = Describe("grpcModelOpts EngineArgs", func() { | ||
| It("serialises engine_args as JSON preserving nested values", func() { | ||
| 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") | ||
| Expect(opts.EngineArgs).NotTo(BeEmpty()) | ||
|
|
||
| var round map[string]any | ||
| Expect(json.Unmarshal([]byte(opts.EngineArgs), &round)).To(Succeed()) | ||
| Expect(round["data_parallel_size"]).To(BeEquivalentTo(8)) | ||
| Expect(round["enable_expert_parallel"]).To(BeTrue()) | ||
| Expect(round["speculative_config"]).To(HaveKeyWithValue("method", "ngram")) | ||
| }) | ||
|
|
||
| It("leaves EngineArgs empty when unset", func() { | ||
| threads := 1 | ||
| opts := grpcModelOpts(config.ModelConfig{Threads: &threads}, "/tmp/models") | ||
| Expect(opts.EngineArgs).To(BeEmpty()) | ||
| }) | ||
| }) |
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.
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)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.
I'm not sure what you mean, but EngineArgs is a JSON string because it is a nested structure, so if we set it as
map<string, string>then the values will still need to be JSON in some cases or else we flatten the structure.I don't have a strong opinion on whether to flatten it although if we did then Options could be kept as-is or we could switch it to a map.
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.
ok cool, I thought it was merely used for K,V and since we had already some options I didn't wanted to reintroduce dups, but I'm good with it , have no strong opinion