George Hotz and GitHub
911bf7216c
remove unused match rules [run_process_replay] ( #6217 )
2024-08-21 00:16:04 -07:00
George Hotz and GitHub
2c42e9c2c6
faster rewrite, no folder in expand/reduce [run_process_replay] ( #6216 )
...
* faster rewrite, no folder in expand/reduce [run_process_replay]
* is removing the expander there okay
* parens
* don't reconstruct exact match uop
* fast do_reduce
* expand pyint
* most of the parents gains with less lines
2024-08-20 23:36:58 -07:00
George Hotz and GitHub
16f420f7a7
split full_graph_rewrite and linearize_uop [run_process_replay] ( #6215 )
...
* split full_graph_rewrite and linearize_uop
* fix tests
* graph rewrite in test uops
* add types
2024-08-20 20:12:33 -07:00
George Hotz and GitHub
a5d79688db
fix indexing out of bounds ( #6208 )
...
* fix indeing out of bounds
* 5 ops per access is fine
2024-08-20 11:34:56 -07:00
qazal and GitHub
ee5fe12630
disallow some uops at different levels [run_process_replay] ( #6186 )
...
* assert intermediate ones
* assert low-level uops
2024-08-19 21:23:44 +03:00
qazal and GitHub
2242ff84be
type verify intermediate UOps [run_process_replay] ( #6140 )
...
* type verify intermediate UOps [run_process_replay]
* merge asserts
* variable const
2024-08-19 20:59:01 +03:00
chenyu and GitHub
b36a7273c6
RUF018 assignment-in-assert [run_process_replay] ( #6172 )
...
assertion should not have side effect or `-O` breaks.
initially just wanted to fix the one in rearrange, but it also made some long lines less long
2024-08-19 00:34:52 -04:00
qazal and GitHub
fad1818530
move graph rewrite to ops [run_proess_replay] ( #6159 )
...
* move graph rewrite to ops [run_proess_replay]
* better place
2024-08-18 20:02:28 +03:00
e3d14d1ccc
Lowerer Multireduce Grouping ( #6097 )
...
* grouping changes to codegen
* linters + tests
* fix identical store issue on PTX
* comment in grouping multireduce tests
* cleaning up diff
* cleaning up diff
* comments
* linters
* hotfix: dont change kernels
---------
Co-authored-by: qazal <[email protected] >
2024-08-18 19:57:51 +03:00
chenyu and GitHub
f7950fc2b6
add E275 missing-whitespace-after-keyword linting rule ( #6149 )
...
requires space after keywords like `assert`, `not`, `return`, `else`
2024-08-17 16:44:34 -04:00
George Hotz and GitHub
88edc2902d
axis_is_masked with graph_rewrite [run_process_replay] ( #6144 )
2024-08-17 10:28:49 -07:00
qazal and GitHub
d1d41130cd
use membufs in ImageDType checks [run_process_replay] ( #6136 )
...
* use membufs in ImageDType checks
* set by key [run_process_replay]
2024-08-17 16:17:46 +03:00
qazal and GitHub
41ac8bdd63
verify_ast prep refactor for intermediate uops type spec ( #6135 )
...
* refactor to ops
* refactor to two functions
* the uop's shape become local_reduce
2024-08-17 15:34:18 +03:00
qazal and GitHub
d9ce664350
add test_verify_ast [run_process_replay] ( #6134 )
2024-08-17 14:14:30 +03:00
qazal and GitHub
151a62ad32
hotfix: store dtype for ImageDType ( #6133 )
2024-08-17 13:44:53 +03:00
George Hotz and GitHub
4df4845b47
cache is_int [run_process_replay] ( #6131 )
...
* cache is_int [run_process_replay]
* functools.cached_property is pretty slow
2024-08-17 00:19:03 -07:00
George Hotz and GitHub
3a2d724cb2
extra matcher from renderer [run_process_replay] ( #6130 )
...
* extra matcher from renderer
* cache_pm [run_process_replay]
2024-08-16 23:53:11 -07:00
George Hotz and GitHub
9bc81c6db4
UOps.SHAPETRACKER ( #6129 )
...
* UOps.SHAPETRACKER [run_process_replay]
* no process replay
2024-08-16 23:26:34 -07:00
George Hotz and GitHub
5048066e79
st_arg, never -1 [run_process_replay] ( #6128 )
2024-08-16 22:46:56 -07:00
geohot
9e6ad4b40f
hotfix: free minor speedup
2024-08-16 21:08:03 -07:00
George Hotz and GitHub
912f01ed4b
UOpGraph -> linearize_uop [run_process_replay] ( #6119 )
2024-08-16 19:48:39 -07:00
George Hotz and GitHub
7cae152aa2
move uop logic into shapetracker [run_process_replay] ( #6118 )
2024-08-16 17:47:15 -07:00
George Hotz and GitHub
89c7989659
no shapetracker in ops [run_process_replay] ( #6117 )
2024-08-16 17:23:27 -07:00
George Hotz and GitHub
74ee9febec
remove iter from uopgraph ( #6110 )
...
* remove iter from uopgraph
* linearize returns uops
* fix tests
* linearize in linearize
* tests fix
* touchup
* test failures
2024-08-16 15:58:29 -07:00
28c75bf2a6
merge uops with ops ( #6111 )
...
Co-authored-by: chenyu <[email protected] >
2024-08-16 18:17:57 -04:00
qazal and GitHub
c23d44c779
AST is UOp ( #6030 )
...
* most of the work from the uops2 branch
* schedule
* realize
* kernel
* lowerer
* search
* green
* merge uops with ops
* Revert "merge uops with ops"
This reverts commit 1408a59f12 .
* fix benchmark
* remove extra dedup
2024-08-16 22:09:00 +03:00
George Hotz and GitHub
d6f64c0c1f
do better image indexing [run_process_replay] ( #6109 )
...
* do better image indexing [run_process_replay]
* fix tests
2024-08-16 09:55:22 -07:00
38fb1e14a2
Intel XMX Tensor Core Support ( #5622 )
...
* fixed xmx demo
* i think i'm invoking the DPAS but it's slow
* compiler build arg to stop register spilling, indicated where to fix flop counter
* don't mind this
* do NOT mind me
* do not mind me
* do not view
* i will add bf16 later
* in process of figuring out tc fields
* we figured out the fields!!!
* added check for cl device vendor, added seperate IntelRenderer
* remove tc thread_local_aliases
* cleaning debris before draft pr
* edits for linter
* deduping and checking device extensions
* i will find more line reductions in other places
* before merge upstream
* double grf size in compiler to fix register spilling (bandaid), device checking changes
* tc python emulation
* fixed emulation
* tests for emulated intel tensor core
* TC=0, 1 working on upstream, fixed perf
* test
* debris
* check for specialized cl device when we canonicalize device
* bf16 support, tc=3 test added
* address tests
* revert half2 loads on intel tc, cleanup
* linter
* fold_expanded revert
* lint, whitespace fix
* cuda bf16 (only one with bf16) is skipped in test tensor cores, so i will skip for intel bf16 too
* make line shorter, no need for noqa E501
* removed device intel
* fix python emulation
---------
Co-authored-by: George Hotz <[email protected] >
2024-08-16 09:19:21 -07:00
George Hotz and GitHub
f82ecd8802
remove uop symobilc rendering [run_process_replay] ( #6108 )
2024-08-16 09:02:15 -07:00
chenyu and GitHub
e5da88873b
enable UOP_IS_SYMBOLIC ( #5954 )
2024-08-16 00:15:46 -04:00
George Hotz and GitHub
c850e03758
new test for e2e compile failures ( #6101 )
...
* new test for e2e compile failures
* fix bug
2024-08-15 18:56:22 -07:00
chenyu and GitHub
e4a7869893
move cancel mod pattern into mod_folding ( #6100 )
...
changed some kernel in a good way because x does not go through add chain
2024-08-15 19:04:18 -04:00
qazal and GitHub
11d62668a3
refactor ast ops dtype access [run_process_replay] ( #6093 )
...
* refactor ast ops dtype access [run_process_replay]
* fix assert message
2024-08-15 19:13:33 +03:00
chenyu and GitHub
9ef82e1f2b
UOp pattern DEFINE_VAR with min==max is also CONST ( #6095 )
...
* UOp pattern DEFINE_VAR with min==max is also CONST
* fix tests
2024-08-15 12:09:44 -04:00
qazal and GitHub
25dffb2079
kernel.py more typing [run_process_replay] ( #6092 )
2024-08-15 17:59:24 +03:00
qazal and GitHub
4d38fec8c1
rename lazyops to parents [run_process_replay] ( #6091 )
2024-08-15 17:27:32 +03:00
chenyu and GitHub
5accfe26a0
rewrite bool ADD to OR and MUL to AND ( #6084 )
...
* rewrite bool ADD to OR and MUL to AND
fixed running `tinyphysics.onnx`, which contains a getitem from a boolean tensor.
only can repro through BEAM_COMPARE, which i think is a different bug in test_linearizer_failure
* fold those, and fix tests
* only for bool
* move dtypes.bool
2024-08-15 10:11:57 -04:00
chenyu and GitHub
df03dca6e3
move % inside UOp mod_folding and remove deprecated tests ( #6085 )
...
[run_process_replay]
2024-08-14 23:25:10 -04:00
chenyu and GitHub
95aa6d8ccd
remove redundant x/c pattern [run_process_replay] ( #6082 )
...
there's no div and 1/c is const folded
2024-08-14 16:57:39 -04:00
chenyu and GitHub
a61cb1ff7c
move mod mod pattern into generic mod folding ( #6077 )
2024-08-14 16:24:21 -04:00
chenyu and GitHub
de773b593e
remove redundant div gcd patterns [run_process_replay] ( #6076 )
...
covered by generic div_folding
2024-08-14 13:18:28 -04:00
chenyu and GitHub
1782e4f64d
use div folding to do lt folding ( #6065 )
2024-08-13 16:59:05 -04:00
qazal and GitHub
9145ad52ff
revert UOps eq, this needs to be isolated in realize.py ( #6063 )
...
This reverts commit dccca7f227 .
2024-08-13 18:02:34 +03:00
andredaprato and GitHub
18192079a9
Apply transcendental rewrite rules only if required by backend ( #6061 )
...
* Apply transcendental folding for missing ops
* Remove comments
* Remove Final type
2024-08-12 22:38:45 -07:00
chenyu and GitHub
45bd667a78
rewrite pyint after first rewrite [run_process_replay] ( #6059 )
2024-08-12 19:18:13 -04:00
qazal and GitHub
dccca7f227
test: uop and lazyop have the same compare ( #6053 )
...
* test: uop and lazyop have the same compare
* typings
* self.assert_equiv_uops -> assertEqual
* hash dtype
* test nop too
* TestPatternMatcher never used this compare anyway
* nop eq and ne tests
2024-08-13 00:33:19 +03:00
chenyu and GitHub
3f2d24a6ec
test_failure_48 for wrong truncation in idx on NV ( #6055 )
...
also added `RAWAST` to print pre-modified AST in DEBUG=3
2024-08-12 16:17:42 -04:00
chenyu and GitHub
6ed9711898
UOps pattern (x%c)+(x//c)*c = x ( #6051 )
...
pretty cool that this is very easy to write now
2024-08-12 14:58:48 -04:00
chenyu and GitHub
7ce716b3a0
bigint -> pyint [run_process_replay] ( #6040 )
...
it's a python int. priority should be higher than bool, but we are not using it in type promo now.
2024-08-12 09:12:23 -04:00
qazal and GitHub
059dd35985
minor UOps.RANGE ordering cleanup [run_process_replay] ( #6039 )
...
* range srcs has an extra phi filter
* inline comments _tend_ to be harder to read
2024-08-12 15:33:26 +03:00