Commit Graph
1119 Commits
Author SHA1 Message Date
George HotzandGitHub 8f65c1fafb simpler block reorder function [pr] (#8031)
* simpler block reorder function [pr]

* simpler

* block_reorder in substitute, so wasteful otherwise

* extend and count

* leave push logic for same order

* sort new ctx

* less loop

* Revert "less loop"

This reverts commit 30249d097a.
2024-12-04 17:57:35 +08:00
George HotzandGitHub bb98bae751 local reordering in block (#8029)
* local reordering in block

* load (and parents) is highest priority

* minor loads in order

* comments

* explicit depth

* simpler

* matters less, but store early too
2024-12-04 15:11:29 +08:00
George HotzandGitHub fdd1e56827 clean up rewrite logic + merge siblings (#8026)
* clean up rewrite logic [pr]

* simpler

* merge sibling blocks

* no PR
2024-12-04 13:26:16 +08:00
chenyuandGitHub 0c060fa040 update uop and tests to not use lt/gt/le/ge [pr] (#8023)
just use dunder methods, eventually remove those from ops
2024-12-03 21:02:52 -05:00
George HotzandGitHub b8bf5b2787 minor uop speedups [pr] (#8002)
* minor uop cleaner [pr]

* free uop creation speed by removing WeakValueDictionary

* a lil faster

* disable that test

* lines

* and it doesn't print non hit patterns
2024-12-03 17:04:48 +08:00
George HotzandGitHub 1028b34a20 add typing to basicblocks (#7999) 2024-12-03 15:05:11 +08:00
George HotzandGitHub 0c7477b108 no bool in range [pr] (#7988)
* no bool in range [pr]

* fix llvm

* add arg to range spec

* fix broken test

* forgot this one

* hotfix: test_tiny jit is a real test
2024-12-02 19:05:16 +08:00
George HotzandGitHub 61b2cac507 basicblock is dataclass (#7985)
* basicblock is dataclass [pr]

* tiny cleanups
2024-12-02 16:48:39 +08:00
George HotzandGitHub 275951b730 clean up a few parents -> toposort [pr] (#7984)
* clean up a few parents -> toposort [pr]

* rename to old_parents + sched tests

* a few more

* that one

* second to last

* final
2024-12-02 15:59:31 +08:00
George HotzandGitHub f17af70d17 replace all sparents with toposort (#7983) 2024-12-02 15:00:30 +08:00
George HotzandGitHub b09310d8c2 add toposort method to uops, faster linearize [pr] (#7982)
* add toposort method to uops, faster linearize [pr]

* trust the toposort

* all toposort

* Revert "all toposort"

This reverts commit db123adfda.
2024-12-02 14:46:16 +08:00
George HotzandGitHub cbcc1c20eb second try at block linearize (#7892)
* second try at block linearize

* weeee, works for lil matmul

* it's so beautiful

* test tiny passes

* fix bugs

* combine matching BLOCKENDS

* wrapping

* test lin failures passes

* those failures were fake

* flip sort order

* fix ptx tests

* deal with store better

* dumb ptx fix

* expect less

* reduce lines

* reduce lines

* less lines and cleaner

* no defaultdict

* tighter

* simpler block_parent_count
2024-12-02 13:43:09 +08:00
90e2b2d577 Remove gated store, put rewrite to uopgraph [pr] (#7975)
* update test for gated store

* put gated store rewrite to uopgraph, rm from ptx

* update test

update test

update test

* remove gated st rewrite in llvm

* lint

---------

Co-authored-by: Mesozoic Egg <[email protected]>
Co-authored-by: George Hotz <[email protected]>
2024-12-02 12:33:16 +08:00
ignaciosicaandGitHub 6e47dc8921 true tc swizzle [pr] (#7951)
* true tc swizzle

* cleanup

* fix linter
2024-11-29 14:39:46 +08:00
qazalandGitHub ceda43ce75 always swizzle load st in wmma [pr] (#7908) 2024-11-26 20:00:58 +08:00
qazalandGitHub 5b2c03e865 defer realize folding to kernel splitting [pr] (#7849)
* defer realize folding to schedule breaking [pr]

* this is init

* p2

* need to lookup edges

* refactor image cast folding [pr]

* Ops.LOAD diff

* image works

* refactor can_pad

* fix fold_img_cast
2024-11-23 14:29:14 +08:00
chenyuandGitHub a352a6938f simplify group_for_reduces in get_index [pr] (#7851)
what was that
2024-11-22 11:53:21 -05:00
chenyuandGitHub af5d77f684 move sint_to_uop from view.py to ops.py [pr] (#7848)
both sint and uop are in ops.py
2024-11-22 11:15:02 -05:00
chenyuandGitHub f6d1201c48 variable_to_uop -> sint_to_uop [pr] (#7847)
and added type to it
2024-11-22 10:54:59 -05:00
George HotzandGitHub c5d458ce02 BufferSpec and ProgramSpec [pr] (#7814)
* BufferSpec and ProgramSpec [pr]

* delete preallocate, it's unused

* Revert "delete preallocate, it's unused"

This reverts commit dcfcfaccde.
2024-11-21 12:18:05 +08:00
f02462c5cb swizzle tc [pr] (#7633)
* swizzle tc draft

* further cleanup

* hotfix: remove typing from fix_st and cleanup

* hotfix: revert cache property (moved into separate pr)

* hotfix

* hotfix: rename

* take patterns from schedule

* hotfix: rename vars

* hotfix

* no more view of store

* hotfix: linter

* as view is only used for tc fix up and tc is only enabled for LOAD, remove valid an preload from pm rule

- also remove inner simplify in fix_st

* add typing to fix_st

---------

Co-authored-by: qazal <[email protected]>
2024-11-18 21:08:21 +08:00
597a239e28 Remove UnaryOps, BinaryOps, TernaryOps, MetaOps [pr] (#7725)
* remove unaryops

* remove ternaryops

* remove metaops

* hotfix

* remove binaryops

* hotfix: test_pattern_matcher

---------

Co-authored-by: qazal <[email protected]>
2024-11-16 20:56:56 +08:00
Roelof van DijkandGitHub e75a855f51 refactor: efficient syntax [pr] (#7673) 2024-11-13 11:08:48 -05:00
Roelof van DijkandGitHub 433ebecee7 refactor: double if statement [pr] (#7674) 2024-11-13 11:06:59 -05:00
George HotzandGitHub 4f1f823021 add tiny test for randomness + remove ulong buffers (#7648)
* add tiny test for randomness

* Tensor._device_seeds is a Tuple

* no tuple, just a 2 element tensor

* no more longs

* fix tests, and maybe ocelot works now

* NV still doesn't work. cleanup rules

* test + two more rules
2024-11-12 12:45:52 +08:00
qazalandGitHub 9d6b03d691 early assert swizzle in kernel [pr] (#7610)
* early assert swizzle in kernel [pr]

* better

* note changes

* TestIndexing 2
2024-11-09 21:54:43 +08:00
qazalandGitHub 773b036c61 share can_pad in ops [pr] (#7550) 2024-11-05 17:58:50 +08:00
George HotzandGitHub 075bdb81b3 remove Ops.REDUCE (#7541) 2024-11-05 09:41:28 +08:00
George HotzandGitHub ab14fc1f5b GroupOp.Irreducible [pr] (#7540) 2024-11-05 09:35:34 +08:00
George HotzandGitHub d30537494a remove do_reduce [pr] (#7536) 2024-11-05 01:46:11 +08:00
George HotzandGitHub cb57774b64 pre index load and store [pr] (#7535)
* pre index load and store [pr]

* check ptrtype
2024-11-05 01:21:14 +08:00
George HotzandGitHub 76cc59940d only match with op, not arg [pr] (#7534) 2024-11-05 00:43:17 +08:00
George HotzandGitHub 99bd4372a5 Ops.ALU is no more, the arg is just an op (#7525)
* op arg alu [pr]

* more

* more passing

* fix more tests

* more tests passing

* fix single failing test

* so much cleaner

* noop to not have process replay trigger

* fix ptx
2024-11-05 00:22:22 +08:00
George HotzandGitHub e2204378d9 more GroupOp [pr] (#7524) 2024-11-04 18:40:06 +08:00
George HotzandGitHub c1585bcc9e flatten ops (#7523)
* flatten ops

* fix mypy
2024-11-04 18:07:23 +08:00
bac251d2c1 idx_load_store in lowerer [pr] (#7477)
* idx_load_store in lowerer [pr]

* fix tests (#7513)

Co-authored-by: John Doe <[email protected]>

* work

---------

Co-authored-by: Carl Basho <[email protected]>
Co-authored-by: John Doe <[email protected]>
2024-11-04 10:18:40 +08:00
chenyuandGitHub 7758f7211b Revert "s/UPat/Pat (#7506)" [pr] (#7517)
* Revert "s/UPat/Pat (#7506)"

This reverts commit 400011a8c1.

* fix
2024-11-03 16:33:02 -05:00
chenyuandGitHub 400011a8c1 s/UPat/Pat (#7506) 2024-11-03 08:26:19 -05:00
qazalandGitHub 37f8578953 s/BUFFER_UOPS/BUFOPS (#7501) 2024-11-03 10:17:33 +02:00
George HotzandGitHub c8bf09b7d4 s/UOps/Ops (#7500)
* s/UOps/Ops [pr]

* fix
2024-11-03 11:26:10 +08:00
George HotzandGitHub 06f476b371 late transcendental (#7498) 2024-11-03 10:53:58 +08:00
chenyuandGitHub baaec39ffc update get_transcendental_patterns [pr] (#7489)
i think ths is better than `(p[0], cast(Callable, p[1]))`
2024-11-02 14:25:31 -04:00
chenyuandGitHub 55bd136746 clean up reshape_and_permute (#7488)
probably will rewrite it later as reshape and permute function on Kernel, but for now it's shorter with better types
2024-11-02 13:44:14 -04:00
chenyuandGitHub 74c7b9d84a clean up Kernel.name (#7486)
* clean up Kernel.name

* narrow that str
2024-11-02 12:48:37 -04:00
ignaciosicaandGitHub 18bd98c203 Add shl and shr to llvmir (#7449)
* add shl and shr to llvmir

* hotfix: enforce type alignment for shr and shl in all backends

* hotfix: change shl and shr spec

* hotfix: typo

* hotfix: refactor shl and shr rules and add casting to ptx shl

* hotfix: bug

* hotfix: ptx shl and shr require buint32

* hotfix: cleanups
2024-11-01 23:49:34 +08:00
George HotzandGitHub fe78ed8cb7 improve match speed [pr] (#7465)
* improve match speed [pr]

* no sym in expand

* remove useless rule, sym back

* don't track that
2024-11-01 17:33:53 +08:00
George HotzandGitHub a7ba3d2d91 move reduce to lowerer [pr] (#7462)
* move reduce to lowerer [pr]

* simpler
2024-11-01 16:39:20 +08:00
George HotzandGitHub 2cfca230b5 reduce collapse as a rule (#7464)
* reduce collapse as a rule

* better [pr]

* cleaner
2024-11-01 16:25:44 +08:00
George HotzandGitHub 4f6cf1f8cc expand DEFINE_ACC [pr] (#7461) 2024-11-01 15:20:43 +08:00
chenyuandGitHub a21434504b update payne_hanek_reduction [pr] (#7455) 2024-10-31 18:41:22 -04:00