Commit Graph

301 Commits

Author SHA1 Message Date
grekiki
17e33978cd Mypy fixes for --check-untyped-defs (#24372)
more type fixes
2022-05-12 14:08:11 +02:00
Shane Smiskol
60b7114024 onnxruntime: initialize CUDA provider before predictions (#24330)
* initialize CUDA runtime before predictions

* dmond pauses modeld execution...

* done in other PR
2022-04-26 11:49:32 -07:00
Willem Melching
3741908733 Do not run model when skipping frames (#23949)
* Do not run model when skipping frames

* also prepare wide

* add logging

* remove newline

* small skip test

* more random

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-04-22 13:59:49 -07:00
Adeeb Shihadeh
27b067446a modeld tests (#24263) 2022-04-19 15:50:04 -07:00
George Hotz
40cf4a7498 Update SNPE to 1.61.0.3358 (#24253)
* update snpe to snpe-1.61.0.3358

* fix new snpe build

* fix snpe dir in files_tici

Co-authored-by: Comma Device <device@comma.ai>
2022-04-18 19:31:10 -07:00
Adeeb Shihadeh
5c48e7bc86 remove comma two support (#24248)
* remove comma two support

* cleanup release files

* little more

* more libs

* no more gralloc

* add snpe back
2022-04-18 17:55:23 -07:00
Gijs Koning
6dfdb04cb4 Remove visiontest files (#24219) 2022-04-15 09:54:05 -07:00
Lukas Petersson
65fca83abe Latency logging 2 (#24058)
* msg_order and gantt

* frameId in long/lat planner

* track frame id

* controls frame id

* graph tracked events

* graph json

* cloudlog timestamp

* c++ cloudlog

* add frame id

* bug fixes

* bug fixes

* frame id visionicp

* bug fixes and debug level

* timestamp log placement

* print timestamps in table

* translate events

* more logging

* bug fixes

* daemon boardd

* print logs with boardd

* more timestamp logs

* cleanup

* remove publish logs

* bug fix

* timestamp received

* timestamp received

* bug fixes

* use json lib

* ignore driver camera

* prep for new timestamp pipeline

* bug fix

* read new pipeline unfinnished

* read new pipeline

* bug fix

* add frame to controlsstate

* remove controlsstate

* print

* cleanup

* more cleanup + bug fix

* clock build issue

* remove unused imports

* format durations

* increase speed

* pr comments fixes

* conflicts

* set MANAGER_DAEMON for boardd

* clean script code

* bug fix + argparse

* remove rcv time

* bug fixes

* print without tabulate

* fix pre-commits

* plot gnatt

* color bug fix

* read without timestampextra

* bump panda

* mono time instead of frame id

* finnish script

* clean unused

* clean unused logging

* monotonic + json fixes

* del test

* remove whilelines

* bump laika

* cleanup

* remove deps

* logs nicer strings

* remove plotting from scirpt

* reset pipfile

* reset pipfile

* nicer strings

* bug fix

* bug fix

* pr comments cleaning

* remove plotting

* bug fix

* new demo route

* bump opendbc and panda

* cereal master

* cereal master

* script less komplex

* assertions

* matplotlib

* readme

* Update README.md

* graph html

* design fixes

* more code design

* Update common/logging_extra.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* whitespace

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update tools/latency_logger/latency_logger.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* pr comments

* bug fix

* readme + env once

* clean swaglog

* bug fix

* Update tools/latencylogger/README.md

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* revert

* revert

* clean swaglog with error

* remove typo file

* revert graph

* cereal

* submodules

* whitespaces

* update refs

Co-authored-by: Bruce Wayne <batman@workstation-openpilot2.internal>
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-04-05 21:05:45 -07:00
ZwX1616
de4031c98e DM: more precision running on DSP + e2e outputs (#23900)
* update cereal

* run but not use

* log distraction type

* regression scaling

* clean up naming

* add calib buf

* add to header

* fake model

* no calib model

* adjust threshs

* 018a305f

* fix bn

* tweak1

* tweak2

* 0ff2/666

* tweak3

* t4

* t5

* fix out of bound

* skip when replaying old segments

* update ref

* fix onnxmodel

* get calib

* update model replay refs

* up ref
2022-03-15 19:02:21 -07:00
George Hotz
5c5a56c5e6 thneed: a more sane way of doing record/debug (#23938)
Co-authored-by: Comma Device <device@comma.ai>
2022-03-10 16:33:35 -08:00
Willem Melching
492398826f modeld: sync based on frame timestamp (#23901)
* sync based on frame ts

* log extra frame id

* ints only

* update ref

* no rounding errors
2022-03-07 10:46:15 +01:00
George Hotz
8d6f49aecf model: mse err from 0.02-> 0.000056 (#23891)
* mse err from 0.028070712 -> 5.8073703e-05

* build with weights fixup

* need thneed lib also

* don't break for binaries

* static analysis says i need init

* check the bias

* load_dlc_weights

* nicer scons

* tested scons

* fix static

* pylint issue

* new ref

* a few more asserts

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
2022-03-02 20:52:17 -08:00
George Hotz
825c924c1c minor cleanups, fix non binary compile (#23882)
Co-authored-by: Comma Device <device@comma.ai>
2022-03-01 16:05:44 -08:00
Adeeb Shihadeh
8a19d9892e modeld: remove support for small model (#23803)
* modeld: remove support for small model

* use extra
2022-02-28 10:32:39 -08:00
Comma Device
83159a09bf THNEED_DEBUG env var support 2022-02-28 09:30:43 -08:00
HaraldSchafer
48154703a7 Fix tici bigmodel (#23817)
* Fix bigmodel on tici: cam intrinsics arent static

* Give TICI route own name for import

* Make function useable in offline test

* typo

* change tici ecam focal to trained focal

* No shadow variable

* Fixed ref

* Force update this time

* Update model replay ref commit
2022-02-21 19:57:04 -08:00
Comma Device
2b652605a0 thneed: a few asserts in the optimizer for cases it will fail 2022-02-21 12:08:52 -08:00
George Hotz
2c7542d34e Refactor convolutions (#23807)
* one conv with defines

* add conv

* building works on C3

* this is num_outputs too, process replay is so useful

Co-authored-by: Comma Device <device@comma.ai>
2022-02-20 11:55:23 -08:00
Willem Melching
85efde269d bigmodel (#23684)
* Added wide cam vipc client and bigmodel transform logic

* Added wide_frame to ModelState, should still work normally

* Refactored image input into addImage method, should still work normally

* Updated thneed/compile.cc

* Bigmodel, untested: 44f83118-b375-4d4c-ae12-2017124f0cf4/200

* Have to initialize extra buffer in SNPEModel

* Default paramater value in the wrong place I think

* Move USE_EXTRA to SConscript

* New model: 6c34d59a-acc3-4877-84bd-904c10745ba6/250

* move use extra check to runtime, not on C2

* this is always true

* more C2 checks

* log if frames are out of sync

* more logging on no frame

* store in pointer

* print sof

* add sync logic

* log based on sof difference as well

* keep both models

* less assumptions

* define above thneed

* typo

* simplify

* no need for second client is main is already wide

* more comments update

* no optional reference

* more logging to debug lags

* add to release files

* both defines

* New model: 6831a77f-2574-4bfb-8077-79b0972a2771/950

* Path offset no longer relevant

* Remove duplicate execute

* Moved bigmodel back to big_supercombo.dlc

* add wide vipc stream

* Tici must be tici

* Needs state too

* add wide cam support to model replay

* handle syncing better

* ugh, c2

* print that

* handle ecam lag

* skip first one

* so close

* update refs

Co-authored-by: mitchellgoffpc <mitchellgoffpc@gmail.com>
Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2022-02-19 16:06:31 -08:00
redacid95
1c9bf108af Snpemodel: Clean up after #23772 (#23780)
* #clean up snpemodel after #23772

* Leave benchmark remove loop
2022-02-16 09:40:32 -08:00
George Hotz
90beaebefb add thneed optimizer (#23772)
* add thneed optimizer

* local work group opt

* kernels and final mods

* release files

* build system touchups

* fix kernel path, rand inputs for self test

* broken since extra is gone

* update model replay ref

Co-authored-by: Comma Device <device@comma.ai>
2022-02-15 15:32:00 -08:00
Dean Lee
1fc1382480 posenet_publish: use const references (#23310) 2021-12-27 13:31:42 -08:00
Dean Lee
ffc2f64f19 modeld: update live calibration in main thread (#23235)
* update live calibration in main thread

* static ground_from_medmodel_frame

* more static

* cleanup

* no lambda

* trigger ci
2021-12-17 12:29:59 -08:00
Ewout ter Hoeven
55390d273f Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-12-16 14:58:17 +01:00
Dean Lee
7c4855a609 modeld: make valid variable thread safe (#23228) 2021-12-15 14:01:11 +01:00
Dean Lee
f20d53b15c driving.h: remove obsolete poly_fit function prototype (#23229) 2021-12-15 14:00:46 +01:00
Adeeb Shihadeh
fa62b9d3f9 modeld: start publishing before calib seen (#23190) 2021-12-14 17:04:40 -08:00
Dean Lee
13ad02bc06 commonmodel.h: move global model size into class ModelFrame (#23193)
* move to class ModelFrame

* remove defines in dmonitoring as well

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-12-13 14:58:21 +01:00
Dean Lee
9decd3d8a2 util: move all functions into util namespace (#23203) 2021-12-12 14:42:23 -08:00
Greg Hogan
40d2e4ec90 model output struct for metadata (#23139)
* model output struct for metadata

* better max element search

* ModelDataRawDesireProb.to_array()

* eliminate some copies

* not worth messing with softmax now

* remove unused includes

* more cleanup

* no longer pointers

* better variable name

* fix recurrent state

* improve variable name

* fix OUTPUT_SIZE and NET_OUTPUT_SIZE
2021-12-12 11:41:25 -08:00
Willem Melching
f93d89b888 dmonitoring/DriverView: get crop_rect & transform by video size (#23169)
* dmonitoring/DriverView: get crop_rect & transform by video size (#23014)

* keep rounding the same

Co-authored-by: Dean Lee <deanlee3@gmail.com>
2021-12-09 16:20:50 +01:00
Willem Melching
b5fdf646ff Revert "dmonitoring/DriverView: get crop_rect & transform by video size (#23014)"
This reverts commit 1af715d6a2.
2021-12-08 19:13:38 +01:00
Dean Lee
1af715d6a2 dmonitoring/DriverView: get crop_rect & transform by video size (#23014) 2021-12-08 17:51:56 +01:00
jimw
db9ea45cd5 PC: fix onnxruntime excessive CPU (#23051)
* onnxruntime-gpu two threads

* relock pipfile

Co-authored-by: jwolffe <wolffja@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-12-06 16:51:45 +01:00
grekiki
6951b3271d Python: Replace more lists with generators (#23116)
* Replace lists with generators v2

* Replace set with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Replace more set() with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-12-03 22:57:19 -08:00
Dean Lee
348d2d2b0d rename yuv streams (#23071)
* rename yuv streams

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-29 18:14:59 -08:00
Dean Lee
d97ad1302a moded/RunModel: fix possible memory leak without a virtual destructor (#22990) 2021-11-20 11:41:24 -08:00
ZwX1616
80940b9844 dmonitoringmodeld: fix black padding not black after libyuv.I420Scale (#22971)
* true black

* set black once

* move def

* add commnet

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-19 12:16:23 -08:00
Dean Lee
fe22a3563c driving.cc: const reference the return value of get_best_prediction (#22797) 2021-11-05 15:07:44 -07:00
Willem Melching
c2b95ca6a1 util.h has conflicting ioctl def on comma two 2021-11-04 16:46:38 +01:00
Dean Lee
177c3b89b6 thneed/serialize: use funtions from clutil(#22760) 2021-11-04 16:19:25 +01:00
Dean Lee
ff33ca3413 util: remove function to_hex (#22792) 2021-11-04 16:18:01 +01:00
Willem Melching
45c506bb17 wshadow: fix comma three build 2021-11-02 17:27:34 +01:00
Mayfield
5246f0231e enable wshadow (#22756)
* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-02 17:08:53 +01:00
Dean Lee
07ad6d7444 thneed: use util::read_file to read from the file (#22757) 2021-11-01 11:07:28 +01:00
Adeeb Shihadeh
5b331fd6f5 don't set core affinity on PC (#22706) 2021-10-26 21:51:46 -07:00
Greg Hogan
7bb13acc45 ModelDataRaw struct part 4 (#22673)
* convert model data for leads to struct

* make things more consistent

* change names with path to plan

* consistent use of plural
2021-10-25 16:46:09 -07:00
Greg Hogan
755a0a63a2 ModelDataRaw struct part 3 (#22639)
* lane lines and road edges

* roll back some changes to find what broke things

* rollback more changes to find issue

* fix order of lane line probs

* try outputs on stack again

* initialize output array
2021-10-21 14:59:07 -07:00
Greg Hogan
a7f36c9daf ModelDataRaw struct part 2 (#22554)
* model pose more struct

* constexpr seems useful

* more concise

* fix order

* seems more readable

* plan struct

* attempt to fix compiling on device

* fix constexpr errors on device

* fix rotation rate in log

* maybe this fixes compiling constexpr on device

* exp() cannot be used in constexpr on c2

* only copy what we actually log

* simplify pivot()

* fix setting position std

* see if this works

* try lambda again

* giving up on the lambda to select member

* fix position std

* fix param order
2021-10-19 19:04:01 -07:00
Adeeb Shihadeh
84de248fa7 tici: affine loggerd to efficiency cores (#22581) 2021-10-18 13:21:24 -07:00