pull/34894/head
Adeeb Shihadeh 1 month ago
parent 5a28b0c9fe
commit fbbbbbc18a
  1. 5
      selfdrive/modeld/dmonitoringmodeld.py
  2. 8
      selfdrive/test/test_onroad.py
  3. 2
      system/hardware/tici/tests/test_power_draw.py

@ -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))

@ -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.045, 0.040),
# can miss cycles here and there, just important the avg frequency is 20Hz
("driverStateV2", 0.05, 0.2),
]
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=[]),
]

Loading…
Cancel
Save