-
Notifications
You must be signed in to change notification settings - Fork 437
Add vLLM Support for GPT OSS and its mapping generator for tunix. #2766
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
Open
abhinavclemson
wants to merge
1
commit into
main
Choose a base branch
from
make-gpt-oss-work
base: main
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.
Open
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
|
|
||
| #!/bin/bash | ||
|
|
||
| # 1. Define the target directory | ||
| SITE_PACKAGES="/usr/local/lib/python*/site-packages" | ||
| TEMP_DIR="temp_patch_work" | ||
|
|
||
| # Ensure the script stops if any command fails | ||
| set -e | ||
|
|
||
| echo "Navigate to site-packages: $SITE_PACKAGES" | ||
| cd "$SITE_PACKAGES" | ||
|
|
||
| # 2. Create a temporary directory for cloning | ||
| echo "Creating temporary directory..." | ||
| # Remove it first if it exists from a previous failed run to ensure a clean slate | ||
| if [ -d "$TEMP_DIR" ]; then rm -rf "$TEMP_DIR"; fi | ||
| mkdir "$TEMP_DIR" | ||
| cd "$TEMP_DIR" | ||
|
|
||
| # 3. Clone the repositories | ||
| echo "Cloning repositories..." | ||
| git clone https://github.com/vllm-project/vllm.git | ||
| git clone -b make-moe-work https://github.com/abhinavclemson/tunix.git | ||
| git clone https://github.com/vllm-project/tpu-inference.git | ||
|
|
||
| # Go back up to site-packages | ||
| cd .. | ||
|
|
||
| # 4. Copy files | ||
| # We use 'cp -rf' to force overwrite existing files recursively. | ||
| # We assume the destination folders (./tunix, ./vllm) already exist as installed packages. | ||
| # If they don't exist, we create them. | ||
|
|
||
| echo "Patching Tunix..." | ||
| mkdir -p ./tunix | ||
| cp -rf "$TEMP_DIR/tunix/tunix/"* ./tunix/ | ||
|
|
||
| echo "Patching TPU-Inference..." | ||
| # Note: Verify if the installed package name is 'tpu_inference' (underscore) or 'tpu-inference' (dash). | ||
| # Based on your prompt, we are using 'tpu-inference'. | ||
| mkdir -p ./tpu_inference | ||
| cp -rf "$TEMP_DIR/tpu-inference/tpu_inference/"* ./tpu_inference/ | ||
|
|
||
| echo "Patching vLLM..." | ||
| mkdir -p ./vllm | ||
| cp -rf "$TEMP_DIR/vllm/vllm/"* ./vllm/ | ||
|
|
||
| # 5. Cleanup | ||
| echo "Cleaning up temporary files..." | ||
| rm -rf "$TEMP_DIR" | ||
|
|
||
| echo "Done! Packages have been patched." |
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,53 @@ | ||
|
|
||
| #!/bin/bash | ||
|
|
||
| # 1. Define the target directory | ||
| SITE_PACKAGES="/usr/local/lib/python*/site-packages" | ||
| TEMP_DIR="temp_patch_work" | ||
|
|
||
| # Ensure the script stops if any command fails | ||
| set -e | ||
|
|
||
| echo "Navigate to site-packages: $SITE_PACKAGES" | ||
| cd "$SITE_PACKAGES" | ||
|
|
||
| # 2. Create a temporary directory for cloning | ||
| echo "Creating temporary directory..." | ||
| # Remove it first if it exists from a previous failed run to ensure a clean slate | ||
| if [ -d "$TEMP_DIR" ]; then rm -rf "$TEMP_DIR"; fi | ||
| mkdir "$TEMP_DIR" | ||
| cd "$TEMP_DIR" | ||
|
|
||
| # 3. Clone the repositories | ||
| echo "Cloning repositories..." | ||
| git clone https://github.com/vllm-project/vllm.git | ||
| git clone -b make-moe-work https://github.com/abhinavclemson/tunix.git | ||
| git clone https://github.com/vllm-project/tpu-inference.git | ||
|
|
||
| # Go back up to site-packages | ||
| cd .. | ||
|
|
||
| # 4. Copy files | ||
| # We use 'cp -rf' to force overwrite existing files recursively. | ||
| # We assume the destination folders (./tunix, ./vllm) already exist as installed packages. | ||
| # If they don't exist, we create them. | ||
|
|
||
| echo "Patching Tunix..." | ||
| mkdir -p ./tunix | ||
| cp -rf "$TEMP_DIR/tunix/tunix/"* ./tunix/ | ||
|
|
||
| echo "Patching TPU-Inference..." | ||
| # Note: Verify if the installed package name is 'tpu_inference' (underscore) or 'tpu-inference' (dash). | ||
| # Based on your prompt, we are using 'tpu-inference'. | ||
| mkdir -p ./tpu_inference | ||
| cp -rf "$TEMP_DIR/tpu-inference/tpu_inference/"* ./tpu_inference/ | ||
|
|
||
| echo "Patching vLLM..." | ||
| mkdir -p ./vllm | ||
| cp -rf "$TEMP_DIR/vllm/vllm/"* ./vllm/ | ||
|
|
||
| # 5. Cleanup | ||
| echo "Cleaning up temporary files..." | ||
| rm -rf "$TEMP_DIR" | ||
|
|
||
| echo "Done! Packages have been patched." |
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,57 @@ | ||
|
|
||
| #!/bin/bash | ||
|
|
||
| # Ensure the script stops if any command fails | ||
| set -e | ||
|
|
||
| cd .. | ||
|
|
||
| # 1. Define the target directory | ||
| SITE_PACKAGES=$(find . -type d -name "*site-packages*" -print -quit) | ||
|
|
||
| TEMP_DIR="temp_patch_work" | ||
|
|
||
| echo "Navigate to site-packages: $SITE_PACKAGES" | ||
| cd "$SITE_PACKAGES" | ||
|
|
||
| # 2. Create a temporary directory for cloning | ||
| echo "Creating temporary directory..." | ||
| # Remove it first if it exists from a previous failed run to ensure a clean slate | ||
| if [ -d "$TEMP_DIR" ]; then rm -rf "$TEMP_DIR"; fi | ||
| mkdir "$TEMP_DIR" | ||
| cd "$TEMP_DIR" | ||
|
|
||
| # 3. Clone the repositories | ||
| echo "Cloning repositories..." | ||
| git clone https://github.com/vllm-project/vllm.git && cd vllm && git checkout 8c363ed6663f69b97c9f34b0be0091d8135f958c && cd .. | ||
| git clone -b make-moe-work https://github.com/abhinavclemson/tunix.git | ||
| git clone https://github.com/abhinavclemson/tpu-inference.git | ||
|
|
||
|
|
||
| # Go back up to site-packages | ||
| cd .. | ||
|
|
||
| # 4. Copy files | ||
| # We use 'cp -rf' to force overwrite existing files recursively. | ||
| # We assume the destination folders (./tunix, ./vllm) already exist as installed packages. | ||
| # If they don't exist, we create them. | ||
|
|
||
| echo "Patching Tunix..." | ||
| mkdir -p ./tunix | ||
| cp -rf "$TEMP_DIR/tunix/tunix/"* ./tunix/ | ||
|
|
||
| echo "Patching TPU-Inference..." | ||
| # Note: Verify if the installed package name is 'tpu_inference' (underscore) or 'tpu-inference' (dash). | ||
| # Based on your prompt, we are using 'tpu-inference'. | ||
| mkdir -p ./tpu_inference | ||
| cp -rf "$TEMP_DIR/tpu-inference/tpu_inference/"* ./tpu_inference/ | ||
|
|
||
| echo "Patching vLLM..." | ||
| mkdir -p ./vllm | ||
| cp -rf "$TEMP_DIR/vllm/vllm/"* ./vllm/ | ||
|
|
||
| # 5. Cleanup | ||
| echo "Cleaning up temporary files..." | ||
| rm -rf "$TEMP_DIR" | ||
|
|
||
| echo "Done! Packages have been patched." |
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
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.
if someone tried (weirdly) to use our old gpt3 model would this hit?