mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Compare device name of profiler dynamically (#150396)
Compare self.use_device of torch.autograd.profiler.profiler with _get_privateuse1_backend_name(), since privateuse1 backend can be renamed. Pull Request resolved: https://github.com/pytorch/pytorch/pull/150396 Approved by: https://github.com/sraikund16
This commit is contained in:
parent
c65de03196
commit
0da8127f77
|
|
@ -629,7 +629,7 @@ class profile:
|
||||||
)
|
)
|
||||||
max_evt_id = max(max_evt_id, fe.id)
|
max_evt_id = max(max_evt_id, fe.id)
|
||||||
if fe.device_type == DeviceType.CPU and not fe.is_async:
|
if fe.device_type == DeviceType.CPU and not fe.is_async:
|
||||||
if self.use_device == "privateuseone":
|
if self.use_device == _get_privateuse1_backend_name():
|
||||||
privateuse1_time = kineto_event.privateuse1_elapsed_us()
|
privateuse1_time = kineto_event.privateuse1_elapsed_us()
|
||||||
if privateuse1_time > 0:
|
if privateuse1_time > 0:
|
||||||
fe.append_kernel(fe.name, fe.device_index, privateuse1_time)
|
fe.append_kernel(fe.name, fe.device_index, privateuse1_time)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user