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

feat: sort cuda graphs in descending order #2104

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Conversation

drbh
Copy link
Collaborator

@drbh drbh commented Jun 21, 2024

sorting cuda graphs in descending order uses slightly less memory during initialization

using the following command on 1 A10G

text-generation-launcher \
--model-id meta-llama/Llama-2-7b-chat-hf \
--num-shard 1 \
--cuda-graphs 2,4,8,16,32,64,128,256,512,1024,2048

without cuda graphs sorted 22140/23028 MiB are used and with them sorted 21938/23028 MiB are used.

This is a small percent of total memory (<1%) however it's 202 MiB saved. Additionally looking at the memory usage overtime, loading in descending order has smaller spike (never goes above its final value, where in ascending it peaks higher than 22222 MiB)

Below are the two memory recording with https://github.com/drbh/nvline, left is ascending, and right is descending.

desc-graphs-nvline

@drbh
Copy link
Collaborator Author

drbh commented Jun 21, 2024

@danieldk thanks for suggesting this and reviewing!

@drbh drbh merged commit 811a938 into main Jun 21, 2024
6 checks passed
@drbh drbh deleted the descending-cuda-graphs branch June 21, 2024 18:28
yuanwu2017 pushed a commit to yuanwu2017/tgi-gaudi that referenced this pull request Sep 26, 2024
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