Commit Graph

4618 Commits

Author SHA1 Message Date
qazal
52d8afde2b new viz unittests, isolate the ctx bug (#7069)
* start new test_viz

* test_rewrite_twice

* test_rewrite_with_ctx

* add back some of the old tests

* lints
2024-10-15 18:53:56 +03:00
nimlgen
9f00eacde5 nv tagged memory + resnet failed kernel (#7061)
* nv tagged memory

* linter

* metal fix?
2024-10-15 18:19:58 +03:00
chenyu
2008bac6bf use validhack logic to rewrite buffer idx (#6740)
* use validhack logic to rewrite buffer idx

saved a whopping one mod in the conv backward kernel...

* cleanup more
2024-10-14 16:47:31 -04:00
chenyu
a99e42cf2f clean up test_uop_symbolic.py (#7058)
enable more tests and remove dead tests
2024-10-14 15:35:58 -04:00
chenyu
fbaab30fe3 add timing to fuzz_linearizer (#7056)
and applied smaller FUZZ_MAX_SIZE. this is getting quite slow in CI
2024-10-14 11:57:41 -04:00
qazal
0ef186d4be scheduler internal api cleanups [pr] (#7052)
* delete external_benchmark_ast.py [pr]

* cleanup 2

* random
2024-10-14 15:56:10 +03:00
George Hotz
f85c9ba00a rewrite max to use cmplt + where (#7037) 2024-10-14 20:00:51 +08:00
George Hotz
b20b22a738 hotfix: add test_tiny, because many times it's what you want 2024-10-14 16:32:33 +08:00
Louis Novy
2ac5aec66b Fix exponential complexity in _is_padding_okay [pr] (#7008)
* preliminary test

* missed Optional

* don't check for cache during recursion

* match style from st_fixup... may be marginally faster?

* pathological test case: strongly connected DAG

* move to test_schedule as this isn't really a fusion

* oops this shouldn't be edited

* Revert "oops this shouldn't be edited"

This reverts commit 487cb027dc.

* Revert "move to test_schedule as this isn't really a fusion"

This reverts commit 48d8c550ce.

* move to test_schedule as this isn't really a fusion

* ok no more merge error funny business
2024-10-14 02:34:47 +03:00
chenyu
bd8ecf7fd6 remove NumNode (#7035) 2024-10-13 16:42:19 -04:00
chenyu
c4c806a210 generate new kernel dataset (#7034)
* generate new kernel dataset

pre req to remove NumNode
```
extra/optimization/generate_dataset.sh
gzip -k /tmp/sops
mv /tmp/sops.gz extra/datasets/
```

* fix var range in fuzz_linearizer
2024-10-13 16:19:41 -04:00
chenyu
1a27417262 remove arbitrary multiplication case (#7033)
adds the wrongly simplified kernel in test_linearizer_failures
#7019
2024-10-13 15:06:05 -04:00
chenyu
13575f080a remove bitcast backward in function.py (#7031)
bitcast cannot backward
2024-10-13 10:08:27 -04:00
qazal
13846930cd hotfix: extract_dataset.py (#7029) 2024-10-13 11:18:23 +03:00
chenyu
04d9b46d51 derivative of softmax is indepedent of max (#7009)
* derivative of softmax is indepedent of max

* update test
2024-10-12 15:59:23 -04:00
chenyu
cae1c41755 test case of softmax backward kernel count (#7022) 2024-10-12 15:46:32 -04:00
George Hotz
85a45164fb remove pyint [pr] (#7016)
* remove pyint

* bump time on tp [pr]

* dont truncate in const fold

* remove dead code

* Revert "dont truncate in const fold"

This reverts commit 29c81db0f7.

* remove define_var
2024-10-12 22:36:24 +08:00
George Hotz
38d45dfba5 hotfix: no rng in test/external/external_benchmark_schedule.py 2024-10-12 22:03:04 +08:00
George Hotz
a71bb09ec3 remove symbolic file [pr] (#7012) 2024-10-12 18:44:44 +08:00
George Hotz
5ae2de9845 UOp.variable (#7010)
* UOp.variable [pr]

* fix tests

* clean

* improve name rendering

* last bug
2024-10-12 18:20:44 +08:00
Markiian Novosad
8831c691e2 Add slice parameter type checking to disallow Tensor usage for slices (#6967)
* add support for single el tensors for slices

* rm trailing spaces

* cleanup long lines

* remove tensor in slice support, add comprehensive err msg

* cleanup getitem, add slice type check

* Edit err message
2024-10-11 16:20:21 -04:00
qazal
7451812bbf delete AST_REWRITE ctx var (#6995) 2024-10-11 11:33:16 +03:00
George Hotz
e7a0ffe46a break out linearization [pr] (#6994) 2024-10-11 15:27:33 +08:00
George Hotz
e441794c4b remove custom op support, we waste time maintaining this (#6991)
* remove custom op support, we waste time maintaining this

* customop is over
2024-10-11 14:31:09 +08:00
George Hotz
c08521e823 minor cleanups from toonygrad (#6990) 2024-10-11 14:19:10 +08:00
George Hotz
f50d0e0ee0 cloud device [pr] (#6964)
* first try at cloud device [pr]

* real separation

* we're free

* clang works

* unhappy with timeout

* better timeouts and free

* unrelated

* use http verbs + add test

* lines + better test

* fix DELETE

* shorter cloud

* split key

* fix sending renderer

* PTXRenderer serialization

* add sessions

* http.client

* minor timeout bump

* fix keep-alive

* inc server timeout

* real fix timeout

* that one too
2024-10-11 12:24:06 +08:00
Bhavya Gada
23c09f4b4c add support for padding='same' in nn.conv (#6975)
* add support for padding='same' in nn.conv

* express concisely

* simplify loop

* test same padding with dilation and conv1d

* fix bad indentation

* make loop one liner
2024-10-11 11:39:07 +08:00
qazal
4ef5310039 track viz context even if rewrite errors [pr] (#6976) 2024-10-10 18:33:15 +03:00
chenyu
592e5f1df2 skip test_viz test_no_dedup_different_opts (#6979) 2024-10-10 11:10:24 -04:00
chenyu
e3dc10f8f6 improve fold_unrolled_divs (#6977)
addressed #6935
the first few terms in fold_unrolled_divs might have been folded already, so the check should first try to add those terms back. there is a case that every but one term is folded which is not an add chain anymore, so just added as a failed test case for now
2024-10-10 10:52:05 -04:00
qazal
3481468702 bring viz to core (#6970)
* move viz to core

* pathfix

* move test_viz to core

* cleanup test_viz diff

* use contextvars
2024-10-10 16:56:26 +03:00
qazal
3724a66716 move test_viz to test/, prereq for tinygrad/viz [pr] (#6972) 2024-10-10 11:40:46 +03:00
qazal
20d3c2d113 unify UOps.SHAPETRACKER and UOps.SWIZZLE with UOps.VIEW (#6955)
* add UOps.VIEW

* update hardcoded asts

* update sops.gz
2024-10-09 02:00:17 +08:00
qazal
2800520dd5 even smaller process_replay.py [pr] (#6941)
* even smaller process_replay.py [pr]

* delete those tests

* dedup asts
2024-10-08 20:43:22 +08:00
czhu
08bfa8632b embedding shape (#6930) 2024-10-08 14:42:20 +08:00
chenyu
e4c0743188 failed example for logcumsumexp (#6936)
need cummax for numerical stability
2024-10-07 10:55:45 -04:00
qazal
b82023c97e process replay cleanup to generic _pmap [pr] (#6929)
* process replay cleanup to generic _pmap [pr]

* delete `COMPARE_SCHEDULE`
2024-10-07 13:57:05 +08:00
qazal
16312b4c59 rip out old scheduler process replay stuff, diff pure UOps [pr] (#6927) 2024-10-07 13:20:35 +08:00
wozeparrot
9eb6eef441 seed in tensor (#6869) 2024-10-06 14:46:58 -04:00
jeffzh4ng
19a7e41113 implement logcumsumexp (#6921)
* implement logcumsumexp

* change axis=None to axis=0
2024-10-06 10:45:36 -04:00
chenyu
75d9dcf000 support dtype in softmax and log_softmax (#6914)
matches torch. for mixed precision training, we would want to use float for softmax
2024-10-06 07:18:15 -04:00
chenyu
08414d7b7c cleanup test_uop_symbolic.py (#6894)
no more test_symbolic for reference, so force expected output to be exact instead of a set
2024-10-04 20:53:10 -04:00
ignaciosica
555bcb5e54 static access for code_for_op (#6889) 2024-10-05 07:38:01 +08:00
vladov
5f6b6162b3 Suppress warnings in transcendental tests. (#6891) 2024-10-05 07:37:17 +08:00
George Hotz
4df5c7a4ef move lazy to engine [pr] (#6886)
* move lazy to engine [pr]

* engine.lazy
2024-10-04 23:19:26 +08:00
George Hotz
6b063450df move hcq device to runtime [pr] (#6879)
* things that are only used in one place don't belong in helpers [pr]

* start moving hcq device [pr]

* fix paths
2024-10-04 22:26:50 +08:00
George Hotz
8ca506ee37 remove the magic methods for moving between devices [pr] (#6881)
* remove the magic methods for moving between devices [pr]

* remove unneeded clang
2024-10-04 20:27:52 +08:00
George Hotz
a0cb16ac61 node cleanup + local metal test speed [pr] (#6880)
* node cleanup [pr]

* fix tests, including the double one on metal

* no time tqdm tests
2024-10-04 18:14:23 +08:00
George Hotz
cdff1d75b6 things that are only used in one place don't belong in helpers [pr] (#6878)
* things that are only used in one place don't belong in helpers [pr]

* pretty print moved
2024-10-04 17:27:38 +08:00
George Hotz
f4ec39fe58 switch symbolic from old to uops, final PR (#6872)
* switch symbolic from old to uops, final PR

* two wrong answers

* not needed resolves

* symbolic ops passes

* symbolic ops passes

* progress

* tests pass (almost)

* fix last test

* fix some tests

* global binding and unbinding

* Revert "global binding and unbinding"

This reverts commit 9456725630.

* that test works now

* vars on uop doesn't recurse

* fix fuzzer

* update

* fix type

* fix gpt, it's UOp now

* ssimplify symbolics
2024-10-04 16:42:27 +08:00