amd: finalize device in case of failures (#10124)

This commit is contained in:
nimlgen
2025-05-01 10:41:15 +03:00
committed by GitHub
parent ef011ff5f9
commit 09f5be9bcb
+2 -1
View File
@@ -927,5 +927,6 @@ class AMDDevice(HCQCompiled):
super()._at_profile_finalize()
def finalize(self):
self.synchronize()
try: self.synchronize() # Try to finalize device in any case.
except RuntimeError as e: print(f"{self.device} synchronization failed before finalizing: {e}")
if hasattr(self.dev_iface, 'device_fini'): self.dev_iface.device_fini()