ttnn.synchronize_device

ttnn.synchronize_device = <nanobind.nb_func object>

ttnn._ttnn.multi_device.MeshDevice, cq_id: ttnn._ttnn.types.QueueId | None = None, sub_device_ids: collections.abc.Sequence[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.

Parameters:
  • 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)
Type:

synchronize_device(device