@@ -170,6 +170,7 @@ def rm_path(path):
170170@pytest .mark .parametrize ("dim1" , [1024 ], ids = id_formatter ("dim1" ))
171171@pytest .mark .parametrize ("dim2" , [32 , 1024 , 4097 , 1 ], ids = id_formatter ("dim2" ))
172172@pytest .mark .parametrize ("device" , get_available_devices (no_cpu = True ), ids = id_formatter ("device" ))
173+ @pytest .mark .skipif (not get_available_devices (no_cpu = True ), reason = "No device" )
173174def test_optimizer32bit (dim1 , dim2 , gtype , optim_name , device ):
174175 if optim_name .startswith ("paged_" ) and sys .platform == "win32" :
175176 pytest .skip ("Paged optimizers can have issues on Windows." )
@@ -250,6 +251,7 @@ def test_optimizer32bit(dim1, dim2, gtype, optim_name, device):
250251@pytest .mark .parametrize ("dim2" , [32 , 1024 , 4097 ], ids = id_formatter ("dim2" ))
251252@pytest .mark .parametrize ("gtype" , [torch .float32 , torch .float16 ], ids = describe_dtype )
252253@pytest .mark .parametrize ("device" , get_available_devices (no_cpu = True ))
254+ @pytest .mark .skipif (not get_available_devices (no_cpu = True ), reason = "No device" )
253255def test_global_config (dim1 , dim2 , gtype , device ):
254256 if dim1 == 1 and dim2 == 1 :
255257 return
@@ -306,6 +308,7 @@ def test_global_config(dim1, dim2, gtype, device):
306308@pytest .mark .parametrize ("dim2" , [32 , 1024 , 4097 ], ids = id_formatter ("dim2" ))
307309@pytest .mark .parametrize ("dim1" , [1024 ], ids = id_formatter ("dim1" ))
308310@pytest .mark .parametrize ("device" , get_available_devices (no_cpu = True ))
311+ @pytest .mark .skipif (not get_available_devices (no_cpu = True ), reason = "No device" )
309312def test_optimizer8bit (dim1 , dim2 , gtype , optim_name , device ):
310313 torch .set_printoptions (precision = 6 )
311314
0 commit comments