Commit Graph
41 Commits
Author SHA1 Message Date
geohot 46b49d50bd llvm was using wrong shapetracker 2023-03-12 11:49:03 -07:00
geohot fdde87afda Revert "Revert "late simplify on st""
This reverts commit c8508e359d.
2023-03-12 11:47:44 -07:00
geohot c8508e359d Revert "late simplify on st"
This reverts commit 606550474c.
2023-03-12 11:46:10 -07:00
geohot 606550474c late simplify on st 2023-03-12 11:38:56 -07:00
George HotzandGitHub 15e0b56e39 compile works (#688)
* compile works

* runtimes

* line count

* fix custom, to tg dtype

* meh, that's fine with lazy import
2023-03-12 11:01:25 -07:00
Cyril RoumégousandGitHub 3f08613a2a apply flake8 E203 rule (#684) 2023-03-11 11:35:16 -08:00
geohot fd65edf595 fix mem_estimate for dtype.itemsize 2023-03-11 09:20:05 -08:00
geohot 01f39b19dc move to shapetracker.py 2023-03-11 07:50:07 -08:00
George HotzandGitHub f3ac52aee8 Mypyc (#680)
* building shapetracker

* default ENABLE_METHOD_CACHE

* symbolic compiles

* improve types

* tensor compiles

* oops, that's a bug

* best of both worlds

* find legit typing bugs

* pad2d can take list or tuple

* sub 200ms when compiled
2023-03-11 07:33:30 -08:00
George HotzandGitHub 0b03216cc3 losing lines (#678)
* losing lines

* FLIP -> STRIDE

* shapetracker refactor
2023-03-10 21:57:05 -08:00
geohot 8bf75a7fdd fix stable diffusion and CI 2023-03-10 17:48:12 -08:00
geohot c7d17c25d9 ugh, that's getting ugle 2023-03-10 17:41:19 -08:00
geohot 4780f9a6df llama runs (slowly) in master 2023-03-10 17:36:51 -08:00
George HotzandGitHub 1826ff6b89 dtypes nice and clean (#673)
* add dtype class

* dtypes

* buffers are lazy

* dtype is tracked by lazybuffer and GenericShape

* fix types in llvm

* llvm store

* dtype tests

* fix tests maybe

* fix flop counter

* fix CI

* CI fix and check format

* fix dtype and dtype check

* fix custom test

* fix test graph
2023-03-10 16:56:07 -08:00
geohot 036737a12a mem_estimate tracks bytes, not items 2023-03-10 09:44:12 -08:00
geohot fb5ee9260f add pad tests to shapetracker 2023-03-09 12:51:18 -08:00
George HotzandGitHub b561256a0e allow all reduces (#661)
* allow all reduces

* push permute tests

* explict permute reshape push

* contractw1s
2023-03-07 15:36:01 -08:00
George HotzandGitHub b14d31d6db ConvNeXt + extras (#657)
* simple convnext implementation

* shorter function names

* need to realize the random functions now

* creating an optimizer realizes all params

* assign contiguous

* fix lazy lazy

* why was i doing that...add convnext to tests

* LazyNumpyArray

* enable assert + comment

* no two tiny
2023-03-06 22:10:56 -08:00
George HotzandGitHub 4b9bc1615b While fusion (#654)
* try this

* readme

* opt comments
2023-03-06 09:13:23 -08:00
geohot 6e763dc446 matmul example in readme 2023-03-06 08:25:13 -08:00
geohot 5dc227dba6 fix bug in ENABLE_METHOD_CACHE and enable for llvm 2023-03-06 07:43:40 -08:00
geohot 8c5dea8d72 fix CUDA float4 issues 2023-03-06 07:16:38 -08:00
geohot f028accae3 print upcasted colors 2023-03-05 22:12:42 -08:00
geohot b2d4b2c06e refactor imports and EOL whitespace 2023-03-05 20:52:03 -08:00
George HotzandGitHub 382f346523 clean up opt (#649)
* clean up opt

* don't let global kernels get too small

* 8192 -> 1024

* disable local shape for clang

* fix can_merge

* unroll the 5x5 depthwise convs in op

* load float4 check
2023-03-05 20:49:36 -08:00
George HotzandGitHub 8de24e3b05 accumulator can be a float4 (#647)
* remove reduceopop

* not float4 yet

* float4 acc works

* group_float4 on store
2023-03-05 15:44:41 -08:00
Cyril RoumégousandGitHub c10131ddf5 reduce number of lines (#645) 2023-03-05 15:42:32 -08:00
geohot f281f707bd better function names 2023-03-04 18:27:37 -08:00
George HotzandGitHub 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
George HotzandGitHub b02a392d69 Improve local (#635)
* local is improving

* local is finding bugs

* new local should work
2023-03-04 09:30:49 -08:00
George HotzandGitHub 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
George HotzandGitHub 7a1d96fd76 No negative (#632)
* behavior is correct without VALIDHACKS

* simple div and mod

* fix tests

* no negative variables

* alt form is correct

* still correct

* bug in mulnode

* at least validhacks works now

* cleanups

* test validhacks, and to_image_idx

* cache compare key

* tests and __neg__
2023-03-03 16:48:14 -08:00
geohot b9ce20c374 openpilot test wasn't running, factor out image idx 2023-03-03 07:41:53 -08:00
George HotzandGitHub 459488bba2 fix linter (#630)
* fix linter

* no imports okay

* explicit bases

* disable in pylintrc
2023-03-02 20:06:20 -08:00
George HotzandGitHub 3915c89fb6 symbolic improvements (#629)
* fixups

* shorter diff

* wow, okay removing that had side effects

* more numeric tests

* MIN MAX tests
2023-03-02 19:50:38 -08:00
George Hotz dc88ad3342 fix ops print bug 2023-03-02 10:33:03 -08:00
George Hotz 0335cb86b9 refactor comparison. there's a bug in the method cache 2023-03-02 10:10:16 -08:00
DiogoandGitHub 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 HotzandGitHub 2e26286294 speed like you wouldn't believe (#626)
* speed like you wouldn't believe

* fix tests
2023-03-02 07:49:19 -08:00
geohot d062cc82b8 put restrict back 2023-03-01 21:34:45 -08:00
George HotzandGitHub 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