Run DM model twice, prep for bigger models (#34894)

* twice

* swap

* adjust
This commit is contained in:
Adeeb Shihadeh
2025-03-24 15:54:42 -07:00
committed by GitHub
parent e11b239b2e
commit 2382f1cab0
3 changed files with 11 additions and 4 deletions
+4 -1
View File
@@ -134,7 +134,7 @@ def get_driverstate_packet(model_output: np.ndarray, frame_id: int, location_ts:
def main():
setproctitle(PROCESS_NAME)
config_realtime_process([0, 1, 2, 3], 5)
config_realtime_process(7, 5)
sentry.set_tag("daemon", PROCESS_NAME)
cloudlog.bind(daemon=PROCESS_NAME)
@@ -173,6 +173,9 @@ def main():
model_output, gpu_execution_time = model.run(buf, calib, model_transform)
t2 = time.perf_counter()
# run one more time, just for the load
model.run(buf, calib, model_transform)
pm.send("driverStateV2", get_driverstate_packet(model_output, vipc_client.frame_id, vipc_client.timestamp_sof, t2 - t1, gpu_execution_time))
+6 -2
View File
@@ -391,8 +391,12 @@ class TestOnroad:
result += "----------------- Model Timing -----------------\n"
result += "------------------------------------------------\n"
cfgs = [
("modelV2", 0.045, 0.040), # TODO: this should be stricter but it's hard to measure exactly
("driverStateV2", 0.045, 0.035),
# since multiple processes use the GPU and can preempt each other,
# these numbers are not fully self-contained.
("modelV2", 0.06, 0.040),
# can miss cycles here and there, just important the avg frequency is 20Hz
("driverStateV2", 0.2, 0.05),
]
for (s, instant_max, avg_max) in cfgs:
ts = [getattr(m, s).modelExecutionTime for m in self.msgs[s]]
@@ -33,7 +33,7 @@ class Proc:
PROCS = [
Proc(['camerad'], 1.75, msgs=['roadCameraState', 'wideRoadCameraState', 'driverCameraState']),
Proc(['modeld'], 1.12, atol=0.2, msgs=['modelV2']),
Proc(['dmonitoringmodeld'], 0.6, msgs=['driverStateV2']),
Proc(['dmonitoringmodeld'], 1.4, msgs=['driverStateV2']),
Proc(['encoderd'], 0.23, msgs=[]),
]