modeld: drop chestnut on fallback (#39044)

This commit is contained in:
Daniel Koepping
2026-10-06 18:43:50 -07:00
committed by GitHub
parent 035a447d1f
commit a0d47bcd08
+9
View File
@@ -77,6 +77,12 @@ def get_action_from_model(model_output: dict[str, np.ndarray], prev_action: log.
shouldStop=bool(stop))
def drop_chestnut() -> None:
if "AMD" in Device._opened_devices:
for d in Device._opened_devices:
Device[d].pending.pop(Device["AMD"], None)
class ChestnutGpuState:
# GPU metrics require modeld's GPU context
def __init__(self, pm: PubMaster, big: bool):
@@ -281,6 +287,8 @@ def main(demo=False):
loader.join(BIG_MODEL_TIMEOUT)
model = big_model
params.put_bool("ChestnutActive", model is not None)
if model is None:
drop_chestnut()
small_model = ModelState(vipc_client_main.width, vipc_client_main.height, False) if model is None or CHESTNUT else None
if model is None:
@@ -413,6 +421,7 @@ def main(demo=False):
raise
# fallback to small model
cloudlog.exception("big model failed, fall back to small")
drop_chestnut()
params.put_bool("ChestnutActive", False)
model = small_model
if chestnut_state is not None: