-
Notifications
You must be signed in to change notification settings - Fork 540
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
Improved CM commands #2013
Closed
Closed
Improved CM commands #2013
Changes from 9 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ae6025c
Update SDXL README.md, improved CM commands
sahilavaran 6b567a7
Update README.md | Fix SDXL model download path
sahilavaran 8ad2884
Update README.md | Added cm command for downloading coco2014 size.50
sahilavaran 469a3bc
Update README.md | Fix SDXL calibration download command
sahilavaran 41bded9
Update SDXL README.md
sahilavaran 6df318e
Update README.md
sahilavaran 1a2f391
Update README.md| Added outdirname for the bert
sahilavaran a313db7
Merge branch 'mlcommons:master' into master
sahilavaran 5b9b622
Fixed X and Y axis in coco.py
sahilavaran 5f5acec
Merge branch 'mlcommons:master' into master
sahilavaran 5bd1f3e
Merge branch 'master' into master
arjunsuresh 3d868ad
[Automated Commit] Format Codebase
github-actions[bot] 3060b71
made changes
sahilavaran 2a0fe9b
Merge branch 'master' of github.com:sahilavaran/inference
sahilavaran 9cb4e92
made changes in the coco.py
sahilavaran 9076e4f
[Automated Commit] Format Codebase
github-actions[bot] ed02ab7
Update coco.py
sahilavaran c91f2e6
Update README.md
sahilavaran 6bc50d8
Update README.md
sahilavaran e00758b
changed coco.py
sahilavaran a82a587
Resolved merge conflict
sahilavaran fdb343c
[Automated Commit] Format Codebase
github-actions[bot] d839f9f
Merge branch 'master' into master
sahilavaran d8a0cde
Update coco.py
sahilavaran e2061f7
[Automated Commit] Format Codebase
github-actions[bot] 4c88038
merge conflict removed
sahilavaran 4de7eed
Update coco.py
sahilavaran 686c8a3
[Automated Commit] Format Codebase
github-actions[bot] 225f81f
fixed
sahilavaran cb95879
resolved the conflicts
sahilavaran 3ffb5df
[Automated Commit] Format Codebase
github-actions[bot] 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# MLPerf™ Inference Benchmarks for Text to Image | ||
|
||
This is the reference implementation for MLPerf Inference text to image. | ||
## Automated command to run the benchmark via MLCommons CM | ||
|
||
Please see the [new docs site](https://docs.mlcommons.org/inference/benchmarks/text_to_image/sdxl) for an automated way to run this benchmark across different available implementations and do an end-to-end submission with or without docker. | ||
|
||
You can also do `pip install cm4mlops` and then use `cm` commands for downloading the model and datasets using the commands given in the later sections. | ||
|
||
## Supported Models | ||
|
||
| model | accuracy | dataset | model source | precision | notes | | ||
|
@@ -53,10 +55,10 @@ We host two checkpoints (fp32 and fp16) that are a snapshot of the [Hugging Face | |
The following MLCommons CM commands can be used to programmatically download the model checkpoints. | ||
|
||
``` | ||
pip install cmind | ||
cm pull repo mlcommons@ck | ||
cm run script --tags=get,ml-model,sdxl,_fp16,_rclone -j | ||
cm run script --tags=get,ml-model,sdxl,_fp32,_rclone -j | ||
cm run script --tags=get,ml-model,sdxl,_fp16,_rclone --outdirname=$MODEL_PATH | ||
``` | ||
``` | ||
cm run script --tags=get,ml-model,sdxl,_fp32,_rclone --outdirname-$MODEL_PATH | ||
``` | ||
#### Manual method | ||
|
||
|
@@ -72,30 +74,35 @@ Once Rclone is installed, run the following command to authenticate with the buc | |
rclone config create mlc-inference s3 provider=Cloudflare access_key_id=f65ba5eef400db161ea49967de89f47b secret_access_key=fbea333914c292b854f14d3fe232bad6c5407bf0ab1bebf78833c2b359bdfd2b endpoint=https://c2686074cb2caf5cbaf6d134bdba8b47.r2.cloudflarestorage.com | ||
``` | ||
You can then navigate in the terminal to your desired download directory and run the following commands to download the checkpoints: | ||
``` | ||
cd $MODEL_PATH | ||
``` | ||
|
||
**`fp32`** | ||
``` | ||
rclone copy mlc-inference:mlcommons-inference-wg-public/stable_diffusion_fp32 ./stable_diffusion_fp32 -P | ||
rclone copy mlc-inference:mlcommons-inference-wg-public/stable_diffusion_fp32 $MODEL_PATH -P | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are already inside $MODEL_PATH after |
||
``` | ||
**`fp16`** | ||
``` | ||
rclone copy mlc-inference:mlcommons-inference-wg-public/stable_diffusion_fp16 ./stable_diffusion_fp16 -P | ||
rclone copy mlc-inference:mlcommons-inference-wg-public/stable_diffusion_fp16 $MODEL_PATH -P | ||
``` | ||
|
||
#### Move to model path | ||
### Download validation dataset | ||
|
||
```bash | ||
mkdir $MODEL_PATH | ||
cd $MODEL_PATH | ||
# For fp32 | ||
mv <path_to_download>/stable_diffusion_fp32.zip . | ||
unzip stable_diffusion_fp32.zip | ||
# For fp16 | ||
mv <path_to_download>/stable_diffusion_fp16.zip . | ||
unzip stable_diffusion_fp16.zip | ||
#### CM METHOD | ||
The following MLCommons CM commands can be used to programmatically download the validation dataset. | ||
|
||
``` | ||
cm run script --tags=get,dataset,coco2014,_validation,_full --outdirname=coco2014 | ||
``` | ||
|
||
For debugging you can download only a part of all the images in the dataset | ||
``` | ||
cm run script --tags=get,dataset,coco2014,_validation,_size.50 --outdirname=coco2014 | ||
``` | ||
|
||
### Download dataset | ||
|
||
#### MANUAL METHOD | ||
```bash | ||
cd $SD_FOLDER/tools | ||
./download-coco-2014.sh -n <number_of_workers> | ||
|
@@ -107,14 +114,25 @@ cd $SD_FOLDER/tools | |
``` | ||
If the file [captions.tsv](coco2014/captions/captions.tsv) can be found in the script, it will be used to download the target dataset subset, otherwise it will be generated. We recommend you to have this file for consistency. | ||
|
||
#### Calibration dataset | ||
### Download Calibration dataset (only if you are doing quantization) | ||
|
||
#### CM METHOD | ||
The following MLCommons CM commands can be used to programmatically download the calibration dataset. | ||
|
||
``` | ||
cm run script --tags=get,dataset,coco2014,_calibration --outdirname=coco2014 | ||
``` | ||
|
||
|
||
#### MANUAL METHOD | ||
|
||
We provide a script to download the calibration captions and images. To download only the captions: | ||
```bash | ||
cd $SD_FOLDER/tools | ||
./download-coco-2014-calibration.sh | ||
./download-coco-2014-calibration.sh -n <number_of_workers> | ||
``` | ||
To download only the captions and images: | ||
|
||
To download both the captions and images: | ||
```bash | ||
cd $SD_FOLDER/tools | ||
./download-coco-2014-calibration.sh -i -n <number_of_workers> | ||
|
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 |
---|---|---|
|
@@ -317,7 +317,7 @@ def showAnns(self, anns): | |
v = kp[2::3] | ||
for sk in sks: | ||
if np.all(v[sk] > 0): | ||
plt.plot(x[sk], y[sk], linewidth=3, color=c) | ||
plt.plot(x[sk], y[sk], linewidth=3, color=c,label=f"keypoint {sk}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the change done here? |
||
plt.plot( | ||
x[v > 0], | ||
y[v > 0], | ||
|
@@ -336,6 +336,10 @@ def showAnns(self, anns): | |
markeredgecolor=c, | ||
markeredgewidth=2, | ||
) | ||
plt.xlabel("X Coordinate") | ||
plt.ylabel("Y Coordinate") | ||
print("Script is running correctly!") | ||
plt.show() | ||
p = PatchCollection( | ||
polygons, | ||
facecolor=color, | ||
|
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.
Whats the use of
--outdirname
here?