From b1d45efd99d3066372e591f2dffe5555d4752c71 Mon Sep 17 00:00:00 2001 From: "Wang, Mengni" Date: Mon, 8 Dec 2025 15:28:17 +0800 Subject: [PATCH 1/3] Fix flux tuning device issue --- examples/pytorch/diffusion_model/diffusers/flux/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pytorch/diffusion_model/diffusers/flux/main.py b/examples/pytorch/diffusion_model/diffusers/flux/main.py index c9e0b98d5c0..0bf34b19daf 100644 --- a/examples/pytorch/diffusion_model/diffusers/flux/main.py +++ b/examples/pytorch/diffusion_model/diffusers/flux/main.py @@ -81,8 +81,8 @@ def inference_worker(eval_file, pipe, image_save_dir): output.images[idx].save(os.path.join(image_save_dir, str(image_id) + ".png")) -def tune(): - pipe = AutoPipelineForText2Image.from_pretrained(args.model, torch_dtype=torch.bfloat16) +def tune(device): + pipe = AutoPipelineForText2Image.from_pretrained(args.model, torch_dtype=torch.bfloat16).to(device) model = pipe.transformer layer_config = {} kwargs = {} @@ -116,7 +116,7 @@ def tune(): if args.quantize: print(f"Start to quantize {args.model}.") - tune() + tune(device) exit(0) if args.inference: From 41158476f6def46f52d7cbfaca13fe82c548807c Mon Sep 17 00:00:00 2001 From: "Wang, Mengni" Date: Thu, 11 Dec 2025 09:28:43 +0800 Subject: [PATCH 2/3] Update run_benchmark.sh --- .../pytorch/diffusion_model/diffusers/flux/run_benchmark.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pytorch/diffusion_model/diffusers/flux/run_benchmark.sh b/examples/pytorch/diffusion_model/diffusers/flux/run_benchmark.sh index 00a77810553..b7ca99d8b8b 100644 --- a/examples/pytorch/diffusion_model/diffusers/flux/run_benchmark.sh +++ b/examples/pytorch/diffusion_model/diffusers/flux/run_benchmark.sh @@ -86,7 +86,7 @@ function run_benchmark { echo "Start calculating final score..." - python3 main.py --output_image_path ${output_image_path} --accuracy + python3 main.py --output_image_path ${output_image_path} --accuracy --eval_dataset ${dataset_location} } main "$@" From 65d9542650962ff7c81cb24bc5e2c7ce038c1993 Mon Sep 17 00:00:00 2001 From: "Wang, Mengni" Date: Thu, 11 Dec 2025 13:35:00 +0800 Subject: [PATCH 3/3] Update README.md --- examples/pytorch/diffusion_model/diffusers/flux/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/pytorch/diffusion_model/diffusers/flux/README.md b/examples/pytorch/diffusion_model/diffusers/flux/README.md index bca01cbf32c..dcc21488de8 100644 --- a/examples/pytorch/diffusion_model/diffusers/flux/README.md +++ b/examples/pytorch/diffusion_model/diffusers/flux/README.md @@ -8,10 +8,10 @@ This example quantizes and validates the accuracy of Flux. ```shell pip install -r requirements.txt -# Use `INC_PT_ONLY=1 pip install git+https://github.com/intel/neural-compressor.git@v3.6rc` for the latest updates before neural-compressor v3.6 release -pip install neural-compressor-pt==3.6 -# Use `pip install git+https://github.com/intel/auto-round.git@v0.8.0rc2` for the latest updates before auto-round v0.8.0 release -pip install auto-round==0.8.0 +# Use `INC_PT_ONLY=1 pip install git+https://github.com/intel/neural-compressor.git@master` for the latest updates before neural-compressor v3.6 release +pip install neural-compressor-pt==3.7 +# Use `pip install git+https://github.com/intel/auto-round.git@main` for the latest updates before auto-round v0.8.0 release +pip install auto-round==0.9.3 ``` ## 2. Prepare Model