fix xpu tests (#36656)
* fix awq xpu tests Signed-off-by: jiqing-feng <jiqing.feng@intel.com> * update Signed-off-by: jiqing-feng <jiqing.feng@intel.com> * fix llava next video bnb tests Signed-off-by: jiqing-feng <jiqing.feng@intel.com> --------- Signed-off-by: jiqing-feng <jiqing.feng@intel.com> Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
This commit is contained in:
@@ -59,16 +59,21 @@ class AwqConfigTest(unittest.TestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
AwqConfig(bits=4, backend="unexisting-backend")
|
||||
|
||||
compute_capability = torch.cuda.get_device_capability()
|
||||
major, minor = compute_capability
|
||||
# Only cuda device can run this function
|
||||
support_llm_awq = False
|
||||
if torch.cuda.is_available():
|
||||
compute_capability = torch.cuda.get_device_capability()
|
||||
major, minor = compute_capability
|
||||
if major >= 8:
|
||||
support_llm_awq = True
|
||||
|
||||
if major < 8:
|
||||
if support_llm_awq:
|
||||
# LLMAWQ should work on an A100
|
||||
AwqConfig(bits=4, backend="llm-awq")
|
||||
else:
|
||||
# LLMAWQ does not work on a T4
|
||||
with self.assertRaises(ValueError):
|
||||
AwqConfig(bits=4, backend="llm-awq")
|
||||
else:
|
||||
# LLMAWQ should work on an A100
|
||||
AwqConfig(bits=4, backend="llm-awq")
|
||||
|
||||
def test_to_dict(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user