File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ def test_memory_footprint(self):
172172 mem_fp16 = self .model_fp16 .get_memory_footprint ()
173173 mem_4bit = self .model_4bit .get_memory_footprint ()
174174
175- self .assertAlmostEqual (mem_fp16 / mem_4bit , self .EXPECTED_RELATIVE_DIFFERENCE )
175+ self .assertAlmostEqual (mem_fp16 / mem_4bit , self .EXPECTED_RELATIVE_DIFFERENCE , delta = 1e-5 )
176176 linear = get_some_linear_layer (self .model_4bit )
177177 self .assertTrue (linear .weight .__class__ == Params4bit )
178178
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ def test_memory_footprint(self):
229229 mem_fp16 = self .model_fp16 .get_memory_footprint ()
230230 mem_8bit = self .model_8bit .get_memory_footprint ()
231231
232- self .assertAlmostEqual (mem_fp16 / mem_8bit , self .EXPECTED_RELATIVE_DIFFERENCE )
232+ self .assertAlmostEqual (mem_fp16 / mem_8bit , self .EXPECTED_RELATIVE_DIFFERENCE , delta = 1e-5 )
233233 self .assertTrue (get_some_linear_layer (self .model_8bit ).weight .__class__ == Int8Params )
234234
235235 def test_linear_are_8bit (self ):
@@ -938,8 +938,13 @@ class MixedInt8LlamaTest(MixedInt8Test):
938938 model_name = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
939939 EXPECTED_RELATIVE_DIFFERENCE = 1.7869331026479096
940940 EXPECTED_OUTPUTS = set ()
941+
942+ # Expected on Intel XPU
941943 EXPECTED_OUTPUTS .add ("Hello my name is John Smith and I am a software engineer. I" )
942944
945+ # Expected on NVIDIA T4
946+ EXPECTED_OUTPUTS .add ("Hello my name is John and I am a software engineer. I have" )
947+
943948 def test_int8_from_pretrained (self ):
944949 r"""
945950 Test whether loading a 8bit model from the Hub works as expected
You can’t perform that action at this time.
0 commit comments