feat: sort cuda graphs in descending order (#2104)

This commit is contained in:
drbh 2024-06-21 14:28:26 -04:00 committed by GitHub
parent 197c47a302
commit 811a9381b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,13 @@ if cuda_graphs is not None:
else: else:
cuda_graphs = None 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 CUDA_GRAPHS = cuda_graphs
# This is overridden at model loading. # This is overridden at model loading.