Skip to content

Commit

Permalink
fix memory check
Browse files Browse the repository at this point in the history
Signed-off-by: jiqing-feng <[email protected]>
  • Loading branch information
jiqing-feng committed Dec 20, 2024
1 parent f9e7e45 commit 99b5f14
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/quantization/gptq/test_gptq.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class GPTQTest(unittest.TestCase):
EXPECTED_OUTPUTS.add("Hello my name is Katie. I am a 20 year")

# this seems a little small considering that we are doing 4bit quant but we have a small model and ww don't quantize the embeddings
EXPECTED_RELATIVE_DIFFERENCE = 2.06184043
EXPECTED_RELATIVE_DIFFERENCE = 2.0618

bits = 4
sym = True
Expand Down Expand Up @@ -142,7 +142,7 @@ def test_memory_footprint(self):

mem_quantized = self.quantized_model.get_memory_footprint()

self.assertAlmostEqual(self.mem_fp16 / mem_quantized, self.EXPECTED_RELATIVE_DIFFERENCE)
self.assertAlmostEqual(self.mem_fp16 / mem_quantized, self.EXPECTED_RELATIVE_DIFFERENCE, places=4)

def test_device_and_dtype_assignment(self):
r"""
Expand Down Expand Up @@ -271,7 +271,6 @@ def test_serialization_big_model_inference(self):

@require_torch_gpu
class GPTQTestCUDA(GPTQTest):
EXPECTED_RELATIVE_DIFFERENCE = 2.06183008
device_map = {"": 0}

@classmethod
Expand Down

0 comments on commit 99b5f14

Please sign in to comment.