Commit Graph
1261 Commits
Author SHA1 Message Date
George HotzandGitHub f666dd14eb fix get reduce contraction with test (#9834) 2025-04-10 22:24:21 +08:00
geohot 25e2a3cf5d hotfix: fix get_contraction_with_reduce 2025-04-10 20:18:19 +08:00
George HotzandGitHub 53f0b2aad7 fix infinite loop in flash attention (#9827)
* fix infinite loop in flash attention

* get_contraction_with_reduce

* skip that test

* SINGLE_KERNEL_SOFTMAX + fix multi

* default IGNORE_OOB

* print change
2025-04-10 20:06:44 +08:00
George HotzandGitHub fce432d2e3 Ops.FUSE makes softmax a single kernel (#9808)
* KERNELIZE makes softmax a single kernel

* single kernel works

* softmax works

* broken

* correct

* skip that test

* kernelize tests

* rename to fuse

* better reduce_push_add_ones code

* correct now

* cleanups

* oops

* return None if we can't push ones

* rename + docs

* atol fixes group

* flash attention broken test
2025-04-09 22:56:28 +08:00
George HotzandGitHub bb18adb0d5 reduce with a mul chain (#9799)
* reduce with a mul chain

* inside is just 1
2025-04-09 12:42:32 +08:00
qazalandGitHub f13e9cf2d9 move view_left to grouper.py + tiny reorders [pr] (#9780)
* move view_left to grouper.py [pr]

* reorder grouper

* test_schedule
2025-04-08 15:39:28 +08:00
George HotzandGitHub fefee5d3ab single kernel softmax (#9776)
* real single kernel softmax

* cleanup

* fix blockend insertion

* add to bert test
2025-04-08 12:35:48 +08:00
07d1aefaf4 fast idiv (#9755)
* fast idiv with tests and fuzzer

* Add todo comment

* Add env variable to toggle fast_idiv

* Move env check

* Add fuzz fast_idiv to ci

---------

Co-authored-by: chenyu <[email protected]>
2025-04-07 08:32:24 -04:00
George HotzandGitHub 28e06d2d44 minor cleanups from patternmatcher [pr] (#9756) 2025-04-07 11:28:14 +08:00
chenyuandGitHub 407ca54382 symbolic fold double where (#9436)
* symbolic fold double where

a.where(b.where(c, d), d) -> (a & b).where(c, d). a pattern in optimizer

* test case
2025-04-05 05:12:17 -04:00
9c2fc695b5 cond.logical_not().where(a,b) -> cond.where(b,a) (#9741)
* Add rule for negation in where, simplifies arange patterns

* 0 becomes 0.0 again

* Only if cond is bool

* ne is never None

* Add a test

---------

Co-authored-by: chenyu <[email protected]>
2025-04-04 19:13:32 -04:00
Sieds LyklesandGitHub e9a3ac02a5 Remove ne from arange pattern (#9743) 2025-04-04 18:31:13 -04:00
qazalandGitHub 16d6aa15f1 record unittest name in process replay (#9731)
* record unittest name in process replay

* getitem

* filename + (optional) name

* del

* get_test_method

* not solved

* try with linecache

* test: print_loc

* format

* without linecache

* checkout master
2025-04-05 01:39:48 +08:00
George HotzandGitHub b719aa1fb0 only check once for divisible fold lengths (#9732) 2025-04-04 11:27:34 +08:00
George HotzandGitHub 8206c7281e move const multiply after REDUCE (#9730) 2025-04-04 11:07:46 +08:00
George HotzandGitHub cac8bcf8b5 use Ops.REDUCE (#9721)
* decrease bert python time [pr]

* order copies

* Revert "order copies"

This reverts commit 3f62c8693b.

* rewrite count

* Ops.REDUCE

* acc first in the add chain

* Fix tensor core acc

* arange patterns look good

* fix multireduce gate

* reduce rewrite rule

* bump that to 15 minutes

* multiwmma isn't fusing

* gep through wmma is gep pushing

* bump that timeout too, it's all env setup

* add failing test
2025-04-04 10:14:34 +08:00
qazalandGitHub 52a8ecb15e record unittest location in process replay [pr] (#9727) 2025-04-03 20:50:09 +08:00
George HotzandGitHub 49dafe6d43 add gc tests [pr] (#9718)
* add gc tests [pr]

* del

* more gc tests

* add NullGraph
2025-04-03 14:08:32 +08:00
George HotzandGitHub 5c7b549eab use functools.cache instead of lru_cache(None) [pr] (#9714)
* use functools.cache instead of lru_cache(None) [pr]

* more cache
2025-04-03 11:47:13 +08:00
George HotzandGitHub 1714fc3ba4 start work on speed [pr] (#9707)
* fix get_location

* fix get_location try 2

* clean up split_load_store [pr]

* SHR fixup [pr]
2025-04-03 10:39:01 +08:00
George HotzandGitHub ea5caefef0 gep should look at count, not vcount (#9698)
* gep should look at count, not vcount

* gep in order is a rule

* min change

* gep on void
2025-04-02 18:10:57 +08:00
George HotzandGitHub f72a87fd0e add proper support for Ops.IGNORE to remove store masks (#9692)
* add proper support for Ops.IGNORE to remove store masks

* remove useless NHWC

* revert that
2025-04-02 16:38:01 +08:00
e78e8722dc Revert "LDS noop and spec (#9669)" (#9691)
This reverts commit 870b545ace.

Co-authored-by: Ignacio Sica <[email protected]>
2025-04-02 15:31:32 +08:00
George HotzandGitHub 4514fd91c1 more stuff from DSP (#9689)
* more good stuff from dsp branch

* test pkl imagenet
2025-04-02 15:27:48 +08:00
George HotzandGitHub 6f812d3f2f fixes from the dsp branch + 12500 lines (#9683)
* fixes from the dsp branch

* more changes

* those are gep pushing
2025-04-02 13:07:17 +08:00
qazalandGitHub bb94f13e58 add RECORD_TRACEBACKS=1 option to process replay (#9679)
* add RECORD_TRACEBACKS=1 option to process replay

* stack
2025-04-02 11:58:27 +08:00
chenyuandGitHub 3acc1b928a minor div_and_mod_folding cleanup [pr] (#9681)
it's not wrong because the dtype is never used, but `x.const_like` is more readable
2025-04-01 23:51:36 -04:00
chenyuandGitHub 8dd88ad476 don't div_and_mod_folding for negative numerator with remainder (#9674)
can be wrong in C div since it truncates towards zero
2025-04-01 16:26:23 -04:00
Ignacio SicaandGitHub 870b545ace LDS noop and spec (#9669)
* init lds noop and lds_0 spec

* refactor lds helper test

* fix typo

* test all lds at the same time

* change comment

* comment

* start test_lds_full

* test_lds_tc

* add tc spec
2025-04-01 18:44:55 +08:00
Ignacio SicaandGitHub 846ef84cda move uops print to debug >= 6 (#9659) 2025-04-01 10:29:09 +08:00
George HotzandGitHub e4c545b396 linearizer fix from dsp branch (#9641)
* linearizer fix from dsp branch

* revert that
2025-03-31 14:26:39 +08:00
George HotzandGitHub 49b1c46d16 good changes from the dsp branch (#9638) 2025-03-31 13:02:53 +08:00
chenyuandGitHub 5358b0904b update uop_given_valid if a node becomes const (#9604)
* update uop_given_valid if a node becomes const

* cleanup
2025-03-27 14:57:46 -04:00
George HotzandGitHub d62ced8981 symbolic -> symbolic_flat (#9588) 2025-03-26 23:34:43 +08:00
George HotzandGitHub 8aaa5e1ec5 generate the individual indexes (#9587) 2025-03-26 22:32:06 +08:00
George HotzandGitHub 5c6cd884e3 multiple simplifies is faster [pr] (#9586)
* multiple simplifies is faster [pr]

* cleanup

* cleanup
2025-03-26 21:42:52 +08:00
George HotzandGitHub 1e6e75e39a little changes from dsp branch (#9582)
* little changes from dsp branch

* not that one

* need the where

* Revert "need the where"

This reverts commit 140f89c878.
2025-03-26 20:01:21 +08:00
George HotzandGitHub 9115ce8860 linearizer fixups from DSP branch (#9581) 2025-03-26 18:28:15 +08:00
chenyuandGitHub cddd750d68 add a failed test case for jit/nojit rand [pr] (#9574)
currently adding jit produced different rand values
2025-03-25 13:32:44 -04:00
geohot de7d6cec3a hotfix: DEBUG 5 prints the ast 2025-03-24 11:43:11 +08:00
Ignacio SicaandGitHub eddafb84e5 Bugfix for TC=3 (#9464)
* wrong but uses less shared

* for size 8 tc1 with devectorize in 0 loads into local before wmma and works

* improvements over tc1 devectorize

* fix tc=3

* works for handcoded tc opts

* clean bugfix tc=3

* fix

* revert changes
2025-03-21 16:43:42 -07:00
chenyuandGitHub 6da78164f9 assert Kernel ast.op to be Ops.SINK [pr] (#9539)
rest of the code assumes self.ast is defined anyway
2025-03-21 18:09:44 -04:00
Sieds LyklesandGitHub 3ad3ac4d1e Change dtypes.int to dtypes.ints (#9517) 2025-03-20 17:24:26 -04:00
qazalandGitHub 0b20f91ce7 remove move_mask from the devectorizer (#9511)
* remove move_mask from the devectorizer

* add (wrong) ptx

* reason

* enable index addition in PTX, we won't have the INDEX anyways

* space
2025-03-20 11:53:12 +08:00
qazalandGitHub 2223b93338 add UPat.or_casted [pr] (#9513) 2025-03-20 10:08:32 +08:00
George HotzandGitHub 824c5f41ac dsp work try 3 (#9475)
* dsp work try 3

* padding
2025-03-17 16:42:12 +08:00
George HotzandGitHub 242daa4f9a ptrcat (#9473) 2025-03-17 16:06:37 +08:00
George HotzandGitHub 52ae9af4dd Fast DSP for MobileNetV2 (try 2) (#9467)
* Fast DSP for MobileNetV2 (try 2)

* enable fast path on uchar

* fix tests
2025-03-17 15:10:36 +08:00
George HotzandGitHub cb7a7f69c7 quantization preprocessor from DSP, should be universal (#9437)
* quantization preprocessor from DSP, should be universal

* touchups

* fix tests
2025-03-15 07:49:37 +08:00
chenyuandGitHub ca5064a5b6 remove Kernel.float4_axis [pr] (#9448) 2025-03-14 17:54:32 -04:00