George Hotz and GitHub
fa14f7b4fd
switch contract arg to match expand arg [run_process_replay] ( #5667 )
...
* switch contract arg to match expand arg [run_process_replay]
* support multiaxis contract too, it's easy
* cancel contract/expand
2024-07-23 18:08:33 -07:00
chenyu and GitHub
ea99efe815
remove UOps lt pattern of booleans ( #5666 )
...
covered by the generic lt fold pattern
2024-07-23 20:11:21 -04:00
chenyu and GitHub
e196640d71
more generic lt folding ( #5665 )
2024-07-23 19:50:59 -04:00
chenyu and GitHub
16c27ae400
update UOp.SPECIAL arg spec [run_process_replay] ( #5661 )
...
* update UOp.SPECIAL arg spec [run_process_replay]
from `(0, "gid0", 4)` to just `("gid0", 4)`. closer to a Variable
* fix ptx
2024-07-23 16:58:12 -04:00
George Hotz and GitHub
4d47968580
fix acc folding for NV tensor cores ( #5658 )
...
* fix acc folding for NV tensor cores
* fix correctness of reduce_before_expand
2024-07-23 13:03:02 -07:00
chenyu and GitHub
199b3bf02b
simple UOp lt/ge folding ( #5657 )
...
works if lhs is a DEFINE_VAR.
folds trivial x < -math.inf now, need to change SPECIAL to use DEFINE_VAR to fold more
2024-07-23 14:11:05 -04:00
chenyu and GitHub
e210c87b4a
uop mod-mod simplification ( #5650 )
2024-07-23 12:33:55 -04:00
chenyu and GitHub
4f83da626e
uop symbolic simple mul mod ( #5648 )
2024-07-22 23:17:41 -04:00
chenyu and GitHub
efc7bf37a2
reuse UOp.sparents in UOps.vars [run_process_replay] ( #5647 )
...
also simplified a few set.union
2024-07-22 22:50:19 -04:00
George Hotz and GitHub
ed2ee52b8b
fix arange 4096 with more folding rules ( #5641 )
2024-07-22 14:21:11 -07:00
chenyu and GitHub
24505199fb
UOp.const(x.dtype, y) -> x.const(y) [run_process_replay] ( #5642 )
2024-07-22 17:09:40 -04:00
chenyu and GitHub
97b116bb1d
UOp mul div simplification ( #5637 )
...
* UOp mul div simplification
* != 0 is fine
2024-07-22 16:14:12 -04:00
qazal and GitHub
c64e9591e3
replace gates in uopgraph [run_process_replay] ( #5632 )
...
* test
* replace gates in uopgraph [run_process_replay]
* rewrite all gates
* hmm, process replay passes?
* Revert "rewrite all gates"
This reverts commit 2425a443f3 .
* yea that makes sense
* remove unsued
* replace source should be up there
2024-07-22 15:56:55 +03:00
George Hotz and GitHub
386fb5e7f8
folding without UNMUL ( #5628 )
...
* folding without UNMUL
* fix failures, index_collapse
* import ReduceOps
* test_arange_4096 isn't folding
2024-07-21 20:14:44 -07:00
chenyu and GitHub
a823759dc5
simpler pattern matcher rules [run_process_replay] ( #5620 )
2024-07-21 04:05:01 -04:00
chenyu and GitHub
b991097d41
move UPat and PatternMatcher from uopgraph.py to uops.py ( #5597 )
...
* move UPat and PatternMatcher from uopgraph.py to uops.py
towards instant UOps rewrite on UOp.alu
[run_process_replay]
* fix imports
2024-07-19 19:28:24 -04:00
George Hotz and GitHub
2e617ca59e
lowerer img index ( #5592 )
2024-07-19 14:22:02 -07:00
George Hotz and GitHub
10be05aae5
push contract through cast to fix test_float2_acc (try 2) ( #5585 )
...
* push contract through cast to fix test_float2_acc (try 2)
* contract push only on floats
2024-07-19 10:34:43 -07:00
George Hotz and GitHub
51892c8fac
Revert "push contract through cast to fix test_float2_acc ( #5581 )" ( #5583 )
...
This reverts commit ddda9420be .
2024-07-19 09:44:30 -07:00
George Hotz and GitHub
ddda9420be
push contract through cast to fix test_float2_acc ( #5581 )
...
* push contract through cast to fix test_float2_acc
* no_vectorized_alu applies to cast too
2024-07-19 09:30:26 -07:00
George Hotz and GitHub
e04704faff
put acc first again ( #5580 )
2024-07-19 08:55:19 -07:00
George Hotz and GitHub
0ad87021e2
move acc to end ( #5568 )
...
* move acc to end
* confirmed pictures are the same
* relax that
* Update test_ops.py
2024-07-19 03:06:52 -07:00
George Hotz and GitHub
223d9283ee
fix float4 acc by moving contracts ( #5559 )
2024-07-18 11:30:16 -07:00
George Hotz and GitHub
c41cd55556
remove vectorized alu in expander [run_process_replay] ( #5561 )
2024-07-18 11:27:40 -07:00
George Hotz and GitHub
a7fec05acc
fix broken store rule [run_process_replay] ( #5558 )
...
* remove unused store rule [run_process_replay]
* that should preserve behavior i think
2024-07-18 11:07:34 -07:00
George Hotz and GitHub
923e0fe0b8
fix half4 folding ( #5556 )
2024-07-18 10:47:39 -07:00
George Hotz and GitHub
d1a7279605
indexing fold with casted bool ( #5551 )
...
* cast bool is where
* universal transform is wrong
2024-07-18 10:02:29 -07:00
kormann and GitHub
2c4add6844
pretty print lazy op per default ( #5505 )
...
* pretty lop
* min diff
* walrus
* fix
* min diff
* simplify
* pretty helper function
* ws
* pretty uop upat
* tests
* stricter tests
* test passes
* ws
* stronger upat test
* delete print_tree
* min diff
* stricter exp test
* fix merge
* stronger uops eval test
* +readable and deep upat test
* +readable and deep upat test
* sort inv fix
* fix
* revert allowed_len
2024-07-18 09:34:08 -07:00
George Hotz and GitHub
a6e70f8a71
clean up expand function [run_process_replay] ( #5538 )
...
* clean up expand function [run_process_replay]
* lil cleaner
* add a type
2024-07-17 15:02:00 -07:00
George Hotz and GitHub
1a68854766
PatternMatcher add ( #5532 )
...
* PatternMatcher add [run_process_replay]
* f4 dynamic
* test_failure_36 is fixed
* fix PTX
2024-07-17 12:44:42 -07:00
George Hotz and GitHub
1242b302fa
expand UOps with rewrite rules ( #5501 )
...
* expand UOps with rewrite rules [run_process_replay]
* progress
* much closer
* close, way less bugs
* bunch of expander tests
* fix contract
* ops tests pass
* fix barrier
* mostly passing
* bitcast in expanded ops
* support more expand merges
* all tests pass maybe
* fix empty EXPAND
* fix LIN fuzzing
* add ALL_SAME assert
* all same
* all same work
* raise CompileError
* pass fuzz linearizer
* revert whitespace
* fix nv tensor core test
* fix mypy
* bug fix
* fuzzer passes
* put tests back
* expand arg to idx
2024-07-17 10:17:50 -07:00
George Hotz and GitHub
158221b36b
expand tests from uop_expander [run_process_replay] ( #5524 )
...
* expand tests from uop_expander
* more changes from the branch
2024-07-17 09:22:36 -07:00
gswangg and GitHub
203161c75d
refactor VECTORIZE/GEP rules ( #5507 )
2024-07-16 09:41:23 -07:00
George Hotz and GitHub
9d4c3c553c
prepare expand to support multiexpand [run_process_replay] ( #5503 )
2024-07-15 18:21:24 -07:00
qazal and GitHub
0b3a34e3b1
vectorize folding [run_process_replay] ( #5470 )
...
* test_gep_vec_fold
* remove that
* fix process replay
* lint
2024-07-14 09:41:48 +03:00
Carson Powers and GitHub
ef578b4de8
new UOp style patterns [run_process_replay] ( #5444 )
...
* express permute srcs in uop
* loop folding / sum collapse pats -> uop style
* UNMUL, const, phi on DEFINE_ACC pats -> uop style
* fix: cvar not const
* DEFINE_ACC w/o inputs, VECTORIZE-PHI-GEP pats -> uop style
* fix VECTORIZE-PHI-GEP pat
* contractor, reducer, float4 pats -> uop style
* arange folding .where
* one more
* revert permute expression in UOp
2024-07-13 17:21:08 -07:00
wozeparrot and GitHub
2427f149a3
threefry as pattern matcher ( #5371 )
2024-07-13 11:59:03 -07:00
George Hotz and GitHub
414aa6ee98
minor improvments to matcher speed [run_process_replay] ( #5439 )
...
* minor improvments to matcher speed [run_process_replay]
* oh, put that back
2024-07-12 20:41:41 -07:00
George Hotz and GitHub
fb3011ac61
improve matcher speed [run_process_replay] ( #5438 )
...
* improve matcher speed [run_process_replay]
* don't use arg set in ptx
2024-07-12 20:02:19 -07:00
George Hotz and GitHub
4aefb1595d
MetaOps.SINK [run_process_replay] ( #5422 )
...
* s/loadops/metaops [run_process_replay]
* add metaops.sink [run_process_replay]
2024-07-12 13:37:30 -07:00
Roelof van Dijk and GitHub
b18aa00bba
refactor: consolidate replace [run_process_replay] ( #5403 )
2024-07-12 07:36:57 -07:00
3a2b5a75d2
improve single kernel indexing ( #5398 )
...
* improve single kernel indexing
* metadata in graph (#5399 )
* indexing is O(1)
* add failing test
* ugh, that all needs to be replaced with symbolic
* broken on ptx, it's fine
---------
Co-authored-by: wozeparrot <[email protected] >
2024-07-11 19:00:57 -07:00
George Hotz and GitHub
c2da4454cd
indexing getting better ( #5389 )
...
* indexing getting better [run_process_replay] [no_assert]
* fix test
* test_arange_2_reduce is a simpler test
* put that print back, NOOPT
* don't merge reduces (they could be different reduces)
* FUSE_AS_ONE_KERNEL
* fix tests
* fix test_var_multireduce
* w/e put that there
* fails on others too
* fix test, revert UNMUL change
* in case order matters
* one kernel indexing works
* one kernel indexing works (test other)
2024-07-11 16:41:51 -07:00
George Hotz and GitHub
e8191479a3
add bigint type for indexing [run_process_replay] ( #5387 )
2024-07-11 11:37:10 -07:00
George Hotz and GitHub
3e40211e45
add UOP_IS_SYMBOLIC [run_process_replay] [no_assert] ( #5386 )
...
* cleanup a few things in uops [run_process_replay] [no_assert]
* add optional UOP_IS_SYMBOLIC
2024-07-11 10:48:45 -07:00
qazal and GitHub
dc3ea78560
hotfix: faster UOps.END* insert [run_process_replay] ( #5377 )
...
* is this faster
* p2
* don't waste lines
2024-07-11 13:20:19 +03:00
qazal and GitHub
9ca2d96b6b
delete extra check in DEFINE_ACC [run_process_replay] ( #5375 )
2024-07-11 10:49:03 +03:00
0215c952c5
Move transcendental to UOp level ( #5367 )
...
* move uopgraph to file [run_process_replay]
* transcendental uops
* tests pass
* no skip
---------
Co-authored-by: chenyu <[email protected] >
2024-07-10 19:06:25 -07:00
George Hotz and GitHub
d13654a820
move uopgraph to file [run_process_replay] ( #5364 )
...
* move uopgraph to file [run_process_replay]
* fix print tree test
2024-07-10 17:34:50 -07:00