6363 require_multi_accelerator ,
6464 require_non_cpu ,
6565 require_torch_gpu ,
66- require_torch_multi_gpu ,
6766)
6867
6968
@@ -594,7 +593,7 @@ def test_lora_causal_lm_multi_gpu_inference(self):
594593 # this should work without any problem
595594 _ = model .generate (input_ids = input_ids )
596595
597- @require_torch_multi_gpu
596+ @require_multi_accelerator
598597 @pytest .mark .multi_gpu_tests
599598 @require_bitsandbytes
600599 def test_lora_seq2seq_lm_multi_gpu_inference (self ):
@@ -622,7 +621,7 @@ def test_lora_seq2seq_lm_multi_gpu_inference(self):
622621 # this should work without any problem
623622 _ = model .generate (input_ids = input_ids )
624623
625- @require_torch_multi_gpu
624+ @require_multi_accelerator
626625 @pytest .mark .multi_gpu_tests
627626 @require_bitsandbytes
628627 def test_adaption_prompt_8bit (self ):
@@ -645,7 +644,7 @@ def test_adaption_prompt_8bit(self):
645644 random_input = torch .LongTensor ([[1 , 0 , 1 , 0 , 1 , 0 ]]).to (model .device )
646645 _ = model (random_input )
647646
648- @require_torch_multi_gpu
647+ @require_multi_accelerator
649648 @pytest .mark .multi_gpu_tests
650649 @require_bitsandbytes
651650 def test_adaption_prompt_4bit (self ):
@@ -668,7 +667,7 @@ def test_adaption_prompt_4bit(self):
668667 random_input = torch .LongTensor ([[1 , 0 , 1 , 0 , 1 , 0 ]]).to (model .device )
669668 _ = model (random_input )
670669
671- @require_torch_gpu
670+ @require_non_cpu
672671 @pytest .mark .single_gpu_tests
673672 @require_bitsandbytes
674673 def test_print_4bit_expected (self ):
@@ -778,7 +777,7 @@ def test_8bit_merge_lora(self):
778777 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .q_proj , bnb .nn .Linear8bitLt )
779778 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .v_proj , bnb .nn .Linear8bitLt )
780779
781- @require_torch_gpu
780+ @require_non_cpu
782781 @pytest .mark .single_gpu_tests
783782 @require_bitsandbytes
784783 def test_8bit_merge_and_disable_lora (self ):
@@ -814,7 +813,7 @@ def test_8bit_merge_and_disable_lora(self):
814813 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .q_proj , LoraLinear8bitLt )
815814 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .v_proj , LoraLinear8bitLt )
816815
817- @require_torch_gpu
816+ @require_non_cpu
818817 @pytest .mark .single_gpu_tests
819818 @require_bitsandbytes
820819 def test_8bit_merge_lora_with_bias (self ):
@@ -846,7 +845,7 @@ def test_8bit_merge_lora_with_bias(self):
846845 assert not torch .allclose (out_base , out_before_merge , atol = atol , rtol = rtol )
847846 assert torch .allclose (out_before_merge , out_after_merge , atol = atol , rtol = rtol )
848847
849- @require_torch_gpu
848+ @require_non_cpu
850849 @pytest .mark .single_gpu_tests
851850 @require_bitsandbytes
852851 def test_4bit_merge_lora (self ):
@@ -888,7 +887,7 @@ def test_4bit_merge_lora(self):
888887 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .q_proj , bnb .nn .Linear4bit )
889888 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .v_proj , bnb .nn .Linear4bit )
890889
891- @require_torch_gpu
890+ @require_non_cpu
892891 @pytest .mark .single_gpu_tests
893892 @require_bitsandbytes
894893 def test_4bit_merge_and_disable_lora (self ):
@@ -930,7 +929,7 @@ def test_4bit_merge_and_disable_lora(self):
930929 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .q_proj , LoraLinear4bit )
931930 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .v_proj , LoraLinear4bit )
932931
933- @require_torch_gpu
932+ @require_non_cpu
934933 @pytest .mark .single_gpu_tests
935934 @require_bitsandbytes
936935 def test_4bit_merge_lora_with_bias (self ):
@@ -971,7 +970,7 @@ def test_4bit_merge_lora_with_bias(self):
971970 assert not torch .allclose (out_base , out_before_merge , atol = atol , rtol = rtol )
972971 assert torch .allclose (out_before_merge , out_after_merge , atol = atol , rtol = rtol )
973972
974- @require_torch_gpu
973+ @require_non_cpu
975974 @pytest .mark .single_gpu_tests
976975 @require_bitsandbytes
977976 def test_4bit_lora_mixed_adapter_batches_lora (self ):
@@ -1042,7 +1041,7 @@ def test_4bit_lora_mixed_adapter_batches_lora(self):
10421041 assert torch .allclose (out_adapter0 [1 ::3 ], out_mixed [1 ::3 ], atol = atol , rtol = rtol )
10431042 assert torch .allclose (out_adapter1 [2 ::3 ], out_mixed [2 ::3 ], atol = atol , rtol = rtol )
10441043
1045- @require_torch_gpu
1044+ @require_non_cpu
10461045 @pytest .mark .single_gpu_tests
10471046 @require_bitsandbytes
10481047 def test_8bit_lora_mixed_adapter_batches_lora (self ):
@@ -1124,7 +1123,7 @@ def test_serialization_shared_tensors(self):
11241123 with tempfile .TemporaryDirectory () as tmp_dir :
11251124 model .save_pretrained (tmp_dir , safe_serialization = True )
11261125
1127- @require_torch_gpu
1126+ @require_non_cpu
11281127 @pytest .mark .single_gpu_tests
11291128 @require_bitsandbytes
11301129 def test_4bit_dora_inference (self ):
@@ -1163,7 +1162,7 @@ def test_4bit_dora_inference(self):
11631162 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .q_proj , LoraLinear4bit )
11641163 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .v_proj , LoraLinear4bit )
11651164
1166- @require_torch_gpu
1165+ @require_non_cpu
11671166 @pytest .mark .single_gpu_tests
11681167 @require_bitsandbytes
11691168 def test_8bit_dora_inference (self ):
@@ -1197,7 +1196,7 @@ def test_8bit_dora_inference(self):
11971196 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .q_proj , LoraLinear8bitLt )
11981197 assert isinstance (model .base_model .model .model .decoder .layers [0 ].self_attn .v_proj , LoraLinear8bitLt )
11991198
1200- @require_torch_gpu
1199+ @require_non_cpu
12011200 @pytest .mark .single_gpu_tests
12021201 @require_bitsandbytes
12031202 def test_4bit_dora_merging (self ):
0 commit comments