Commit Graph

464 Commits

Author SHA1 Message Date
YassineYousfi
66a17a17b8 modeld: handle division by zero (#30411)
* modeld: avoid division by zero

* undefined at 0
old-commit-hash: 84d2fa68f7
2023-11-08 10:06:30 -08:00
Justin Newberry
3027a428cb Pytest: tici mark for skipping on-device tests (#30412)
* mark tici

* not those ones

* missed that one

* add those

* add pypoetry

* oops
old-commit-hash: aec7cea30d
2023-11-07 17:35:44 -08:00
Harald Schäfer
b91ecda350 Farmville model (#30392)
* slightly different

* Revert "slightly different"

This reverts commit 8a470ecab40c295f3b8c777b82cb7a22890d116e.

* d09c9c88-1797-4ed5-ab2d-9dca5b12340b/700

* Update power draw

* Revert "Update power draw"

This reverts commit 1c95b663ec9c507604dd8580ff6386497b5391a8.

* Update ref
old-commit-hash: 9118973ed0
2023-11-07 11:17:37 -08:00
Harald Schäfer
422a9289b6 Tinygrad: use compile2 (#30400)
* Tinygrad: use compile2

* unused

* compile2 file

* slightly different

* Revert "slightly different"

This reverts commit 8a470ecab40c295f3b8c777b82cb7a22890d116e.

* slightly different ref

* add release file

* rm default args
old-commit-hash: c9fae805bc
2023-11-07 09:54:48 -08:00
YassineYousfi
91751770a8 (New) Lemon Pie Model 🍋 (#30209)
* 6f6e3749-1b7c-42e8-a33b-03929b7fc476/700

* oops deleted too much

* 1b4308b7-a659-4ebd-b4c6-c81c1c3890f8/700

* 1be192f3-f407-4217-9757-78b9ad92750a/700

* remove some todos

* more cleanup in lat planner

* vego > min_speed

* regen and update process replay refs

* update model replay ref

* update model replay ref commit again

* Revert "update model replay ref commit again"

This reverts commit 922cb796b8dfe264b0cce7a18206bb898b18bcb3.

* update again

* bump cereal
old-commit-hash: 4c2bd853e4
2023-11-02 14:01:00 -07:00
mitchellgoffpc
e911cab412 Added sentry hooks for modeld
old-commit-hash: eecdaf9950
2023-10-25 21:37:54 -07:00
YassineYousfi
105a379a0c modeld: fix prev brake probs shapes (#30309)
old-commit-hash: 1802de3f01
2023-10-23 15:22:32 -07:00
YassineYousfi
8ea8f8710c modeld: send_raw_pred under a flag (#30298)
* modeld: SEND_RAW_PRED under a flag

* not twice
old-commit-hash: b7cc6983c3
2023-10-20 13:53:22 -07:00
YassineYousfi
d18f185115 modeld: parsing and publishing in python (#30273)
* WIP try modeld all in python

* fix plan

* add lane lines stds

* fix lane lines prob

* add lead prob

* add meta

* simplify plan parsing

* add hard brake pred

* add confidence

* fix desire state and desire pred

* check this file for now

* rm prints

* rm debug

* add todos

* add plan_t_idxs

* same as cpp

* removed cython

* add wfd width - rm cpp code

* add new files rm old files

* get metadata at compile time

* forgot this file

* now uses more CPU

* not used

* update readme

* lint

* copy this too

* simplify disengage probs

* update model replay ref commit

* update again

* confidence: remove if statemens

* use publish_state.enqueue

* Revert "use publish_state.enqueue"

This reverts commit d8807c8348338a1f773a8de00fd796abb8181404.

* confidence: better shape defs

* use ModelConstants class

* fix confidence

* Parser

* slightly more power too

* no inline ifs :(

* confidence: just use if statements
old-commit-hash: cad17b1255
2023-10-19 14:23:51 -07:00
George Hotz
2b5ad3fe86 Bump tinygrad to master (0.7) (#30254)
* bump tinygrad to master

* ops_cpu is required now

* and that one too

* tinygrad is getting out of hand with all the files

* bump tinygrad

* update ref commit

* tinygrad master

* Revert "update ref commit"

This reverts commit e7284152899d6dd8a986d9570e6021addfbc6b0f.

* bump tinygrad repo

* bump master

* update ref commit
old-commit-hash: 50d720fc2e
2023-10-17 10:05:28 -07:00
Kacper Rączy
5d0e7e9373 modeld: don't attempt to connect extra vipc client if its not available (#30154)
Do not connect extra client if it's not available
old-commit-hash: 5cb9291de8
2023-10-03 15:54:21 -07:00
Harald Schäfer
dd8a904c5b Night Strike Model (#30148)
* baab2a46-f0c3-46eb-8756-00c55354945b/700

* Update model replay ref
old-commit-hash: 3c0a7d6986
2023-10-03 14:25:30 -07:00
YassineYousfi
a3f3e0c122 onnxmodel: fp16_to_fp32 (#30080)
* onnxmodel: force fp32

* rename

* rename this too
old-commit-hash: 04e239f7ed
2023-09-27 22:37:03 -07:00
Adeeb Shihadeh
03c4bdc0be Revert "modeld: remove extra cloudlog.bind, manager does this"
This reverts commit d99afd438be153166affb99ce366c537d977ba47.

old-commit-hash: 362c0bf2ca
2023-09-21 20:13:13 -07:00
Adeeb Shihadeh
f0a8853060 modeld: remove extra cloudlog.bind, manager does this
old-commit-hash: 754af893e9
2023-09-21 20:06:46 -07:00
Harald Schäfer
3f1086c410 Optimus Prime Model 🤖 (#29752)
* b449f295-7e40-4f97-96a6-d858815955e5/700

* make it compile b449f295-7e40-4f97-96a6-d858815955e5/700

* simpler - b449f295-7e40-4f97-96a6-d858815955e5/700

* feature_len changed

* 0a833ab4-9fc7-4e51-a686-9bce3eafcb91/700

* Revert "0a833ab4-9fc7-4e51-a686-9bce3eafcb91/700"

This reverts commit 41708b88447cfcf302b16f21f0caa69450bbd3df.

* 0a833ab4-9fc7-4e51-a686-9bce3eafcb91/700 again

* Update ref

* update ref

---------

Co-authored-by: Yassine <yassine.y10@gmail.com>
old-commit-hash: 3799fe46b3
2023-09-21 13:51:12 -07:00
Harald Schäfer
5bb0112fdd Test modeld: 3s enough for modeld startup (#29936)
* Test modeld: 3s enough for modeld startup

* Always fails when you send frames before modeld is ready

* Wait for modeld to read
old-commit-hash: ef50b4fdac
2023-09-15 14:59:46 -07:00
Mitchell Goff
3e1903a6cb Converted onnx runner to python (#29856)
old-commit-hash: 9cc00c2101
2023-09-08 16:45:38 -07:00
Mitchell Goff
65fc9f14b3 Update model input names to match onnx inputs (#29855)
Updated model input names to match onnx inputs
old-commit-hash: 2d69f3d63e
2023-09-08 16:06:16 -07:00
Mitchell Goff
5732002296 Rewrite dmonitoringmodeld in python (#29740)
* Added dmonitoringmodeld.py

* Removed dmonitoringmodeld.cc

* Use ModelRunner helpers from runners/__init__.py

* Fixed DriverStateResult field ordering

* Some bug fixes

* Set calib input

* Look ma, no loop!

* Bump dmonitoringmodeld cpu usage in test_onroad

* Fixed memory leak caused by np.ctypes.data_as

* Formatting fixes

* chmod +x

* remove USE_ONNX_MODEL

* Realtime priority 1, formatting fixes
old-commit-hash: 503fa121ee
2023-09-07 19:46:43 -07:00
Mitchell Goff
f9daa1d1cc Rewrite navmodeld in python (#29579)
* Added navmodeld.py

* Deleted navmodeld.cc

* Write SConscript config flags to config.py

* Remove deleted files from release/files_common

* Some more bug fixes

* Added config.py to gitignore

* Get rid of config.py

* Use set_realtime_priority

* A tiny bit more cleanup

* set realtime priority 1

* Use ModelRunner helper class from runners/__init__.py

* Formatting fixes

* mama mia that's a SPICY memory leak
old-commit-hash: 0c0af682a1
2023-09-07 14:39:37 -07:00
mitchellgoffpc
459e4fdb50 Added cython bindings for commonmodel sigmoid
old-commit-hash: 05993f50df
2023-08-31 19:40:53 -07:00
Mitchell Goff
cd7d73eaf8 Added ModelRunner helpers in modeld/runners/__init__.py (#29737)
* Added ModelRunner helper class

* import Runtime in __init__.py
old-commit-hash: d5a55136a1
2023-08-31 14:19:20 -07:00
mitchellgoffpc
aca5580900 Move Runtime into runmodel_pyx
old-commit-hash: f91e955a86
2023-08-31 13:51:50 -07:00
mitchellgoffpc
e9c82290c0 Remove unnecessary hardware check in modeld
old-commit-hash: 857f747467
2023-08-31 13:51:49 -07:00
mitchellgoffpc
51066175f5 Set ADSP_LIBRARY_PATH in snpemodel_pyx
old-commit-hash: 18526c58b6
2023-08-31 13:11:39 -07:00
mitchellgoffpc
83745ad42f Set RPATH for snpemodel
old-commit-hash: aebff37593
2023-08-31 11:33:42 -07:00
Mitchell Goff
52901d2a20 Cleaned up modeld SConscript (#29646)
old-commit-hash: 88a36f4464
2023-08-30 15:29:33 -07:00
Mitchell Goff
fa770f1ccc Combine update_calibration/get_warp_matrix (#29719)
old-commit-hash: 151ac4bf76
2023-08-30 15:16:29 -07:00
Mitchell Goff
54988e457f Move update_calibration to modeld.py (#29688)
* Move update_calibration to modeld.py

* Updated ref commit
old-commit-hash: 1eb60516cb
2023-08-30 14:12:52 -07:00
mitchellgoffpc
16a3f0f67f -DUSE_THNEED is dead
old-commit-hash: 12d1020239
2023-08-30 12:58:31 -07:00
Mitchell Goff
c4ae1fae5a Added USE_THNEED environment variable and removed build flag (#29645)
old-commit-hash: d998fd88a8
2023-08-29 14:07:57 -07:00
mitchellgoffpc
fdaee85b1e Remove no-thneed build flag
old-commit-hash: 807410e0ac
2023-08-25 19:09:25 -07:00
mitchellgoffpc
e9e98abe89 Remove USE_THNEED check from run.h
old-commit-hash: e0287fa93e
2023-08-25 19:05:49 -07:00
Kacper Rączy
d254137f4c modeld: fix bash scripts (#29643)
Fix shebang. Fix LD_PRELOAD
old-commit-hash: a4a0429fca
2023-08-25 18:56:06 -07:00
mitchellgoffpc
68e2c74cd3 Remove thneed logic from snpemodel
old-commit-hash: ef8e0fef55
2023-08-25 14:37:08 -07:00
Mitchell Goff
a3fbbb26ac Rewrite modeld in python (#29230)
* Added modeld.py (WIP)

* No more VisionIpcBufExtra

* Started work on cython bindings for runmodel

* Got ONNXModel cython bindings mostly working, added ModelFrame bindings

* Got modeld main loop running without model eval

* Move everything into ModelState

* Doesn't crash!

* Moved ModelState into modeld.py

* Added driving_pyx

* Added cython bindings for message generation

* Moved CLContext definition to visionipc.pxd

* *facepalm*

* Move cl_pyx into commonmodel_pyx

* Split out ONNXModel into a subclass of RunModel

* Added snpemodel/thneedmodel bindings

* Removed modeld.cc

* Fixed scons for macOS

* Fixed sconscript

* Added flag for thneedmodel

* paths are now relative to openpilot root dir

* Set cl kernel paths in SConscript

* Set LD_PRELOAD=libthneed.so to fix ioctl interception

* Run from root dir

* A few more fixes

* A few more minor fixes

* Use C update_calibration for now to exactly match refs

* Add nav_instructions input

* Link driving_pyx.pyx with transformations

* Checked python FirstOrderFilter against C++ FirstOrderFilter

* Set process name to fix test_onroad

* Revert changes to onnxmodel.cc

* Fixed bad onnx_runner.py path in onnxmodel.cc

* Import all constants from driving.h

* logging -> cloudlog

* pylint import-error suppressions no longer needed?

* Loop in SConscript

* Added parens

* Bump modeld cpu usage in test_onroad

* Get rid of use_nav

* use config_realtime_process

* error message from ioctl sniffer was messing up pyenv

* cast distance_idx to int

* Removed cloudlog.infos in model.run

* Fixed rebase conflicts

* Clean up driving.pxd/pyx

* Fixed linter error
old-commit-hash: 72a3c987c0
2023-08-25 14:36:26 -07:00
Mitchell Goff
5033da5e27 Added cython bindings for model runners and commonmodel (#29607)
* Added cython bindings for model runners and commonmodel

* Removed cython language_level=3

* loop to set CXXFLAGS for both envs
old-commit-hash: e2e39d100b
2023-08-24 17:00:26 -07:00
Justin Newberry
c4f322ce2d Linter: remove pylint (#29611)
remove pylint
old-commit-hash: 1ee6ed4b16
2023-08-24 16:30:54 -07:00
mitchellgoffpc
01e73c76f8 Moved thneed src to top of modeld sconscript
old-commit-hash: 7dae580441
2023-08-24 15:12:01 -07:00
mitchellgoffpc
c4bb5bbf04 Some cleanup in modeld sconscript
old-commit-hash: fc8c97e7a9
2023-08-24 14:41:04 -07:00
mitchellgoffpc
0126d840f3 Disable error message in thneed ioctl interceptor to fix pyenv issues
old-commit-hash: a184d40b7a
2023-08-24 14:41:04 -07:00
Dean Lee
de809632bf cpplint: add filter whitespace/comma (#29595)
old-commit-hash: 7bfd3dac81
2023-08-24 10:42:06 -07:00
Dean Lee
228d30d5a9 cpplint: add filter whitespace/tab (#29588)
old-commit-hash: 9c7bf50703
2023-08-24 08:06:58 -07:00
Dean Lee
0984736972 cpplint: add filter build/include_subdir (#29585)
old-commit-hash: 21da5a216f
2023-08-24 15:42:17 +01:00
Dean Lee
5f4b422305 cpplint: add filter whitespace/semicolon (#29568)
old-commit-hash: f203648de0
2023-08-23 15:00:30 -07:00
Dean Lee
db211ce617 cpplint: add filter whitespace/parens (#29565)
old-commit-hash: 5480d32bb5
2023-08-23 14:25:05 -07:00
Dean Lee
97e9d55588 cpplint: build/include_what_you_use (#29556)
* include_what_you_use

* remove comments

* include <memory>

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 2d99521e75
2023-08-23 13:25:17 -07:00
mitchellgoffpc
8a1e4d8575 Set paths for cl kernels and onnx_runner.py in modeld SConscript
old-commit-hash: 7699444816
2023-08-21 19:38:40 -07:00
mitchellgoffpc
b1a10e45d1 Move USE_RUNTIME flags into runmodel.h
old-commit-hash: 24090d2121
2023-08-21 19:26:48 -07:00