Commit Graph

38 Commits

Author SHA1 Message Date
Adeeb Shihadeh 5a9644261f remove comma two support (#24248)
* remove comma two support

* cleanup release files

* little more

* more libs

* no more gralloc

* add snpe back
old-commit-hash: 5c48e7bc86a621dd35f4ff25da7a26ee506bac76
2022-04-18 17:55:23 -07:00
George Hotz 7efe157848 thneed: a more sane way of doing record/debug (#23938)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 5c5a56c5e616e0d2e76934662b73ce95bb6a0582
2022-03-10 16:33:35 -08:00
George Hotz 6b52bc6c13 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>
old-commit-hash: 8d6f49aecf3c83574a80c8eed42bc304a088c32c
2022-03-02 20:52:17 -08:00
George Hotz c975d35f49 minor cleanups, fix non binary compile (#23882)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 825c924c1cf63cc915f94e9e46cf0e3228451e18
2022-03-01 16:05:44 -08:00
Adeeb Shihadeh 2e91f016bb modeld: remove support for small model (#23803)
* modeld: remove support for small model

* use extra
old-commit-hash: 8a19d9892efacc7078f1dbbddf45afedd8afe2ec
2022-02-28 10:32:39 -08:00
Comma Device ed59474387 THNEED_DEBUG env var support
old-commit-hash: 83159a09bfc814fba66d6f1b9ec9e317dc202713
2022-02-28 09:30:43 -08:00
Comma Device 123fd2f6ee thneed: a few asserts in the optimizer for cases it will fail
old-commit-hash: 2b652605a08178e539d7ff7ab7e009b4da29bd46
2022-02-21 12:08:52 -08:00
George Hotz c033732242 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>
old-commit-hash: 2c7542d34ecaebe112071d40f81c966d56649fd7
2022-02-20 11:55:23 -08:00
Willem Melching ad5ccabce3 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>
old-commit-hash: 85efde269da2680a77c75c248aafc8c29435ca98
2022-02-19 16:06:31 -08:00
George Hotz 37349c0fef 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>
old-commit-hash: 90beaebefba444aacf16054d3b23847b26f05c47
2022-02-15 15:32:00 -08:00
Willem Melching 9d65df9048 util.h has conflicting ioctl def on comma two
old-commit-hash: c2b95ca6a1c8df3ab3817e71f1d8f53e8ef8793a
2021-11-04 16:46:38 +01:00
Dean Lee 6677f91e9d thneed/serialize: use funtions from clutil(#22760)
old-commit-hash: 177c3b89b62c5538fb36171906f091cfa4b9f975
2021-11-04 16:19:25 +01:00
Dean Lee 7ff2217c8b util: remove function to_hex (#22792)
old-commit-hash: ff33ca341382be19a4be9bd71b97af1b01b553c7
2021-11-04 16:18:01 +01:00
Willem Melching 19deb98bc3 wshadow: fix comma three build
old-commit-hash: 45c506bb17e51d4f8592f74c75b9adcffa681201
2021-11-02 17:27:34 +01:00
Dean Lee 0ce639aa3c thneed: use util::read_file to read from the file (#22757)
old-commit-hash: 07ad6d7444729c172c201a7a04fc4edd886a5cf4
2021-11-01 11:07:28 +01:00
George Hotz b4adcd2e56 Use thneed directly on the loaded YUV data (#22236)
* completely untested

* it builds now

* bug fixes, save 1ms

* using a kernel to copy works

* more sane API to loadyuv

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 83ff9ca3314b3d551949c822a98290713a0917bf
2021-09-16 14:13:03 -07:00
Willem Melching 33c50f5ea6 revert ioctl changes to thneed
old-commit-hash: 813ddb0c18464ff2e8a62357cb621415b7edab88
2021-08-30 16:30:50 -07:00
Dean Lee 073898d8fd retry ioctls while errno == EINTR (#22054)
old-commit-hash: 31230e5b60aac7a7968a80d14e96f0a6fc9a9222
2021-08-30 16:07:34 -07:00
arfy slowy 63b3d6024b fix: spelling typos (#21861)
* fix: typo spelling grammar

* revert

* Update selfdrive/locationd/calibrationd.py

* more revert

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: d74def61f88937302f7423eea67895d5f4c596b5
2021-08-05 12:05:49 -07:00
Dean Lee 60c7e01d2d remove double semicolons (#21215)
old-commit-hash: d82fa763d86750b31fe3edbb278d71565f6e3580
2021-06-10 00:03:34 -07:00
Dean Lee f70a79b838 Use C++ header files instead of C header files. (#21192)
* use cstring instead of string.h

* use cstdio instead of stdio.h

* remove inttypes.h

* use cstdlib instead of stdlib.h

* use cstdint instead of stdint.h

* #include <cstddef>

* cstdlib

* use cmath

* remove stddef.h

* use cassert

* use csignal

* use ctime

* use cerror

* rebase master
old-commit-hash: c53cb5d570adb82bc454fcabab458d7e7f09738c
2021-06-08 13:46:22 -07:00
Dean Lee e333e4f189 Cleanup selfdrive/ includes (#20822)
* cleanup include path

* continue

* format includes

* fix testraw.cc

* remove include path from SConstruct

* regroup

* rebase master

* almost done

* apply review

* rename FileReader.xx to filereader.xx

* rename Unlogger.x->unlogger.x

* rename FrameReader.xx -> framereader.xx

* apply reviews

* ui.h

* continue

* fix framebuffer.cc build error:mv util.h up

* full path to msm_media_info

* fix qcom2 camerad

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20dc8edfe0d2f3417d1ce7c84fbd32805
2021-05-08 22:15:17 -07:00
Dean Lee aefb482339 thneed: remove redundant function nanos_since_boot (#20329)
old-commit-hash: d023397ba94cd1b2a47acf0e8b900cd8d53eb360
2021-03-12 10:31:55 -08:00
Willem Melching dadeec50dd thneed: lookup dlsym offset at compile time (#20019)
old-commit-hash: 1744076514a9aa5bf9d7e7940ddbd9c431c551bf
2021-02-04 16:41:46 +01:00
Dean Lee 2a95f73b84 Thneed::clinit() : use cl_get_device_id helper(#19934)
old-commit-hash: 21f45e3ef49fece453feeefa1c65286c36bfc14b
2021-01-27 12:09:28 +01:00
George Hotz 3484683199 Thneed load/save (#19700)
* start thneed load/save

* compiling

* fix loading

* build thneed model in scons

* don't hardcode /data/openpilot

* release files

* those too

* support for loading/saving binary kernels

* save binaries out of json band

* make binary a command line flag to the compiler

* need include assert

* fix shadowed common in SConscript

* cleanup run.h

* hmm, the recurrent buffer wasn't 0ed

* ugh, unique ptr

* remove power constraint, refactor record

* Revert "remove power constraint, refactor record"

This reverts commit bb6fa52db6df59cd9d6420a6f630430e35af8a5e.

* print on thneed stop

* fingers crossed for this one

* recorded

* just curious

* okay okay, pass tests?

* cleanups

* refactor wait

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 59fac9fdc630fa78f520fc9a244f9f9cd39fa562
2021-01-19 18:08:31 -08:00
George Hotz 02a2f9ca15 Thneed refactors for future functions (#2673)
* delete debug

* thneed updates, but it seems slower

* thneed refactor

* refactor touchups

* add back asserts

* fix uaf

* track the size for local args

* final thneed refactor

* switch kgsl_command_object to avoid memory leak

* comments

* unused includes

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 5fdda8dbd82954c2b9b5af82a19e599d3b4b5ec2
2020-12-14 15:46:49 -08:00
Comma Device 2bc2c7c9b3 mask out the priority
old-commit-hash: 71930a4b9674037f494b622fb0002904b2e35a2a
2020-11-24 06:05:59 +00:00
Comma Device 8cb58c9d20 give the model GPU context highest priority
old-commit-hash: 5a8c90f32ca62df581053e47e59a35735d07b406
2020-11-24 05:57:34 +00:00
George Hotz 55df5b0ddf More governance work, fix thneed (#2610)
* more governance work

* fix thneed on qcom2

* waste doesn't OOM

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: a14ce090184af790d7e677b1f0a1107c7ade8a34
2020-11-23 17:52:28 -08:00
Dean Lee bf750511a1 add function cl_get_device_id (#1948)
* add func cl_get_device_id

cleanup

* add fix from review
old-commit-hash: d1588376171d8ba1d2ec1b670e085d6e15bd26c1
2020-08-17 11:24:39 +02:00
Adeeb Shihadeh cdfb090c7a Wunused (#1841)
* enable Wunused, first pass

* unused stuff in snpe model

* these are used on phone

* handle sigint and sigterm in modeld

* fix phone build

* camera qcom

* QCOM build works

* delete unused camerad vars

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: eb1aa3d831fd0d7fffd9aacec1accb0a5bdb0304
2020-07-09 09:25:32 -07:00
George Hotz 83f6ec221f c++ify thneed to remove memory leaks (#1737)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 01a486308d7fbcd661d8f8786c140222703f659a
2020-06-19 15:53:48 -07:00
Adeeb d035394ce7 Add pre-commit hooks (#1629)
old-commit-hash: ab83e48ec4f7c7ddaa742d9797b0d38646fdb268
2020-06-03 12:54:49 -07:00
George Hotz 6a68510918 remove the clCreateProgramWithSource interceptor (#1559)
* remove the clCreateProgramWithSource interceptor

* that's old code, thneed is better

* label them thneed_, we shouldn't need to touch CL for anything not SNPE related
old-commit-hash: b8571710e09e58b9e67170a9924eef79f32c480b
2020-05-24 03:33:36 -07:00
Comma Device 16c1926f64 wtf, how was that commented out and the tests still passed
old-commit-hash: 495e0c4648b5c3d20709bb3e08f83dad62725c2d
2020-05-18 17:10:39 +00:00
George Hotz 988361dd92 This isn't bigmodel, but there's a lot of good stuff here (#1532)
* bigmodel

* more debug print

* debugging bigmodel

* remove the tanh, debugging

* print images/buffers

* disassemble the command queues

* decompiler

* dump the shaders

* full disasm

* support patching kernel and fixing convolution_horizontal_reduced_reads_1x1

* microbenchmark

* 42 GFLOPS, 1 GB/s

* gemm benchmark

* 75 GFLOPS vs 42 GFLOPS

* 115 GFLOPS

* oops, never mind

* gemm image is slow

* this is pretty hopeless

* gemm image gets 62 GFLOPS

* this is addictive and still a waste of time

* cleanup cleanup

* that hook was dumb

* tabbing

* more tabbing

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 78a352a8ca8a948e86e7c752732e470f89d92280
2020-05-17 23:13:17 -07:00
George Hotz 206b6abe7d thneed saves 45% of a core (#1512)
* thneed runs the model

* thneed is doing the hooking

* set kernel args

* thneeding the bufferS

* print the images well

* thneeds with better buffers

* includes

* disasm adreno

* parse packets

* disasm works

* disasm better

* more thneeding

* much thneeding

* much more thneeding

* thneed works i think

* thneed is patient

* thneed works

* 7.7%

* gpuobj sync

* yay, it mallocs now

* cleaning it up, Thneed

* sync objs and set power

* thneed needs inputs and outputs

* thneed in modeld

* special modeld runs

* can't thneed the DSP

* test is weird

* thneed modeld uses 6.4% CPU

* add thneed to release

* move to debug

* delete some junk from the pr

* always track the timestamp

* timestamp hacks in thneed

* create a new command queue

* fix timestamp

* pretty much back to what we had, you can't use SNPE with thneed

* improve thneed test

* disable save log

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 302d06ee709cb65dba39e836917f5693f0819efb
2020-05-15 13:53:01 -07:00