Skip to content
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

Implementation of Batching, Enabling HPU Graphs and FP8 quantization for SD3 Pipeline #1345

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2f9f53e
Update pipeline_stable_diffusion_3.py
deepak-gowda-narayana Sep 17, 2024
53aae6b
Update pipeline_stable_diffusion_3.py
deepak-gowda-narayana Sep 18, 2024
b343f35
Update pipeline_stable_diffusion_3.py
deepak-gowda-narayana Sep 19, 2024
0899f07
Update pipeline_stable_diffusion_3.py
deepak-gowda-narayana Sep 24, 2024
8c0a1b6
Update pipeline_stable_diffusion_3.py
deepak-gowda-narayana Sep 25, 2024
cae57f7
Update pipeline_stable_diffusion_3.py
deepak-gowda-narayana Oct 1, 2024
3b24e90
Merge branch 'huggingface:main' into main
deepak-gowda-narayana Oct 1, 2024
18690d9
Update pipeline_stable_diffusion_xl.py
deepak-gowda-narayana Oct 2, 2024
5220aab
Update README.md
deepak-gowda-narayana Oct 2, 2024
079c759
Create measure_config.json
deepak-gowda-narayana Oct 2, 2024
32564c4
Create quant_config.json
deepak-gowda-narayana Oct 2, 2024
595641c
Update pipeline_stable_diffusion_xl.py
deepak-gowda-narayana Oct 2, 2024
3b1dc48
Update pipeline_stable_diffusion_3.py
deepak-gowda-narayana Oct 2, 2024
a372536
Merge branch 'huggingface:main' into main
deepak-gowda-narayana Oct 2, 2024
cb91354
Update README.md
deepak-gowda-narayana Oct 7, 2024
1645d81
sync with original branch
deepak-gowda-narayana Oct 7, 2024
3b00c52
Update README.md
deepak-gowda-narayana Oct 7, 2024
5dd3246
Create measure_config.json
deepak-gowda-narayana Oct 7, 2024
20b8352
Create quantize_config.json
deepak-gowda-narayana Oct 7, 2024
cfe29ec
Delete examples/stable-diffusion/quantization/measure_config.json
deepak-gowda-narayana Oct 7, 2024
2ee0849
Delete examples/stable-diffusion/quantization/quant_config.json
deepak-gowda-narayana Oct 7, 2024
86f66d0
Add quant mode arguments for Stable Diffusion
deepak-gowda-narayana Oct 7, 2024
999b527
Merge branch 'huggingface:main' into main
deepak-gowda-narayana Oct 7, 2024
c5c8ceb
Add tests for SD3 - batch size
deepak-gowda-narayana Oct 7, 2024
f485278
Rename measure_config.json to measure_config.json
deepak-gowda-narayana Oct 7, 2024
8154614
Create quantize_config.json
deepak-gowda-narayana Oct 7, 2024
64e09e0
Delete examples/stable-diffusion/quantization/SD3/quantize_config.json
deepak-gowda-narayana Oct 7, 2024
865d950
Update measure_config.json
deepak-gowda-narayana Oct 7, 2024
1989c7f
Update quantize_config.json
deepak-gowda-narayana Oct 7, 2024
aaec9f6
Update text_to_image_generation.py
deepak-gowda-narayana Oct 7, 2024
d55f8d4
Update README.md
deepak-gowda-narayana Oct 7, 2024
3f41f45
update correct file name
deepak-gowda-narayana Oct 7, 2024
0983284
Merge branch 'huggingface:main' into main
deepak-gowda-narayana Oct 8, 2024
335d4f2
Run make style
deepak-gowda-narayana Oct 8, 2024
eabf4d9
Update README.md
deepak-gowda-narayana Oct 8, 2024
63882fb
Merge branch 'huggingface:main' into main
deepak-gowda-narayana Oct 15, 2024
0611cb0
Update sample size , add quant_mode argument to pipeline input
deepak-gowda-narayana Oct 22, 2024
65b5dba
make style to format code style
Oct 22, 2024
11f3a2b
Merge branch 'huggingface:main' into main
deepak-gowda-narayana Oct 24, 2024
ec736da
Merge branch 'huggingface:main' into main
deepak-gowda-narayana Oct 30, 2024
652829b
Merge branch 'huggingface:main' into main
deepak-gowda-narayana Nov 13, 2024
a9ab1ca
fix(sd-readme): Added sd3 measure step
imangohari1 Nov 14, 2024
b9550b7
Apply Patch to include quantization measure step in Readme
deepak-gowda-narayana Nov 15, 2024
cf1bb31
Delete 0001-fix-sd-readme-Added-sd3-measure-step.patch
deepak-gowda-narayana Nov 15, 2024
734b15a
update speed metric condition for number of samples
deepak-gowda-narayana Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
deepak-gowda-narayana marked this conversation as resolved.
Show resolved Hide resolved
"method": "HOOKS",
"mode": "MEASURE",
"dump_stats_path": "quantize/measure_all/fp8"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"method": "HOOKS",
"mode": "QUANTIZE",
"scale_method": "maxabs_hw_opt_weight",
"dump_stats_path": "quantize/measure_all/fp8"
}
8 changes: 8 additions & 0 deletions examples/stable-diffusion/text_to_image_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ def main():
action="store_true",
help="Use rescale_betas_zero_snr for controlling image brightness",
)
parser.add_argument(
"--quant_mode",
default="disable",
type=str,
help="Quantization mode 'measure', 'quantize', 'quantize-mixed' or 'disable'",
deepak-gowda-narayana marked this conversation as resolved.
Show resolved Hide resolved
)
args = parser.parse_args()

# Select stable diffuson pipeline based on input
Expand Down Expand Up @@ -403,6 +409,8 @@ def main():
image = np.concatenate([image, image, image], axis=2)
control_image = Image.fromarray(image)
kwargs_call["image"] = control_image

kwargs_call["quant_mode"] = args.quant_mode

# Instantiate a Stable Diffusion pipeline class
if sdxl:
Expand Down
Loading