@@ -131,7 +131,6 @@ def download_ref_images(local_save_dir, filenames):
131131 print (f"download ref image failed: { e } " )
132132
133133
134- @pytest .mark .skipif (not is_turing (), reason = "Not Turing GPUs. Skip tests." )
135134@pytest .mark .parametrize (
136135 "rank,expected_lpips" ,
137136 [
@@ -141,16 +140,15 @@ def download_ref_images(local_save_dir, filenames):
141140 ],
142141)
143142def test_zimage_turbo_turing (rank : int , expected_lpips : dict [str , float ]):
143+ if f"{ precision } -{ dtype_str } " not in expected_lpips :
144+ return
145+
144146 if not already_generate (save_dir_16bit , len (dataset )):
145147 filenames = [d ["filename" ] for d in dataset ]
146148 download_ref_images (save_dir_16bit , filenames )
147149
148150 save_dir_nunchaku = (
149- Path ("test_results" )
150- / "nunchaku"
151- / model_name
152- / f"{ precision } _r{ rank } -{ dtype_str } "
153- / f"{ folder_name } -bs{ batch_size } "
151+ Path ("test_results" ) / "nunchaku" / model_name / f"{ precision } _r{ rank } -fp16" / f"{ folder_name } -bs{ batch_size } "
154152 )
155153 path = f"nunchaku-tech/nunchaku-z-image-turbo/svdq-{ precision } _r{ rank } -z-image-turbo.safetensors"
156154 transformer = NunchakuZImageTransformer2DModel .from_pretrained (path , torch_dtype = torch_dtype )
@@ -177,4 +175,4 @@ def test_zimage_turbo_turing(rank: int, expected_lpips: dict[str, float]):
177175
178176 lpips = compute_lpips (save_dir_16bit , save_dir_nunchaku )
179177 print (f"lpips: { lpips } " )
180- assert lpips < expected_lpips [f"{ precision } -{ dtype_str } " ] * 1.15
178+ assert lpips < expected_lpips [f"{ precision } -fp16 " ] * 1.15
0 commit comments