-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[CI] check size of the wheels #4319
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d13e504
[CI] check size of the wheels
simon-mo 62fa627
try using bash
simon-mo 75bb9dd
wip
simon-mo 5bcf86c
replace one liner with python script
simon-mo 0ac9953
revert env
simon-mo 9210e41
address comments
simon-mo 77738ec
print file sizes
simon-mo af8241d
print file sizes
simon-mo 873f9e6
Merge branch 'main' of github.com:vllm-project/vllm into add-wheel-si…
simon-mo 03e408b
fix comparison
simon-mo f33b32a
ldconfig
simon-mo 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 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,33 @@ | ||
import os | ||
import zipfile | ||
|
||
MAX_SIZE_MB = 100 | ||
|
||
|
||
def print_top_10_largest_files(zip_file): | ||
with zipfile.ZipFile(zip_file, 'r') as z: | ||
file_sizes = [(f, z.getinfo(f).file_size) for f in z.namelist()] | ||
file_sizes.sort(key=lambda x: x[1], reverse=True) | ||
for f, size in file_sizes[:10]: | ||
print(f"{f}: {size/(1024*1024)} MBs uncompressed.") | ||
|
||
|
||
def check_wheel_size(directory): | ||
for root, _, files in os.walk(directory): | ||
for f in files: | ||
if f.endswith(".whl"): | ||
wheel_path = os.path.join(root, f) | ||
wheel_size = os.path.getsize(wheel_path) | ||
wheel_size_mb = wheel_size / (1024 * 1024) | ||
if wheel_size_mb > MAX_SIZE_MB: | ||
print( | ||
f"Wheel {wheel_path} is too large ({wheel_size_mb} MB) " | ||
f"compare to the allowed size ({MAX_SIZE_MB} MB).") | ||
print_top_10_largest_files(wheel_path) | ||
return 1 | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
import sys | ||
sys.exit(check_wheel_size(sys.argv[1])) |
This file contains 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
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.
12.1.0 is EOL
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.
I think cuda has backward compatibility, compiling for 12.1 should work for 12.4 during runtime. But the reverse might not hold. If we compile the wheel with cuda 12.4, not sure if it works for 12.1 during runtime.