-
Notifications
You must be signed in to change notification settings - Fork 536
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
Stable Diffusion Reference Implementation #1519
Stable Diffusion Reference Implementation #1519
Conversation
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
6712ed4
to
c1177e1
Compare
c1177e1
to
8f16cfa
Compare
8f16cfa
to
1699a18
Compare
### Run the benchmark | ||
#### Local run | ||
```bash | ||
python3 main.py --dataset "coco-1024" --dataset-path coco2014 --profile stable-diffusion-xl-pytorch [--model-path <TODO: provide model weights>] [--dtype <fp32, fp16 or bf16>] [--device <cuda or cpu>] [--time 600] [--scenario SingleStream] |
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.
While trying the below command
CMD: /home/arjun/cm/bin/python3 main.py --scenario Offline --profile stable-diffusion-xl-pytorch --dataset coco-1024 --dataset-path /home/arjun/CM/repos/local/cache/03fbdcf95b3d4104/install --dtype fp32 --device cpu --mlperf_conf '/home/arjun/CM/repos/local/cache/d31d3986d6ba4c43/inference/mlperf.conf'
this error is coming
ERROR:main:thread: failed on contentid=['/home/arjun/CM/repos/local/cache/03fbdcf95b3d4104/install/validation/data/COCO_val2014_000000214494.jpg'], The size of tensor a (128) must match the size of tensor b (21) at non-singleton dimension 3
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.
@arjunsuresh I was inspecting this error and got a similar one, but I am not sure if they are the same:
IndexError: index 21 is out of bounds for dimension 0 with size 21
This is an issue that occurs because the scheduler can't handle multiple threads. Could you try to run the benchmark with the argument --threads 1
?
I am working in supporting this or maybe replacing it with a batch_size
in the forward pass
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.
Thank you @pgmpablo157321 for checking. With --threads 1
it is working fine and on RTX 4090 I'm seeing a mean latency of 5s.
f06c14c
to
d6b11b1
Compare
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.
Can you please share how this file was generated?. The TF has been using https://github.com/ahmadki/mlperf_sd_inference/blob/master/captions_5k.tsv for experiments, are they same?
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.
They contain the same set of captions and images. I sorted them by id
. The code used to generate them:
https://github.com/pgmpablo157321/inference/blob/055817374e369643a5e4d66e17ba765df5103b1d/text_to_image/tools/coco.py#L101-L126
6eb8859
to
3a1c804
Compare
b369eb6
to
07f0538
Compare
07f0538
to
0e5b400
Compare
0e5b400
to
f78aa5c
Compare
Contains the Stable Diffusion Reference Implementation. Currently ready for testing.