Commit Graph

1363 Commits

Author SHA1 Message Date
George Hotz
d8dda2af3a openpilot fixups 2023-03-06 14:14:44 -08:00
George Hotz
a77d792aff Codegen gpu cleanups (#640)
* cleanups

* fixups

* handle pre upcasted global buffers

* early is just required

* delete junk from hand coded opt

* implicit upcast_in_mid_reduce

* speedup

* fix exec w validhacks

* reorder opt

* only need to check the output for that

* return total runtime from kernels if debugging
2023-03-04 15:31:51 -08:00
Patrick Geneva
117111825c Fix windows file permission error (#634) 2023-03-04 09:23:55 -08:00
George Hotz
528cb3b3b9 fix ast test 2023-03-04 07:49:25 -08:00
George Hotz
893f136fe0 lines from helpers 2023-03-03 23:07:46 -08:00
George Hotz
c53efb3635 optimize for CL (#633)
* required opt

* simplify

* works

* shift_to_last

* required is fine

* print shape in colored

* better shape

* args was wrong

* debugs

* fix empty shape

* colored shape printer
2023-03-03 22:00:09 -08:00
Diogo
52204a7b88 adding comparison operators (#616)
* Less, LessOrEqual, Greater, GreaterOrEqual, Equal

* lint fix

* using built in functions

* overriding __eq__ breaks things

* backwards pass for less - foward only tests

* one other spot

* removing backwards for comparison ops to match pytorch

* raise runtime error

* more tests for comparison ops

* fixed the lineup

* added number upcast tests
2023-03-02 08:10:44 -08:00
George Hotz
d062cc82b8 put restrict back 2023-03-01 21:34:45 -08:00
George Hotz
bfcec234a2 Refactor ASTs (#622)
* ugh worst branch name

* compiler refactor continues

* scc -> cloc

* buf -> _buf

* finish _buf, and program -> runtime

* gpu is still working, clang isn't

* clang in new style

* ops_metal

* something broke it

* improve metal

* clean up tons of cl crap

* hack fix sync

* cleaner gpu

* gpu metal clang

* cleanups

* minor refactor

* GPUCodegen

* fix up LLVM

* blind CUDA refactor

* codegen / runtime

* keep ops naming

* linter passes

* woah, llvm was allocing 4x what it needed to

* bugfixes

* fix openpilot compiler

* fix compile_efficientnet

* method cache should fix tests

* deal with duped functions
2023-03-01 18:57:29 -08:00
George Hotz
7e6edfbc64 unbreak onnx conv padding 2023-02-28 13:55:03 -08:00
George Hotz
7d556ca7e0 avg/max pool work in N-D 2023-02-28 13:38:27 -08:00
George Hotz
d584bae5c0 fine, openpilot can have 197 kernels 2023-02-27 11:48:36 -08:00
George Hotz
7b999add1d all onnx model tests pass 2023-02-27 11:22:45 -08:00
George Hotz
652d48ccec onnx : openpilot expand issue was fixed yesterday. remove hack 2023-02-27 11:04:42 -08:00
George Hotz
9d6b63f043 add ConstantOfShape 2023-02-27 10:57:50 -08:00
George Hotz
082134952b CastLike works with one type hack 2023-02-27 10:51:26 -08:00
Jacky Lee
1ffe8d68d5 Add more onnx ops (#615)
* Add Celu

* Add thresholded relu

* Add softsign
2023-02-27 10:43:41 -08:00
George Hotz
643e8b0388 fix tests, test bn evaluate too 2023-02-27 10:39:47 -08:00
Diogo
07e643431c added onnx group norm (#614) 2023-02-27 08:11:01 -08:00
Diogo
e68fa18c9b layer norm support in onnx (#607)
* layer norm support

* switched to 1e-05
2023-02-26 22:04:02 -08:00
George Hotz
3a2a500e90 prevent race condition, external yolo test for now 2023-02-26 17:08:24 -08:00
Sohaib
71ae6e5605 fix: avgpool without counting padding (#605) 2023-02-26 07:13:00 -08:00
George Hotz
a8de233e12 only div, no reciprocal (#601)
* only div, no reciprocal

* remove reciprocal

* fix pad shuffling
2023-02-25 09:35:03 -08:00
Sohaib
d581a99d90 onnx: lrn (#602)
Co-authored-by: Sohaib Errabii <errabii.sohaib@gmail.com>
2023-02-25 09:24:53 -08:00
voidz
94bec40110 moved extras/jit.py -> tinygrad/jit.py (#599)
* moved extras/jit.py to tinygrad/jit.py

* fixed indent

* removed tinygrad.helpers.DEBUG from jit.py
2023-02-25 08:32:33 -08:00
George Hotz
2c5e13a513 Reluless (#600)
* replace relu for maximum

* fix for other backend

* clean up RELU and GT0

* tests for maximum

* had to clean that up

* why reverse a maximum?
2023-02-25 01:21:16 -08:00
George Hotz
176ad29974 retain support for old onnx 2023-02-24 22:29:54 -08:00
George Hotz
da5643d024 rest of tests shouid be made to pass 2023-02-24 12:52:23 -08:00
George Hotz
85452fbaf3 onnx 58/109/208 2023-02-24 12:19:05 -08:00
George Hotz
e8a153e4e9 onnx : add a whole bunch of ops 2023-02-24 12:00:03 -08:00
George Hotz
f2486a7248 more onnx ops 2023-02-24 10:55:58 -08:00
George Hotz
4d0a3dd653 openpilot expand is bugged 2023-02-24 10:25:59 -08:00
George Hotz
2e56a4793e rename log_softmax, support dim, fix onnx Softmax 2023-02-24 10:11:24 -08:00
George Hotz
5cdfeffe2c fix shape test 2023-02-24 09:36:32 -08:00
George Hotz
3becefa218 fix onnx tests 2023-02-24 09:27:18 -08:00
George Hotz
e263c0c628 onnx : another model test is passing 2023-02-24 09:22:58 -08:00
George Hotz
d3feea302d much cleaner way to write onnx ops 2023-02-24 08:46:28 -08:00
George Hotz
f6d946853c more bugfixes 2023-02-24 00:21:29 -08:00
George Hotz
b1b2d8f440 onnx : some op tests working 2023-02-23 23:58:13 -08:00
George Hotz
b287b1d529 fix yolov8 to get to ConvTranspose 2023-02-23 22:46:48 -08:00
George Hotz
2d59b25ead onnx backend test : enable only the model tests 2023-02-23 22:36:26 -08:00
George Hotz
d8b6f241f1 external_test_onnx_backend 2023-02-23 21:55:07 -08:00
Sohaib
8835df7a5c upgrade onnx to 1.13.0 (#588)
- remove protobuf from direct dependencies
- replace deprecated mapping.TENSOR_TYPE_TO_NP_TYPE

Co-authored-by: Sohaib Errabii <sohaib.errabii@ipops.io>
2023-02-23 13:59:23 -08:00
calledit
81f7c6800a Added info on simdgroup availability (#586)
* Add info on simdgroup availability

* "osx" not "os x"

* Update metal_matmul.py

* Update metal_matmul.py
2023-02-23 13:59:02 -08:00
George Hotz
d22e19536b onnx: support low quality Resize. stuck on ConvTranspose will have to wait for convless 2023-02-23 09:05:23 -08:00
George Hotz
ab3a2ae9a2 fix test_resnet in onnx now that maxpool works 2023-02-23 08:41:47 -08:00
George Hotz
fd6082dcef support all _pool2d. conv will eventually be an hlop 2023-02-23 08:19:47 -08:00
George Hotz
76b4d0577d yolov8 works up to the MaxPool 2023-02-22 19:32:13 -08:00
George Hotz
c4c2c28738 a sustainable approach to float4 (#582)
* a sustainable approach to float4

* can_float4

* fix tests

* fix float4

* delete dead code

* types and minor cleanup
2023-02-22 09:45:08 -08:00
George Hotz
c5e2126d49 move DEBUG to helpers 2023-02-22 06:52:11 -08:00