Commit Graph

224 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Dean Lee
de809632bf cpplint: add filter whitespace/comma (#29595)
old-commit-hash: 7bfd3dac81
2023-08-24 10:42:06 -07:00
Dean Lee
db211ce617 cpplint: add filter whitespace/parens (#29565)
old-commit-hash: 5480d32bb5
2023-08-23 14:25:05 -07:00
Mitchell Goff
e6e19f8d3e Non-Inflatable Model 🎈 (#29003)
* Added all maneuvers to navInstruction message

* Added nav instruction logic to modeld

* New model: fcee01c1-96bb-414f-b00d-e4a994a00922/700

* Fixed bug in navd

* Added sharp/slight modifiers

* Updated refs
old-commit-hash: c04e5d12fc
2023-08-09 19:56:45 -07:00
Mitchell Goff
181e9775f7 Clean up model_publish args to simplify cython bindings (#29203)
* Clean up model_publish args to simplify cython bindings

* pass by reference

* Move FCW and model confidence queues into PublishState
old-commit-hash: 663fc0d8fe
2023-08-01 19:23:18 -07:00
Nima Khodaveisi
8fdb381e42 dmmonitoringmodeld: remove unused libyuv import (#29180)
old-commit-hash: 24c7b044de
2023-07-31 13:23:13 -07:00
YassineYousfi
af69774431 models/README: DM input is only luma (#29188)
dm input = only luma
old-commit-hash: 14e524d52b
2023-07-31 12:57:22 -07:00
Dean Lee
46d64e90e6 dmonitoring: use sizeof(float) instead of hardcorded size (#28963)
old-commit-hash: 8dcd92253b
2023-07-15 10:30:50 -07:00
Mitchell Goff
a0d705d113 nav model: fix flicker in nav enabled state (#28815)
* Fix flicker in nav enabled state

* Move all relevant information for validity checks into navModel packet

* Ignore locationMonoTime in replay tests

* Check route valid in navmodeld

* sm update

* check that

* update refs

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: e346839c68
2023-07-09 15:10:02 -07:00
Mitchell Goff
95051090a1 Refactor model runners (#28598)
* Started work on model runner refactor

* Fixed some compile errors

* everything compiles

* Fixed bug in SNPEModel

* updateInput -> setInputBuffer

* I understand nothing

* whoops lol

* use std::string instead of char*

* Move common logic into RunModel

* formatting fix
old-commit-hash: c9f00678af
2023-07-06 22:26:11 -07:00
Mitchell Goff
d663b5843e Moonrise Model (#28761)
* New model: 889463fc-5e5d-497d-9111-c8567a13cabf

* Updated model replay ref
old-commit-hash: 531c13f2ac
2023-06-30 18:52:20 -07:00
ZwX1616
6e547a2748 Modeld: send confidence class (#28625)
* 0.7

* magic

* faster magic

* more simple

* up

* empty

* more mid bits

* naive

* flatten

* dz

* that can stay

* this is fine

* what the

* what the

* giRevert "what the"

This reverts commit 1619ba68e6098dc581fe9b82e7ecb74562b619cc.

* Revert "what the"

This reverts commit 0037dd368290497a6d0009ca34adb2184b584d2e.

* 1x fine

* that was fine

* combined

* independent cum

* 0 is fine

* use metrics

* up cereal

* process and publish from modeld

* cleanup

* use s.output

* bg

* a greener approach

* dns

* serial

* update ref commit

* rebase

* ref

* cereal master

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: ce2dffe566
2023-06-23 16:49:14 -07:00
Mitchell Goff
4ad967f963 Publish navEnabled from modeld (#28647)
* Publish navEnabled from modeld

* Bump cereal
old-commit-hash: 4c2c73b152
2023-06-22 19:39:51 -07:00
Mitchell Goff
429a638740 New map model: 917a2539-5e7a-4374-878a-9b356f0f1922/500 (#28579)
old-commit-hash: a9cb255017
2023-06-16 19:31:57 -07:00
YassineYousfi
990624c07e Nicolas Cage Model (#28547)
01697194-d32d-4c3a-a803-d8f61cdf24e9/449 2ff8e6a1-7efd-4984-9f29-974164a3747b/700
old-commit-hash: 4fcd82076a
2023-06-16 13:36:56 -07:00
YassineYousfi
4de14c1130 hot coffee model (#28296)
* 1061b1c7-b944-43e3-a940-b56b64d66f54/700

* bump cereal

* bump cereal

* make mypy happy

* write TODO

* read height from written params

* fix certain_if_calib logic and unit tests

* factor moving_avg_with_linear_decay

* remove whitespace

* update model ref commit

* default value for CI

* update process replay ref commit

* update process replay ref commit

* update process replay ref commit

* bump cereal
old-commit-hash: 7925232a34
2023-06-02 20:55:13 -07:00
Mitchell Goff
22c5053bbc Nicki Minaj Model (#28218)
* New model: 2ff7490f-8a2f-4c0d-87a8-b0fa3a4a6a71

* Updated model_replay_ref_commit
old-commit-hash: 328b5d9d47
2023-05-22 15:11:04 -07:00
YassineYousfi
3c001d5c89 update dm model README (#28238)
add calib dm input in readme
old-commit-hash: bda0d6ac77
2023-05-19 15:20:43 -07:00
YassineYousfi
53b93550c7 update DM model README (#28211)
* update DM model readme

* rename + permalink + correct types and ranges
old-commit-hash: 2d4558d5cf
2023-05-16 13:40:49 -07:00
YassineYousfi
fa6e10b739 new model: trained with augmented turn desire pulses (#28063)
* df733db3-fad2-4485-abe9-59a6a47f2233/449 85f20e13-dd4d-49a8-ba33-98e6afc161d9/700

* update ref commit
old-commit-hash: f80c1087fc
2023-05-01 16:03:16 -07:00
YassineYousfi
cde221ba7c new model: trained on new dataset (#27637)
* df733db3-fad2-4485-abe9-59a6a47f2233/449 946c0f55-247d-4790-a407-c07e4364b340/700

* fix reducel2 df733db3-fad2-4485-abe9-59a6a47f2233/449 946c0f55-247d-4790-a407-c07e4364b340/700

* update ref commit
old-commit-hash: 26541d9e7a
2023-03-22 20:19:46 -07:00
YassineYousfi
0716a1250b update modeld/models readme (#27564)
* update readme with new model design

* typo

* space
old-commit-hash: e146bb1a96
2023-03-11 16:26:39 -08:00
Harald Schäfer
0ac73f2a81 MPC path in UI (#27380)
* 10s lat

* Full length MPC

* redfine N

* Leave controls the same for now

* Updates

* use long plan in lat plan

* interp plan

* simplergit add selfdrive/controls/plannerd.py selfdrive/controls/

* expand to 10s

* revert this

* fix linter

* vizualize

* fix long test

* typo

* cleanup

* compiles

* unused

* unused

* bump cereal

* bump cereal

* use model if no uiplanm

* update replay

* update ref commit

* bump cereal to master
old-commit-hash: eb8bdc0026
2023-02-17 19:58:30 -08:00
YassineYousfi
542e915982 new model: improved height estimation (#27234)
* 07a3a2b2-6dbe-43c3-9bb9-a8023932e054/449 c3d7d18a-6207-42e7-84d9-601ecb3c6f0e/700

* 07a3a2b2-6dbe-43c3-9bb9-a8023932e054/449 db92e7f3-3f4b-4f0f-95ff-76cb6ed6894a/700

* update ref commit
old-commit-hash: 1e49c54ffb
2023-02-08 22:21:31 -08:00
YassineYousfi
452031fcc7 new model: fixed weight decay logic (#27068)
* 07a3a2b2-6dbe-43c3-9bb9-a8023932e054/449 cdfa9e3c-2807-49fc-bdc7-a985f8ff1644/700

* update refs
old-commit-hash: 7316cd03fb
2023-01-26 19:09:12 -08:00
Harald Schäfer
f315819d47 Navmodel and driving style: update runner (#26762)
* Navmodel and driving style: update runner

* No driving style yet

* thneedrunner without extra inputs

* nav feature ref
old-commit-hash: 160c9ba1d2
2022-12-11 15:25:36 -08:00
Mitchell Goff
46f70592ae navmodeld (#26665)
* Added navmodeld

* New nav model: 7c306685-5476-4bd4-ab65-105b01b6bca8/300, feats only

* little cleanup

* Remove NAV flag

* Moved to_kj_array_ptr to commonmodel.h

* Switch from decimation to last_frame_id check

* add to release files

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: bb8a38a050
2022-12-02 13:14:30 -08:00
YassineYousfi
30414a7305 Revert "Albert Einstein Model" (#26576)
Revert "Albert Einstein Model (#26456)"

This reverts commit 0129c20611bd21fb5b94d19b96d435c7e02041f1.
old-commit-hash: ceb94f1bcd
2022-11-22 11:41:22 -08:00
YassineYousfi
5bb8ff4a90 Albert Einstein Model (#26456)
* d0bc247d-9529-4e50-a5dd-95a8a5733874/440 38fb1ce9-18d7-4292-9ffd-678f8483ebf4/700

* update model replay ref commit
old-commit-hash: 34c80a6fbd
2022-11-18 17:50:24 -08:00
Harald Schäfer
f86b44d516 E2e long model: calibrate model speed to wheel speed (#26395)
* calibrate!

* Fix test

* Fix proc replay

* check len

* get v_ego from model 8501d20-bb59-4193-aa82-82b2737dedd6/449 609d90f3-65e6-4617-a60c-d6d99eead408/700

* bump cereal

* initialize v_model_error

* typo

* better names

* cleanup

* bump cereal

* update model replay ref commit

* bump to cereal master

Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
old-commit-hash: f63f0de80a
2022-11-07 17:49:36 -08:00
YassineYousfi
eafe85c1eb Model trained with headlight augmentation (#26284)
* d8501d20-bb59-4193-aa82-82b2737dedd6/449 ddfe2a22-fb0e-4ff0-a97f-0157b95eb44d/700

* update ref
old-commit-hash: c3388d216c
2022-10-30 23:55:48 -07:00
HaraldSchafer
4b0d7997ac Model trained with more long noise (#26241)
* d8501d20-bb59-4193-aa82-82b2737dedd6/449 d37d320d-7d78-479a-9be2-d58c75284307/700

* Update model ref
old-commit-hash: 2b7290a142
2022-10-26 00:20:30 -07:00
HaraldSchafer
e7d3c730b6 Modeld: Add comment (#26188)
Rename and add comment
old-commit-hash: 0edbbdeaf9
2022-10-21 11:20:52 -07:00
HaraldSchafer
bcb1ba7bfe Wide transform model (#26165)
* d8501d20-bb59-4193-aa82-82b2737dedd6/449 f78009d1-2184-4136-9fbc-1c5de55d460d/700

* Change model outs

* Add cereal

* Publish transform

* d8501d20-bb59-4193-aa82-82b2737dedd6/449 f78009d1-2184-4136-9fbc-1c5de55d460d/700

* Bump cereal to master

* Bump cereal to master

* Update model ref
old-commit-hash: d25ab3e366
2022-10-21 01:29:58 -07:00
Bruce Wayne
b15ff51d59 Revert "d8501d20-bb59-4193-aa82-82b2737dedd6/449 f78009d1-2184-4136-9fbc-1c5de55d460d/700"
This reverts commit 762b554862395cf7d9c7475fae4801a8e0733980.

old-commit-hash: 3a50d5fd85
2022-10-21 00:32:34 -07:00
Bruce Wayne
a325c8ca1e d8501d20-bb59-4193-aa82-82b2737dedd6/449 f78009d1-2184-4136-9fbc-1c5de55d460d/700
old-commit-hash: 0ac12b82c7
2022-10-21 00:24:11 -07:00
YassineYousfi
4323014a2b desire: give the pulse at t=0 (#26180)
input desire at t0
old-commit-hash: 6b36f73870
2022-10-20 15:13:58 -07:00
ZwX1616
426286f24f DM: add use of e2e preds (#26078)
* try ml

* de56

* j914ef75a

* jd1124586

* jd1124586

* d112

* oops

* set

* update ref

* use offset

* bump DM power usage

* new ref
old-commit-hash: d522492ba0
2022-10-17 19:40:06 -07:00
HaraldSchafer
f428c9de30 Refactor model: no klblock (#26035)
* ff138dc0-d097-4818-b40e-dba5ba89d5d6/449 13274b7d-b546-4b91-a587-33b4af7dec6a/700

* b1bb39be-c6ce-4744-8e63-92969fda6bfc/449 f3ebfba1-f686-448f-be9b-b4d5010be91c/700

* model ref

Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
old-commit-hash: b654ebdd25
2022-10-15 20:04:35 -07:00
YassineYousfi
523ad86756 faster rocket launcher model (#26009)
* cache tokens 1456d261-d232-4654-8885-4d9fde883894/440 e63ab895-2222-4abd-a9a5-af86bb70e260/700

* udpate ref commit

* bump tinygrad to master
old-commit-hash: 6c5693e965
2022-10-07 17:22:42 -07:00
HaraldSchafer
a8ec6f4cfd Rocket Launcher Model (#25963)
* 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/300

* compute only 9 tokens: 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/300

* tinygrad: cleanup gather

* 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/700

* empty commit for tests

* bump tinygrad

* dont use tinygrad matmul for now

* bump tinygrad

* 1456d261-d232-4654-8885-4d9fde883894/440 e63ab895-2222-4abd-a9a5-af86bb70e260/700

* float16 1456d261-d232-4654-8885-4d9fde883894/440 e63ab895-2222-4abd-a9a5-af86bb70e260/700

* increase steer rate cost

* Revert "increase steer rate cost"

This reverts commit 74ce9ab9be7ef17ecfec931f96851b12f37f2336.

* fork tinygrad

* empty commit for tests

* basics

* Kinda works

* new lat

* new tuning

* Move LATMPCN so scons compiles

* Update long weights

* Add tinygrad optim

* Update model ref

* update weights

* Update ref

* Try

* Error message for field ignore

* update model regf

* ref commit

* Fix onnx test

Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
old-commit-hash: cb0b7375b7
2022-10-05 21:43:38 -07:00