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

Fix sdxl q_unet config #2081

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -50,19 +50,13 @@ function run_benchmark {

if [[ ${mode} == "performance" ]]; then
extra_cmd=$extra_cmd" --performance"
if [[ ${int8} == "true" ]]; then
extra_cmd=$extra_cmd" --int8"
fi
echo $extra_cmd

python -u sdxl_smooth_quant.py \
--model_name_or_path ${model_name_or_path} \
--latent ${latent} \
${extra_cmd}
else
if [[ ${int8} == "true" ]]; then
extra_cmd=$extra_cmd" --int8"
fi
echo $extra_cmd

python -u sdxl_smooth_quant.py \
Expand All @@ -82,7 +76,7 @@ function run_benchmark {
cd mlperf_sd_inference
cp ../main.py ./
if [ -d "../saved_results/" ]; then
mv ../saved_results/ ./
cp -r ../saved_results/ ./
fi

python -u main.py \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ def forward_loop(model):
if args.int8:
from neural_compressor.torch.quantization import load
q_unet = load(os.path.abspath(os.path.expanduser(args.output_dir)))
setattr(q_unet, "config", pipeline.unet.config)
else:
q_unet = pipeline.unet

if not hasattr(q_unet, "config"):
setattr(q_unet, "config", pipeline.unet.config)
pipeline.unet = q_unet
quant_images = prompts2images(pipeline, prompts, n_steps=args.n_steps, latent=init_latent)
save_images(prompts, quant_images, args.output_dir, prefix='quant')
Expand Down
Loading