Commit Graph

513 Commits

Author SHA1 Message Date
chenyu
e5c85ec684 type annotation of resolve [pr] (#8467)
it takes UOp|bool
2025-01-01 10:21:59 -05:00
chenyu
f3fdec940d Tensor.mod (#8458)
it's a python style mod. possibily can be cleaner with a floor div

relaxed the vmin for MOD slightly for cstyle negatives mod, it's more correct and might fix other bugs
2024-12-31 11:31:42 -05:00
George Hotz
4c94726bac remove uop mutability [pr] (#8441)
* remove uop mutability [pr]

* test fixups

* most tests pass

* more tests pass

* lil test fixups

* them too

* fix test

* unneeded

* err, that

* fix test_hcq

* fix test failures

* fix that test

* tensor universe

* does this pass test

* Revert "does this pass test"

This reverts commit ed516b3169.

* Revert "tensor universe"

This reverts commit c21301852a.

* proper spidering for uops

* cleanups

* all tensors

* all tensors

* slow but correct

* fast

* no WeakSet

* faster

* no need for list

* revert that
2024-12-31 00:29:56 -05:00
George Hotz
b71c51191b tests from remove uop mutability [pr] (#8442)
* tests from remove uop mutability [pr]

* more test fix

* simpler test fix

* remove that
2024-12-29 12:14:10 -05:00
chenyu
f69ad7506a simpler helpers.Context [pr] (#8433)
instead of having a class var for whole stack, store the old context in each Context.

also updated a test that ContextVar created in Context is not being cleared after the Context block
2024-12-27 17:27:14 -05:00
chenyu
ba59b0528f update TestContextVars for recreation [pr] (#8430)
raise RuntimeError instead of assert, and update all the skipped test cases
2024-12-27 13:34:23 -05:00
Sieds Lykles
6bb54eb532 Add variations for some ADD patterns (#8393)
* Add variations for some ADD patterns

* Add test and remove redundant rule
2024-12-25 19:49:39 -05:00
qazal
3a556a7e8b fully local tensor const representation: CONST(VIEW(DEVICE)) [pr] (#8389) 2024-12-24 16:15:56 +08:00
chenyu
0d6fe6200c test case view from an empty view (#8388)
currently it behaves differently depends on first view somehow
2024-12-23 17:40:49 -05:00
chenyu
c587b3b08c test case view the padded area of a view (#8386)
these cases view the padded area of first view
2024-12-23 16:47:31 -05:00
chenyu
b7397c1322 more typing cleanups [pr] (#8376)
List, Tuple, DefaultDict
2024-12-22 05:21:03 -05:00
qazal
514a6740e4 Revert "CONST(VIEW(DEVICE)) (#8365)" (#8372)
This reverts commit 83284985f0.
2024-12-22 04:44:34 +02:00
qazal
83284985f0 CONST(VIEW(DEVICE)) (#8365) 2024-12-22 04:18:35 +02:00
qazal
2649e87546 delete the fake buffer from const (#8355)
* delete the fake buffer from const

* fix test_sink_childless_const_alt

* it should be CONST(VIEW(DEVICE))
2024-12-21 04:20:28 +08:00
chenyu
791a80a1c7 add failed merge view example to test_simplify_valid_idx [pr] (#8334)
* add failed merge view example to test_simplify_valid_idx [pr]

* !=True is fine
2024-12-19 12:54:03 -05:00
George Hotz
52243b258c move flops_mem to renderer [pr] (#8320) 2024-12-18 12:13:17 -08:00
George Hotz
bd9c015b09 tests from grad uop path [pr] (#8313) 2024-12-18 09:25:05 -08:00
George Hotz
32df46cd73 test const pattern [pr] (#8304)
* test const pattern [pr]

* add model to test_tiny
2024-12-17 23:34:17 -08:00
Jyotirmaya Mahanta
45f2fb82d5 add failing tests for merge views (#8306)
* add failing tests for merge views

* assert is not none

* make linter happy
2024-12-18 01:27:38 -05:00
George Hotz
801e199196 change buffer to not be pointer [pr] (#8302) 2024-12-17 16:47:51 -08:00
George Hotz
0794af97db consts do not realize 2024-12-17 08:53:53 -08:00
George Hotz
4764a4c172 Revert "TIP 3 - Tensor realization spec tests (#8288)" (#8289)
This reverts commit c0d4346b5a.
2024-12-17 08:36:11 -08:00
qazal
c0d4346b5a TIP 3 - Tensor realization spec tests (#8288) 2024-12-18 00:04:50 +08:00
George Hotz
e3731766c9 add a test for UOp representation as Tensor [pr] (#8278) 2024-12-16 19:41:29 -08:00
chenyu
3195bd0d12 more test examples to merge views [pr] (#8277)
these have masks in self and masks in the merged views
2024-12-16 20:44:35 -05:00
chenyu
6e2e56c0ff unit test for view add when self has a mask [pr] (#8276) 2024-12-16 20:07:35 -05:00
chenyu
2bb298f38d add a missing unittest.main() [pr] (#8274) 2024-12-16 14:28:10 -05:00
George Hotz
bcd7ea60f0 hotfix: a few more grad tests 2024-12-13 21:03:02 -08:00
George Hotz
734f2c5344 compute gradient [pr] (#8237)
* compute gradient [pr]

* schedule_step_with_grads

* second deriv works
2024-12-13 20:46:01 -08:00
chenyu
0708a169dd more comments and tests to reshape [pr] (#8236) 2024-12-13 23:21:51 -05:00
George Hotz
8396d90f91 non controversial changes from optim branch [pr] (#8234) 2024-12-13 19:24:16 -08:00
George Hotz
37fa38d272 Revert "switch beautiful_mnist to use new optimizer [pr] (#8231)" (#8233)
This reverts commit e9ee39df22.
2024-12-13 19:07:09 -08:00
George Hotz
e9ee39df22 switch beautiful_mnist to use new optimizer [pr] (#8231)
* switch beautiful_mnist to use new optimizer [pr]

* fix abstractions3 + docs

* fix OptimizerGroup with schedule_step api
2024-12-13 18:27:16 -08:00
chenyu
e0956c518c move some ifs from merge_dims to reshape [pr] (#8229)
the third return value is only used in reshape
2024-12-13 19:56:15 -05:00
George Hotz
e2f87ecf36 start work on new gradient (#7838)
* start work on new gradient

* more correct

* working tests

* more tests

* work

* add (faliing) gradient test

* add view and reduce gradient

* test_add works, many failing test_ops

* add max and reduce max

* add max and reduce max

* 129 failing

* 108 failed

* better view drawing

* 101 failed

* i got 99 failures

* 94 failures

* it's tons of terrible code, but only 50 tests fail

* only 19 failures

* same 19 but shorter

* minimal doesn't matter

* shorter

* lil simpler

* simpler

* simpler

* simpler

* 13 test failures

* nine tests fail

* all ops tests pass

* add contiguous gradient + fix sched tests

* faster by removing toposort calls

* missed one

* add jax to testing
2024-12-13 16:45:53 -08:00
chenyu
e371a23c45 more comments and tests to reshape [pr] (#8228) 2024-12-13 18:50:13 -05:00
chenyu
eb0e5a14fd reorder and comments to reshape [pr] (#8223)
something feels wrong... contructing a counter example next
2024-12-13 17:02:27 -05:00
chenyu
ce41e6572d unit test merge_dim [pr] (#8195)
looking for better ways to write this. first adding some tests
2024-12-12 17:55:52 -05:00
chenyu
d47530c0d4 fix device canonicalize for :0 in middle [pr] (#8193)
replace is wrong because it does not check if `:0` is at the end. use re.sub instead
2024-12-12 16:32:36 -05:00
chenyu
40a4c603b9 remove more test skip for webgpu [pr] (#8192) 2024-12-12 14:06:35 -05:00
chenyu
0e57152dbb clean up test_uop_symbolic [pr] (#8165)
removed old `Node` references
2024-12-11 14:13:19 -05:00
ttomsa
e22d7b6fb0 fix var vmax inside special (#8116) 2024-12-09 01:16:08 -05:00
qazal
5dd61035f7 revert VALID early folding for now (#8114)
This reverts commit 4074f52317.
2024-12-09 00:34:24 +08:00
qazal
4074f52317 VALID early folding (#8100)
* fold valid

* :)

* fix test_verify_ast

* keep symbolic working
2024-12-07 18:37:47 +08:00
qazal
a97b8fa3c5 maskless const can lower without valid, p1 [pr] (#8094) 2024-12-06 23:21:19 +02:00
qazal
df84dc6444 unrelated test fixups from delete_lazy [pr] (#8088)
* unrelated test fixups from delete_lazy [pr]

* fine if it's scheduled later
2024-12-06 17:31:02 +02:00
chenyu
e7d5fe4a32 improve idiv _min_max (#8066)
for the cases that the we don't know the exact bounds, we might still know the sign. with this, can remove some resolve for symbolic shapetracker
2024-12-05 23:02:16 -05:00
Sieds Lykles
49c6dab74b Add pattern for div mod recombine with gcd (#8061)
Co-authored-by: chenyu <chenyu@fastmail.com>
2024-12-05 13:16:58 -05:00
George Hotz
df18e7cc37 accept filename decorator [pr] (#8049)
* accept filename decorator [pr]

* add test for safe_load

* bring old tar tests back
2024-12-05 11:40:59 +08:00
chenyu
b3220ca7b1 test cases of always True/False lt (#8048)
* test cases of always True/False lt

* one more
2024-12-04 20:38:40 -05:00