fix for inductor no attribute prop.multi_processor_count (#2803)

This commit is contained in:
Lei Zhenyuan 2025-06-26 16:44:15 +08:00 committed by GitHub
commit 396531ec1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -556,10 +556,10 @@ from unsloth import DEVICE_TYPE
def is_big_gpu(index) -> bool:
if DEVICE_TYPE == "xpu":
prop = torch.xpu.get_device_properties(index)
prop = DeviceProperties.create(torch.device("xpu", index) if type(index) is int else index)
min_sms = 16
else:
prop = torch.cuda.get_device_properties(index)
prop = DeviceProperties.create(torch.device("cuda", index) if type(index) is int else index)
min_sms = 80
avail_sms = prop.multi_processor_count