Skip to content

Commit

Permalink
feat: sort cuda graphs in descending order (huggingface#2104)
Browse files Browse the repository at this point in the history
  • Loading branch information
drbh authored and yuanwu2017 committed Sep 24, 2024
1 parent f0ed8d2 commit d930724
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/text_generation_server/models/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
else:
cuda_graphs = None


# sorting the cuda graphs in descending order helps reduce the
# memory impact and results in less memory usage
if cuda_graphs is not None:
cuda_graphs.sort(reverse=True)


CUDA_GRAPHS = cuda_graphs

# This is overridden at model loading.
Expand Down

0 comments on commit d930724

Please sign in to comment.