ttnn.open_device

ttnn.open_device(*, device_id: int, l1_small_size: int = 0, trace_region_size: int = 0, dispatch_core_config: ttnn._ttnn.device.DispatchCoreConfig = <ttnn._ttnn.device.DispatchCoreConfig object at 0x7f1380b436f0>) ttnn._ttnn.device.Device

Open a device with the given device_id. If the device is already open, return the existing device.

Keyword Args:

device_id (int): The device ID to open. l1_small_size (int, optional): The size of the L1 small buffer. Defaults to ttnn.device.DEFAULT_L1_SMALL_SIZE. trace_region_size (int, optional): The size of the trace region. Defaults to ttnn.device.DEFAULT_TRACE_REGION_SIZE. dispatch_core_type (ttnn.device.DispatchCoreType, optional): The type of dispatch core to use. Defaults to ttnn.device.DispatchCoreType.WORKER.

Returns:

ttnn.Device: The device with the given device_id.

Example:
>>> device_id = 0
>>> device = ttnn.open_device(device_id=device_id)
>>> print(device)
<ttnn._ttnn.device.Device object at 0x7fbac5bfc1b0>