Commit Graph

3143 Commits

Author SHA1 Message Date
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
e276b6eecd use Tensor.replace [pr] (#8455) 2024-12-30 23:20:46 -05:00
qazal
c7ec0ab674 delete unused View lt support (2) (#8451)
* delete lt on view (2)

* the scheduler uses symbolic_simple
2024-12-31 07:01:25 +08:00
qazal
866dfa1f23 create_schedule([x.lazydata]) -> x.schedule() in tests (#8449) 2024-12-31 03:15:52 +08:00
George Hotz
180916257d add children tracking to uop [pr] (#8448) 2024-12-30 10:58:20 -05:00
George Hotz
29c14f1cbf hotfix: update tests for no uop mut 2024-12-30 10:05:37 -05:00
qazal
7499139239 scheduler renames from the buffer_shape branch [pr] (#8444)
* scheduler refactors and renames from the buffer_shape branch [pr]

* all unmasked sts are allowed here

* only renames
2024-12-30 16:33:38 +08: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
qazal
34987a03af const copy folding spec + multi.py behavior [pr] (#8436)
* const copy folding spec + multi behavior [pr]

* copy from clang, move multi test
2024-12-29 23:12:13 +08:00
qazal
a44cd1e6f7 add collapse_view to the scheduler [pr] (#8440) 2024-12-29 21:30:29 +08:00
qazal
da2fa0b37f viz early serialize to json + don't viz rewrites on const [pr] (#8435) 2024-12-28 21:32:25 +08:00
qazal
90ce2c6029 UOp shape spec and requirements from TIP 4 (#8428)
* UOp ShapeTracker conceptual refactor [pr]

* add the UOp shape spec

* assign spec

* test a permuted assign

* lint + more work

* collapse assign after it swizzles the store [pr]

* more work, refine valid

* permute the other way

* shapetracker cleanup

* this assert should work now
2024-12-28 18:32:52 +08: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
nimlgen
0a139b1436 amd iface abstraction (#8413)
* start on amd iface

* t

* unused import

* fixes

* internal api
2024-12-27 15:53:53 +03:00
Francis Lata
5755ac1f72 Fix FC layer ResNet load_from_pretrained error (#8387)
* validate that FC exists before loading pretrained weights

* add test case for ResNet pretrained model without FC layer

* remove extra newline

* rename test case

* reraise exception if not handled by check
2024-12-26 18:11:27 -05:00
qazal
b5820a5209 deletions from an ops.py "instant rule" audit [pr] (#8424)
* UOp.st cleanup 2 [pr]

* deletions from an ops.py instant rule audit [pr]

* note
2024-12-27 00:49:04 +08:00
qazal
9defbc7d54 add symbolic_simple to the scheduler [pr] (#8419) 2024-12-26 20:05:08 +08: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
313bdfa43f Add View lt support back [pr] (#8407)
* Revert "remove unused View.t and lt [pr] (#8374)"

This reverts commit 8fdcb60461.

* green test_masked_const_elementwise
2024-12-26 01:09:59 +08:00
qazal
4cbe5919d6 tensor uops symbolic folding spec [pr] (#8406) 2024-12-26 00:26:41 +08:00
qazal
6422936b62 fix pre-commit ruff error [pr] (#8405) 2024-12-26 00:12:57 +08:00
chenyu
de3705168e update idiv doc and test cases (#8398)
test more cases when either numerator and denominator is negative and has remainder or not
2024-12-24 17:03:18 -05:00
nimlgen
a647f3dd2c move mockgpu to tests [pr] (#8396)
* move mockgpu to tests

* linter

* i'm so sorry

* sorry, python

* path
2024-12-24 23:48:02 +03:00
chenyu
2c93f27652 remove explicit np.array and np.int32 in test_div_int [pr] (#8395)
vals default loads as int32 now in test_ops
2024-12-24 13:09:30 -05:00
qazal
3273972f44 delete is_unrealized_const, it's just CONST [pr] (#8390) 2024-12-24 16:46:12 +08: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
geohotstan
78cb47dfc5 docs and tests clean ups (#8383) 2024-12-23 11:12:13 -05:00
chenyu
a556adf028 add test for Tensor silu and swish (#8381)
was only tested in onnx, added to test_ops for completeness
2024-12-22 21:08:59 -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
88bc51385c scheduler: don't trade complexity for speed (#8370)
* scheduler: don't trade complexity for speed

* don't need is_scheduled

* make those tests real world

* graph_rewrite dedup
2024-12-22 03:30:51 +02:00
qazal
991b91d4d6 fix string repr of arg in viz and print [pr] (#8369) 2024-12-21 23:44:10 +02:00
ignaciosica
ba0c844a83 special tol when f16 and bf16 are tc input dtypes (#8183) 2024-12-21 11:32:26 -05:00
qazal
72aa38aa3b BIND in tensor_uop_spec + cleanups [pr] (#8363)
* Ops.BIND pattern in tensor_uop_spec + cleanups [pr]

* use metaops there
2024-12-21 21:26:47 +08:00
chenyu
18dca3c3d7 isolate train_gpt2 slow kernels [pr] (#8358)
also fixed run_linearizer with var_vals=None
2024-12-20 17:59:01 -05: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
George Hotz
074315ec08 hotfix: simpler test_mnist_model 2024-12-20 10:18:17 -08:00
qazal
5776ea9386 hotfix: account for all changes in process_replay early stopping [pr] (#8348) 2024-12-20 23:46:46 +08:00
George Hotz
9f306e12ac hotfix: test_net_speed can't backward before realize 2024-12-19 20:32:59 -08:00
chenyu
7153f7709f update test_merge_view_recursion_err2 [pr] (#8339)
the view was not created through View.create, updated the test to show the expected behavior
2024-12-19 18:29:34 -05:00
chenyu
2bf47b75da temp fix for symbolic shape view add [pr] (#8337)
something is still wrong with symbolic shape shrink, but it should not recurse forever
2024-12-19 16:10:42 -05: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
qazal
8e266091fb tensor const spec [pr] (#8331) 2024-12-19 22:41:30 +08:00
George Hotz
0ad264ed2d new from uops [pr] (#8330)
* new from uops [pr]

* mem_estimate is it's own thing
2024-12-18 23:42:58 -08:00
geohotstan
423d823c50 add GatherND and ScatterND to onnx ops (#8241)
* implemented

* this implementation is now correct

* this is fine I guess

* better variable names

* finally correct gathernd

* add a note

* eh just leave it at this for now

* teeny adjustment
2024-12-19 00:35:04 -05:00