-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update benchmark script, add Dockerfile
- Loading branch information
1 parent
ef843a0
commit cdddab8
Showing
3 changed files
with
105 additions
and
48 deletions.
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,13 @@ | ||
FROM nvcr.io/nvidia/pytorch:22.11-py3 | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN pip install --pre xformers | ||
RUN pip install diffusers==0.11.0 accelerate transformers | ||
|
||
WORKDIR /workspace | ||
|
||
COPY benchmark.py /workspace/benchmark.py | ||
RUN (printf '#!/bin/bash\npython benchmark.py \"$@\"\n' >> /entry.sh) && chmod a+x /entry.sh | ||
ENTRYPOINT ["/entry.sh"] |
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,17 @@ | ||
bench: | ||
docker build -t sd-bench . | ||
docker run \ | ||
--rm -it \ | ||
--gpus all \ | ||
--shm-size=128g \ | ||
--net=host \ | ||
-v $(PWD):/workspace/results \ | ||
sd-bench \ | ||
--steps 30 \ | ||
--samples 1,2,4,8,16,32,64,128 \ | ||
--autocast no \ | ||
--xformers yes \ | ||
--output_file /workspace/results/results.csv | ||
|
||
clean: | ||
rm results.csv |
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