Commit Graph

58 Commits

Author SHA1 Message Date
George Hotz cb7289f9c9
remove clang program header (#4422)
* remove clang program header

* proper max

* bools are numbers

* fix compile enet
2024-05-04 08:38:01 -07:00
George Hotz 150ea2eb76
create engine folder and move code (#3948)
* retry

* older tf

* that
2024-03-26 20:38:03 -07:00
George Hotz 41efaa848c
move graph.py and jit.py into features (#3376)
* move graph.py into features

* move jit into features

* fix quickstart
2024-02-12 17:34:34 +01:00
George Hotz 8f89e21fca
torch and numpy don't share ops anymore (#2412)
* torch and numpy don't share ops anymore

* that should be filtered out elsewhere

* still const

* graph + enet example cleanup

* hmm, we do still need it because of symbolic
2023-11-23 16:58:10 -08:00
George Hotz 0cbf6c1811
move things, clean up extra (#2292)
* move things

* idk why pylint needs that now

* delete unused
2023-11-13 20:18:40 -08:00
ian c08ed1949f
Fix plt output comment (#1428) 2023-08-03 23:35:52 -07:00
Cole Sutyak 2d4e182294
change fetch to allow for local file selection (#1309) 2023-07-23 15:00:16 -04:00
Hey 4f72eb823c
Outdated repository URL (#1218)
* Update outdated repo url

* Update more outdated repo url's
2023-07-11 23:14:19 -07:00
Yair Lifshitz 7f73d6a4da
Fix input path in examples/compile_efficientnet.py, examples/efficientnet.py. (#1034) 2023-06-23 16:34:33 -07:00
Jacky Lee 5e820818e9
Cast image to float32 (#702) 2023-03-14 08:13:19 -07: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 d9fa47ecc9 use the TinyJit in the efficientnet runner, 200ms -> 20ms 2023-02-20 19:58:16 -08:00
Kirill 7944cfdadc
Remove Tensor.data (#565) 2023-02-18 16:36:12 -08:00
Jacky Lee f08187526f
Fix examples (#540)
* Fix examples

* Remove training in parameters

* Simplify a bit

* Remove extra import

* Fix linter errors

* factor out Device

* NumPy-like semantics for Tensor.__getitem__ (#506)

* Rewrote Tensor.__getitem__ to fix negative indices and add support for np.newaxis/None

* Fixed pad2d

* mypy doesn't know about mlops methods

* normal python behavior for out-of-bounds slicing

* type: ignore

* inlined idxfix

* added comment for __getitem__

* Better comments, better tests, and fixed bug in np.newaxis

* update cpu and torch to hold buffers (#542)

* update cpu and torch to hold buffers

* save lines, and probably faster

* Mypy fun (#541)

* mypy fun

* things are just faster

* running fast

* mypy is fast

* compile.sh

* no gpu hack

* refactor ops_cpu and ops_torch to not subclass

* make weak buffer work

* tensor works

* fix test failing

* cpu/torch cleanups

* no or operator on dict in python 3.8

* that was junk

* fix warnings

* comment and touchup

* dyn add of math ops

* refactor ops_cpu and ops_torch to not share code

* nn/optim.py compiles now

* Reorder imports

* call mkdir only if directory doesn't exist

---------

Co-authored-by: George Hotz <geohot@gmail.com>
Co-authored-by: Mitchell Goff <mitchellgoffpc@gmail.com>
Co-authored-by: George Hotz <72895+geohot@users.noreply.github.com>
2023-02-10 12:09:37 -06:00
Jacky Lee 799b3f185a
Refactor getenv into helpers (#508)
* Refactor getenv into helpers

* Remove unused os

* Fix default value

* Fix more defaults for CI

* Fix bracket

* Revert changes to openpilot/compile.py

* Use getenv from helpers when possible
2023-01-31 15:09:09 -08:00
George Hotz 46bbbcf7f0 model touchups 2021-11-30 11:13:34 -05:00
George Hotz d3f169b267 move good models to models, add a training step test 2021-06-19 11:24:15 -07:00
George Hotz b80cacb416 fix GPU efficientnet example 2021-05-26 17:29:35 -07:00
Liam 075cf4bc02
Update examples to new API (#205) 2020-12-19 09:04:12 -08:00
iainwo 56d44637f3
fixed pylint, formatted python files iwth cblack on localhost (#204)
* fixed pylint, formatted python files iwth cblack on localhost

* Revert "fixed pylint, formatted python files iwth cblack on localhost"

This reverts commit 07e2b88466fa53399ad78d962ffb2ad55bc45344.

* dedented 4-spaces added linter

Co-authored-by: Iain Wong <iainwong@outlook.com>
2020-12-17 14:37:31 -08:00
George Hotz 1d10559d1d tinygrad.utils -> extra.utils 2020-12-12 15:26:07 -08:00
George Hotz 00312b8ad1 batchnorm work 2020-12-06 14:40:07 -08:00
George Hotz 2ffb8de1ea move efficientnet to extra 2020-11-16 08:08:07 -08:00
dustcollector12 6f033ea30a
enable local images for efficientnet.py (#116) 2020-11-13 07:00:12 -08:00
Marcel Bischoff a3989f9e18
Supporting .png files in efficientnet (#102)
* to make it work locally

* definitely not working

* Conv2D GPU passes some of the tests

* Conv2D GPU passes more of the tests

* passes some tests and mnist

* removed unecessary code

* Conv2D Backpass works

* wrong test_ops.py

* white space + test backward

* ereased useless code

* removed default argument

* long lines

* works also with 4 channel .png files

* commenting out

* track
2020-11-10 20:06:24 -08:00
George Hotz db755fa103 promote swish to a tensor ops 2020-11-10 15:48:11 -08:00
George Hotz c76a20b4be 4s and 7s work 2020-11-10 00:54:17 -08:00
George Hotz 8b23033fa9 support all the enet sizes 2020-11-09 18:04:16 -08:00
George Hotz 9db95ab942 fix enet padding 2020-11-09 17:56:57 -08:00
George Hotz 53157fb876 add back scale 2020-11-09 10:20:56 -08:00
George Hotz 3ffbd47335 Revert "Revert "pygame is fine, cv2 can also do the trick (#79)" (#85)"
This reverts commit 6b982621f8.
2020-11-09 10:18:48 -08:00
George Hotz 6b982621f8
Revert "pygame is fine, cv2 can also do the trick (#79)" (#85)
This reverts commit e7f2f43331.
2020-11-09 10:03:38 -08:00
dustcollector12 e7f2f43331
pygame is fine, cv2 can also do the trick (#79)
* pygame is fine, cv2 can also do the trick

* retimg and copy constructor not needed

* shape is missing without copy constructor

* retimg put back

* addressing capture buffering
2020-11-09 10:02:06 -08:00
George Hotz 3ab8fb2189 oops, timing 2020-11-07 12:15:52 -08:00
George Hotz e4c5fb0219 webcam support 2020-11-07 12:15:16 -08:00
George Hotz e6c8321e5b enet is running on GPU 2020-11-07 11:33:46 -08:00
George Hotz fbff6ab2e5 fix strided convs, GPU env var for enet 2020-11-07 10:26:37 -08:00
Marcel Bischoff c69582744d
Update efficientnet.py (#53)
from https://github.com/lukemelas/EfficientNet-PyTorch/blob/master/efficientnet_pytorch/utils.py
```
    blocks_args = [
        'r1_k3_s11_e1_i32_o16_se0.25',
        'r2_k3_s22_e6_i16_o24_se0.25',
        'r2_k5_s22_e6_i24_o40_se0.25',
       'r3_k3_s22_e6_i40_o80_se0.25',
        'r3_k5_s11_e6_i80_o112_se0.25',
        'r4_k5_s22_e6_i112_o192_se0.25',
        'r1_k3_s11_e6_i192_o320_se0.25',
    ]
```

now it's a persian cat.
2020-11-04 09:36:27 -08:00
Marcel Bischoff c40862241d
Revert "choose aspect ration dependent on landscape or portrait (#48)" (#51)
This reverts commit 2808411421.
2020-11-02 19:31:07 -08:00
Anders Aaen Springborg 2808411421
choose aspect ration dependent on landscape or portrait (#48) 2020-11-02 18:10:22 -08:00
Marcel Bischoff af5a4e0f5a
alternative to einsum which is slow in extreme cases (#44)
* streamlined numerical_jacobian

* Got rid of the g loop in Conv2D.forward

* ereased stupid line

* nothing

* no loops in Conv2D forward

* Conv2D backprop improved

* stupid things in examples

* alternative to einsum

* Conv2D backward einsum alternative

* tidying up

* tidied up

* no ravel

* got rid of print

* Update efficientnet.py

* Update efficientnet.py

* Update efficientnet.py

* only tensordot

* 255.0

* whitespace

* aspect ratio error in efficientnet

* noprint

Co-authored-by: Marcel Bischoff <marcel@Marcels-iMac.local>
2020-11-02 06:36:07 -08:00
George Hotz e01e35e545 14 ops to write for GPU 2020-10-31 10:59:30 -07:00
George Hotz 06928cf3cc ENET WORKS 2020-10-31 10:42:58 -07:00
George Hotz 68cba88e8f fix enet bugs, now is mousetrap 2020-10-31 10:28:07 -07:00
George Hotz 053c319708 optional look at cat 2020-10-30 09:30:15 -07:00
George Hotz 2c7e75d733
group conv: forward pass works (#34)
* forward pass works

* got the backward pass

* okay, it's now a coho
2020-10-30 09:19:20 -07:00
George Hotz 71aedc2309 it thinks it's washer. it's cat. bad net. you do bad. 2020-10-30 08:28:05 -07:00
George Hotz c14473f87d unit test for batchnorm2d 2020-10-30 08:19:58 -07:00
George Hotz 1dde4ce609 oops, stay in float32 2020-10-29 08:24:12 -07:00
George Hotz 2db670ef26 enet refactor + no sigmoid warning 2020-10-29 08:08:21 -07:00