* Reapply "modeld: split warp" (#38085)
This reverts commit d489dd8909.
* don't time make_random_inputs
* depend on chunk targets
* also depend on compile_modeld's dependencies
* zero ll patched big model
* probe in a subprocess so usbgpu lock gets released
* compiles
* runs
* num_jobs gets overwritten, use side effect
* poll tg devices
* make sure build crashes on missing gpu
* fine not to rely on Device.default
* seperate tg env for each model runner
* comment
* Revert "seperate tg env for each model runner"
This reverts commit f6470cc4258eaeb3e8e37907ef370871c9af5aa4.
* env is shared, gate on flag
* no fallback warp dev must be set
* build for current device only, unless pc/release
* comment
* list
* listen for plug in
* add icon to status bar, read params on every frame (?)
* log available devices
* try copy out when loading?
* Revert "log available devices"
This reverts commit e8c52a5d59456d4820ecb13b99a6c46ea1386a20.
* Revert "try copy out when loading?"
This reverts commit 518f403aa03faeda1950fe3dbce0d9e4c1584455.
* don't trigger device probe/caching on modeld prepare
* re-export with ll and road edges
* dont cache devices in manager process
* get USBGPU from params
* no usbgpu env
* missed one
* sconscript don't poll
* unconditional env
* always explicitely set devices on input tensors
* set DEV so amd uses right compiler and iface??
* fix flag
* bump tg
* rm xdg_cache_home
* tg don't bump all the way
* missing gmmu=0 at compile time
* dm set dev
* tg backend
* update gitignore
* missing import
* unused imports
* rely on Device.DEFAULT at compile time (already the case bc onnxrunner)
* comments
* dm warp needs DEV set too
* build both smol and big
* misc typos
* set dev at compile time
* don't need
* DEV=CPU when getting metadata, ensure we don't grab gpu lock
* this would also grab lock
* put bool
* warp compile always prepare only
* missed one
* poll ui
* missing here
* don't force usbgpu at build time
* tmp patch fetch_fw
* catch all, follow hardwared patterns
* simpler
* compile make input queues
* revert this
* group this more readable
* rm empty line
* make dummy frame using numpy
* revert compile make input queues
* no compiler at runtime
* cleanup
* fine to rebuild all on change to device node for now
* fix usbgpu_present
* fix sconscript
* no size in header stream decompress
* DEBUG=2
* minimal viable feedback
* egpu gray
* oops
* gotta do this actually
* modeld build only depends on modeld devices
* don't ship onnx to release? or chunk
* don't need
* can only set compiler on dev=
* none device works, will use default
* make linter happy
* chunk agnostic onnx input to compile_modeld
* chunk big onnx
* +x chunker
* fix #!
* and don't ship chunked onnx to release
* firmware now in correct location
* better err on missing onnx/chunk
* SConscript also need to accept chunked onnx
* metadata also need to load maybe chunked
* dedupe cmd
* this needs to be on cpu
* devices are set in the tgflags, we already depend on them
* rebuilding on changed order is fine
* read file chunked can already load either chunked or not
* chunk all big onnx
* less confusing
* unused import
* python device to load onnx bytes
* default device for runners, python for metadata
* why not
* chunked to shm
* compile_modeld.py
* update estimates
* missing image=2?
* Revert "missing image=2?"
This reverts commit 2f5952eb63ba1e3f24cbf5769e6b5e9170d7f0a6.
* Revert "update estimates"
This reverts commit 1f72feef2ffdec6126e3c941e899b46ace7b4b65.
* Revert "compile_modeld.py"
This reverts commit f10541502efca02725f368deda2a21d1f786f57d.
* load warp in ModelState init
* dead code
* prep
* compile modeld
* update SConscript
* tmp save plot locally
* Revert "tmp save plot locally"
This reverts commit ec22f15161ad3b0241a097546b35860f989219f5.
* openpilot hacks?
* no float16
* tmp more chunks
* Revert "tmp more chunks"
This reverts commit 9e1d9b4d0dc36ff530d2a70b565fbfabd7afb00d.
* Revert "no float16"
This reverts commit 6204956e98e3c0818ed1985ede8eeccb810f63e3.
* realize boundaries
* Revert "realize boundaries"
This reverts commit ffaa19259eba70944e7793e8f51a0f87089531b3.
* prune=False?
* Reapply "tmp more chunks"
This reverts commit 2599c41cea93b4a6b4e946cdffc6a617663a7d23.
* tg bug?
* load first?
* Revert "load first?"
This reverts commit f643d082d76a424b23295e254179eb111e936e61.
* revert
* Reapply "tmp save plot locally"
This reverts commit 1b95b82ee58654bd908b1cb04ab0ddbcd1a5955d.
* 0 tol pc
* warp -> modeld
* rename
* bypass chunking?
* dont chunk
* Revert "dont chunk"
This reverts commit cc97fc67b3203456e123f02babe5c83b87c7e264.
* dont chunk
* debug
* Revert "debug"
This reverts commit b3c2f2e7a095fd32f8d8562a68fd1cca42357eac.
* Revert "dont chunk"
This reverts commit 42bd9b6f6ad0722c50348ba11ba7e2a64fdf997d.
* Revert "bypass chunking?"
This reverts commit ad5422a93483ffd8a59ba62e5fb72ced3b5d04d0.
* corrupt model outputs
* Revert "corrupt model outputs"
This reverts commit 245feb94480e02f83a20b65a9488652bcbfc88b0.
* image=0 for warp, match master
* dedupe enqueue
* pass traffic convention
* tg buffer for desire
* dedupe buffer creation
* compile_modeld: nuke stale cached pkl before compiling
The UNSAFE CI checkout keeps gitignored files (.pkl, .sconsign.dblite),
so stale pkl files from previous commits can persist and be reused
instead of being recompiled. Delete them explicitly before compiling.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test vs compile
* all outputs need to be different on different inputs
* randomize numpy inputs
* randomize on every step
* SConscript: nuke stale pkl+chunks before compile_modeld
Move the stale artifact cleanup from compile_modeld.py into the
SConscript build command. This ensures stale gitignored pkl and chunk
files are deleted even if scons decides to skip the compile step
(due to a stale .sconsign.dblite from UNSAFE CI checkout).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* compile_modeld: restore Context(IMAGE=0) for warp
The warp operations must run under IMAGE=0 to avoid QCOM image texture
optimizations that corrupt the output buffer after ~33 frames.
This was accidentally commented out in a855173.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* modeld: create SubMaster before model loading
Move PubMaster/SubMaster creation before the model loading step.
During model loading (3.5s+), process_replay may send liveCalibration.
If SubMaster doesn't exist yet, the message is dropped and the warp
transform stays as zeros, producing garbage warped images.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Revert "modeld: create SubMaster before model loading"
This reverts commit 968c987c2fbb3fce141c4e345d10ddea559b6c50.
* stale metadata?
* claude debug
* Revert "claude debug"
This reverts commit 49e754c6affa45a8ea8834588a00227b8090b17a.
* Revert "stale metadata?"
This reverts commit 870388513c0d4a67dcf970cd277b6db56cb2b478.
* modeld: realize jit outputs before parsing
* Update modeld.py
* modeld: fix NameError by removing redundant MODELS_DIR definition
* test buffers in test vs. compile
* 2x inputs before running
* fixup 2x inputs test
* realize onnx weights?
* Revert "realize onnx weights?"
This reverts commit 49c8b9a505db38ff22f342db011a3a6b6526d398.
* move openpilot_hacks flag to sconscript
* stricter test vs compile
* correct timings
* more run more fail?
* Revert "more run more fail?"
This reverts commit 9e94bb63940751ec29e81b634c42449113e1f2e5.
* numpy shenanigans
* correct shapes
* dont assert timings for now
* Revert "correct shapes"
This reverts commit 5b9ff6c84c0022327d21801d179e9e51c39e8f78.
* Revert "numpy shenanigans"
This reverts commit b4f6fb3078d7e9b09698895b88728fd8eea8c8a8.
* no need to nuke
* comment unused
* don't use NPY device
* copy instead of from_blob
* to device before jit
* Revert "to device before jit"
This reverts commit 7a59ed9b1ac88657b5a3917986b6ff92e59a2ee3.
* Revert "copy instead of from_blob"
This reverts commit 196c4892a06ffba89ef631876372cecf137cc1b4.
* Revert "don't use NPY device"
This reverts commit 18abf43bbac46ad47a60c03dd8d1ef40b3f59227.
* 3 runs is enough
* no_memory_planner=1
* lint
* restore model_replay.py
* on policy -> policy
* unused
* prepare only enqueues full images
* warp with image=2?
* unused args
* test vs compile, check different inputs different outputs
* avoid uop cache collision
* dont need realize here
* misc
* input queues diverged
* strict zip
* monkey patch for now
* memory planner
* prev desire correct order
* dedupe pkl paths / compile targets
* don't change behavior, warp and enqueue frames when skipping model eval
* actually prepare only
* warm up warp jit
* correct path
* oops
* explicit warmup
* need continuous + can't have dupplicate jit inputs
* whitespace
* bufs -> input_queues
* master tg
* /N_RUNS
* bump tg, remove uop cache patch
* more readable
* Revert "bump tg, remove uop cache patch"
This reverts commit 499acca2591becd389de4025943f9e776a5b337c.
* missing dep
---------
Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Revert "OP model 7 (#37760)"
This reverts commit 052692b25d.
* Revert "OP model (#37740)"
This reverts commit cb32793300.
* dead
* parse_model_outputs: drop extra space
* bump tg
* bump tg
* assign
* bump
* cpu llvm
* frame buffer updated in place, no need to return
* don't bake in stale pointers
* fix update image output indices
* lint
* bump
* modeld: quiet do_chunk output during scons build
SCons default-prints Python function actions with all their args.
The do_chunk function has 1259 tinygrad source files as deps, causing
a wall of text during builds. Wrap in SAction with a short strfunction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* split compile and chunk into separate Commands
cleaner fix: do_chunk only depends on the pkl, not tinygrad files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Chunk tinygrad pkl below GitHub max size
* pull that out
* rm glob
* make work
* Single name def
* unused comment
* more cleanups
* revert that
* 10MB overhead
---------
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* Revert "Revert tgwarp again (#37161)"
This reverts commit 45099e7fcd.
* Weird uv sizes
* Fix interleaving
* Fix on CPU
* make CPU safe
* Prevent corruption without clone
* Claude knows speeed
* fix interleaving
* less kernels
* blob caching
* This is still slightly faster
* Comment for blob cache
* Revert "revert tg calib and opencl cleanup (#37113)"
This reverts commit 51312afd3d.
* power draw is a lil higher
* just don't miss a cycle
* fix warp targets
* fix tinygrad dep
* Revert "Remove all the OpenCL (#37105)"
This reverts commit d5cbb89d84.
* Revert "rm common/mat.h"
This reverts commit 4ce701150a.
* Revert "Calibrate in tg (#36621)"
This reverts commit 593c3a0c8e.
* fix non-determinism in selfservice model build
also trim down model compile dependencies to the minimum required
* Apply suggestions from code review
---------
Co-authored-by: Shane Smiskol <shane@smiskol.com>
* Remove cython for transformations
* Add new test
* Switch back to program to fix mac builds
* Convert to Python instead
* Fix failing builds
* lint
* Implement conversion in pure python/numpy
* Add more tests
* Fix bugs in tests
* it's all common
* never getting fixed
* it's just tici
* reorders
* qcom2 -> tici
* Revert "qcom2 -> tici"
This reverts commit f4d849b2952cb0e662975805db6a1d32511ed392.
* Reapply "qcom2 -> tici"
This reverts commit 58b193cb8de872830f8a7821a339edca14e4a337.
* is tici
* lil more
* Revert "is tici"
This reverts commit a169be18d3fdcb3ef8317a63a89d8becadabfad8.
* Revert "Reapply "qcom2 -> tici""
This reverts commit 26f9c0e7d068fc8a1a5f07383b3616e619cd4e8c.
* qcom2 -> __tici__
* lil more
* mv lenv
* clean that up
* lil more]
* fix
* lil more
* Update Python packages
* not available anymore
* also this
* also this
* maybe?
* version
* try
* Revert "version"
This reverts commit 9ac4401b9ca59677b82736faff8baf66861df5f2.
* revert
* cffi
* issue
* comment
---------
Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>