-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
[Lora]Load tuned multi-lora kernel configs from json files #26319
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 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7b8d7fd
Load tuned multi-lora kernel configs from json files
li2haipeng 568c288
code clean
li2haipeng 16b1d30
clean
li2haipeng e970a28
Merge branch 'vllm-project:main' into main
li2haipeng bc0f7c7
using ENV to pass in config folder path
li2haipeng 7dc30b1
add README
li2haipeng 450ec16
nit
li2haipeng 1e57c36
modify README
li2haipeng ffb7e8f
Update vllm/lora/ops/triton_ops/utils.py
li2haipeng b4926d4
Update vllm/lora/ops/triton_ops/utils.py
li2haipeng aca76b2
remove /configs
li2haipeng 4a2b86d
Merge branch 'main' into main
li2haipeng 25182d4
pre-commit fix
li2haipeng 2a59623
fix
li2haipeng 9e4c1ac
fix
li2haipeng fbc9e10
ruff format fix
li2haipeng 3246494
Merge branch 'main' into main
jeejeelee 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,29 @@ | ||
| # Multi-LoRA Tuning | ||
|
|
||
| **Note**: The lora config folder should be passed in by export VLLM_TUNED_CONFIG_FOLDER=/path/to/configs. Without it, the kernel would use default configs | ||
|
|
||
| ## Tuning Process | ||
| Multi-lora shrink/expand Triton kernel tuning follows a similar methodology from [Triton MoE tuning](https://github.com/vllm-project/vllm/blob/main/benchmarks/kernels/benchmark_moe.py). An example searching space: | ||
|
|
||
| ``` | ||
| block_m_range = [16, 32, 64, 128, 256] | ||
| block_n_range = [32, 64, 128, 256] | ||
| block_k_range = [32, 64, 128, 256] | ||
| num_warps_range = [4, 8] | ||
| num_stage_range = [2, 3, 4, 5] | ||
| num_ctas_range = [1] | ||
| split_k_range = [4, 8, 16, 32, 64] | ||
| ``` | ||
| Specifically for multi-lora, `num_slices = [1,2,3]` requires to be tuned sperately for different `MNK` shapes for both shrink and expand kernels. | ||
|
|
||
| ## Config Files | ||
| ### File Name | ||
|
|
||
| For `shrink`, the config file is named as `{gpu_name}_SHRINK.json`, e.g. `NVIDIA_H200_SHRINK.json`. | ||
|
|
||
| For `expand`, the config fileis named as `{gpu_name}_EXPAND_{add_input}.json`, e.g. `NVIDIA_H200_EXPAND_TRUE.json`. | ||
|
|
||
| `gpu_name` can be automatically detected by calling `torch.cuda.get_device_name()` | ||
|
|
||
| ### Json Structure | ||
| Optimial kernel config files are saved in Json file with a structure as `config_data[max_loras][num_slices][m][k][n]` | ||
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.
Can we add a description of how to do tuning, so that users can perform tuning by reading this document, we can refer to https://github.com/sgl-project/sglang/blob/main/benchmark/kernels/fused_moe_triton/README.md#tuning-tool
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.
Sorry, I didn't submit my comment. After responding to the above comment, we can consider merging this PR.