# SPDX-License-Identifier: Apache-2.0 """Opening the Blackhole p150 for METEOR 2: the vendored ``ttaw.device`` (ETH dispatch, 12x10 grid; needs ``patches/tt-metal-eth-dispatch.patch`` on tt-metal 44d6650, which the container image is built with) bound to the validated open parameters below. ``METEOR2_DISPATCH`` / ``_NUM_CQS`` / ``_L1_SMALL`` / ``_TRACE_REGION`` / ``_WORKER_L1_SIZE`` and ``TT_DEVICE_ID`` override them. Importing it has no side effects.""" from __future__ import annotations from typing import Any, Dict from .ttaw.device import DeviceConfig, close_device, compute_grid, describe_device # noqa: F401 ENV_PREFIX = "METEOR2" DEVICE_DEFAULTS: Dict[str, Any] = { "num_command_queues": 1, "l1_small_size": 32768, # conv / pool config tensors "trace_region_size": 192 << 20, # the frame trace (~1,000 programs) + the peak-gather trace } def device_config(**overrides: Any) -> DeviceConfig: base = dict(DEVICE_DEFAULTS) base.update({k: v for k, v in overrides.items() if v is not None}) return DeviceConfig.from_env(ENV_PREFIX, **base) def open_device(device_id=None, *, dispatch=None, **overrides: Any): return device_config(device_id=device_id, dispatch=dispatch, **overrides).open()