Skip to content
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

add draft_gpu_split option for spec decoding #254

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

lucyknada
Copy link
Contributor

with a setup of 3090+3060; loading 32b (5bpw) and 1.5b or 0.5b draft (6bpw) first loads the draft model and then the model; making an otherwise 32b fitting onto the single 3090 (a lot more bandwidth) leak onto the 3060 with quite a few layers, negating all benefits of the draft model and even dropping performance even more (15-30% less tps); now pinning the draft model to another gpu (the 3060) entirely bypasses that and you get the same performance boost for spec decoding as before.

tabby_config.yml example of a draft_gpu_split:

image

I have tested it both with autosplit on the target model and manually splitting via gpu_split, the gpu-split syntax stays the same to be able to re-use the same code.

this is merely a kick-off PR to make it work, as I'm not sure if there's anything else that needs to be modified for this to be upstreamable and if there's some neat python tricks to not have to duplicate code in e.g. initializing gpu_device_list.

@lucyknada
Copy link
Contributor Author

just as I sent this I realized the sample config in the root of the project would need to have this option added too, I'm exclusively an in-line user so it escaped my mind entirely.

The previous code overrode the existing gpu split and device idx
values. This now sets an independent draft_gpu_split value and
adjusts the gpu_devices check only if the draft_gpu_split array
is larger than the gpu_split array.

Draft gpu split is not Tensor Parallel, and defaults to gpu_split_auto
if a split is not provided.

Signed-off-by: kingbri <[email protected]>
@kingbri1
Copy link
Member

kingbri1 commented Feb 8, 2025

@lucyknada please check the changes and see if they work. They run properly on my end. However, I only have one GPU.

@lucyknada
Copy link
Contributor Author

lucyknada commented Feb 11, 2025

confirming it works! thanks @kingbri1

@kingbri1 kingbri1 merged commit 2e49147 into theroyallab:main Feb 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants