Skip to content

Commit

Permalink
#8792: Add support for missing devices and soft-fail
Browse files Browse the repository at this point in the history
  • Loading branch information
yieldthought authored and TT-billteng committed May 24, 2024
1 parent eefd79c commit 1aa9cd3
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,19 +432,31 @@ def reset_default_device():
def use_program_cache(request):
import tt_lib as ttl

if "device" in request.fixturenames:
if "device" in request.fixturenames or "device_l1_small_size" in request.fixturenames:
dev = ttl.device.GetDefaultDevice()
dev.enable_program_cache()
elif "all_devices" in request.fixturenames:
devices = request.getfixturevalue("all_devices")
for dev in devices:
dev.enable_program_cache()
elif "pcie_devices" in request.fixturenames:
devices = request.getfixturevalue("pcie_devices")
for dev in devices:
dev.enable_program_cache()
elif "device_mesh" in request.fixturenames:
mesh = request.getfixturevalue("device_mesh")
for device_id in mesh.get_device_ids():
mesh.get_device(device_id).enable_program_cache()
elif "t3k_device_mesh" in request.fixturenames:
device_mesh = request.getfixturevalue("t3k_device_mesh")
for device_id in device_mesh.get_device_ids():
device_mesh.get_device(device_id).enable_program_cache()
mesh = request.getfixturevalue("t3k_device_mesh")
for device_id in mesh.get_device_ids():
mesh.get_device(device_id).enable_program_cache()
elif "pcie_device_mesh" in request.fixturenames:
mesh = request.getfixturevalue("pcie_device_mesh")
for device_id in mesh.get_device_ids():
mesh.get_device(device_id).enable_program_cache()
else:
raise ValueError("No device fixture found to apply program cache to")
logger.warning("No device fixture found to apply program cache to: PROGRAM CACHE DISABLED")
yield


Expand Down

0 comments on commit 1aa9cd3

Please sign in to comment.