ttnn.synchronize_device
- ttnn.synchronize_device(*args, **kwargs)
-
Overloaded function.
-
synchronize_device(device: ttnn._ttnn.device.IDevice, cq_id: Optional[ttnn._ttnn.types.QueueId] = None, sub_device_ids: list[ttnn._ttnn.device.SubDeviceId] = []) -> None
Synchronize the device with host by waiting for all operations to complete. If cq_id is provided then only the operations associated with that cq_id are waited for, otherwise operations for all command queues are waited on. If the device has been configured with sub-devices, then sub_device_ids can be provided to only wait for the operations that ran on the specified sub-devices, otherwise all sub-devices (the entire chip) are waited on.
- Args:
-
device (ttnn.device.Device): The device to synchronize with. cq_id (int, optional): The command queue ID to synchronize. Defaults to None. sub_device_ids (List[ttnn.SubDeviceId], optional): The sub-device IDs to synchronize. Defaults to sub-devices set by set_sub_device_stall_group.
- Returns:
-
None: The op ensures that all operations are completed.
- Example:
-
>>> device_id = 0 >>> device = ttnn.open_device(device_id=device_id) >>> # Assume some operations are queued on the device >>> ttnn.synchronize_device(device)
-
synchronize_device(device: ttnn._ttnn.multi_device.MeshDevice, cq_id: Optional[ttnn._ttnn.types.QueueId] = None, sub_device_ids: list[ttnn._ttnn.device.SubDeviceId] = []) -> None
Synchronize the device with host by waiting for all operations to complete. If cq_id is provided then only the operations associated with that cq_id are waited for, otherwise operations for all command queues are waited on. If the device has been configured with sub-devices, then sub_device_ids can be provided to only wait for the operations that ran on the specified sub-devices, otherwise all sub-devices (the entire chip) are waited on.
- Args:
-
device (ttnn.device.Device): The device to synchronize with. cq_id (int, optional): The command queue ID to synchronize. Defaults to None. sub_device_ids (List[ttnn.SubDeviceId], optional): The sub-device IDs to synchronize. Defaults to sub-devices set by set_sub_device_stall_group.
- Returns:
-
None: The op ensures that all operations are completed.
- Example:
-
>>> device_id = 0 >>> device = ttnn.open_device(device_id=device_id) >>> # Assume some operations are queued on the device >>> ttnn.synchronize_device(device)
-