Commit Graph
926 Commits
Author SHA1 Message Date
George HotzandGitHub a1a882b006 arange folding with new ge (#6604)
* arange folding with new ge

* bump allowed gated

* bump allowed speed
2024-09-19 18:01:28 +08:00
George HotzandGitHub 224151a958 update indexing with UPat.any [run_process_replay] (#6605) 2024-09-19 17:40:17 +08:00
chenyuandGitHub d148a62f8d more generic simplify_valid_image_load (#6603)
use graph_rewrite to simplify the expression with narrowed variables, and check boundry conditions on monotonically increasing function to drop valid.
2024-09-19 05:33:37 -04:00
George HotzandGitHub 718ecad2ee add UPat.any support [run_process_replay] (#6602)
* add UPat.any support [run_process_replay]

* single arange pattern

* no loop_start and loop_end
2024-09-19 17:11:24 +08:00
George HotzandGitHub 012a2c449a fix lt_folding VCONST issue [run_process_replay] (#6424)
* le and ge [run_process_replay]

* bugfix

* fix divides bug

* fix lt_folding issue
2024-09-19 14:59:20 +08:00
chenyuandGitHub 1ec6bd5125 restructure simplify_valid_image_load [run_process_replay] (#6581)
* restructure simplify_valid_image_load [run_process_replay]

separated parsing valid / idx and simplification

* space

* type
2024-09-18 04:46:41 -04:00
chenyuandGitHub 162ead02a9 remove LOAD where valid is an empty set (#6579)
356 -> 354 valids
2024-09-18 03:49:41 -04:00
chenyuandGitHub a72d51e277 brute force VALIDHACK matching (#6575)
* brute force VALIDHACK matching

* cleanup

* 9700
2024-09-18 01:59:50 -04:00
chenyuandGitHub b947db3de1 don't fold mul mod for common factor (#6566)
it makes valid pattern more annoying
2024-09-17 06:01:27 -04:00
chenyuandGitHub 5fb877c78c generic valid match criteria of #6552 (#6558)
455 -> 364 valids.
generalize `idx < image bound` to `idx < image bound + c` for some `c`
2024-09-17 02:40:36 -04:00
George HotzandGitHub 0ab06d5840 push geps through wmma (#6559)
* push geps through wmma

* update tests
2024-09-17 14:38:40 +08:00
George HotzandGitHub ffce3ed896 add some new rules (#6555)
* add some new rules

* fix that

* non controversial
2024-09-17 13:59:55 +08:00
chenyuandGitHub c62b6fd8f0 match any statement in valid for simplification (#6554) 2024-09-17 01:39:47 -04:00
George HotzandGitHub 006c7c5747 remove unused rules in new expand [run_process_replay] (#6553) 2024-09-17 13:18:18 +08:00
George HotzandGitHub a2239c812e minimum new style expand (#6534)
* minimum new style expand [run_process_replay]

* float4 folding works

* fix uop graph

* if means or

* dype.count idx overload

* fix test arange

* expand nope

* fix expand contract

* fix amd tensor core

* oh, that's a good test with a real failure

* remove prints

* early reduce

* tomorrow, we remove sorted on expand args

* fix wmma issue

* that makes test_arange pass

* vectorized folding

* no check

* broadcast

* fix clang with self assign rule
2024-09-17 13:02:41 +08:00
chenyuandGitHub 7c942418a1 other side of simple out of bound valid case (#6552)
462 -> 455
2024-09-16 23:57:15 -04:00
chenyuandGitHub aeaf7894a7 more generic version of #6548 (#6549)
x*(-1)<0 can be generalized to x*(-1)<c, 473 -> 462 valids
2024-09-16 23:17:16 -04:00
chenyuandGitHub 596f41eb46 simple drop image valid case (#6548)
* simple drop image valid case

started unit test, 530 -> 473 valids

* cleanup
2024-09-16 22:54:07 -04:00
George HotzandGitHub c1b2472dea reorder alu/vectorize (#6538) 2024-09-16 14:28:14 +08:00
George HotzandGitHub 42ba887daa remove logic to vectorize reduces (#6536)
* remove logic to vectorize reduces

* fix tests
2024-09-16 14:04:48 +08:00
George HotzandGitHub 07bd6e070d add more uops tests for vmin/vmax/const_factor/divides (#6533) 2024-09-16 13:06:31 +08:00
ignaciosicaandGitHub c447ec2190 Fix amx shape [run_process_replay] (#6524)
* fix amx shape (sz,sz,sz) -> (sz,sz,1)

* revert check
2024-09-16 09:49:55 +08:00
George HotzandGitHub e1b21879a7 minor changes from new expand [run_process_replay] (#6528)
* minor changes from new expand [run_process_replay]

* explain that
2024-09-16 09:48:37 +08:00
chenyuandGitHub 6be0cc387c _get_add_chain(x) -> _get_chain(x, BinaryOps.ADD) (#6523)
need MUL for valid [run_process_replay]
2024-09-15 10:54:13 -04:00
qazalandGitHub 89b950c6b3 viz more work (#6517)
* infra

* actually replace the UOp

* extra per rewrite

* dont allow pyint
2024-09-15 16:42:17 +08:00
qazalandGitHub f69251c6b4 assert pyint in linearize_uop [run_process_replay] (#6518) 2024-09-15 16:29:05 +08:00
7c078191ce Misc rewrite perf improvements (#6500)
* Make UOp a normal class and use __slots__

* Use __slots__ in UPat

* Cache dtypes.{min,max}

* Use faster iterables in ops.py

* extend is a lot faster than nested listcomp

Co-authored-by: Roelof van Dijk <[email protected]>

---------

Co-authored-by: Roelof van Dijk <[email protected]>
2024-09-13 11:31:50 +08:00
Tim BeckerandGitHub 8c4cab8d6e Even faster enums (#6483)
* Even faster enums

* simpler _generate_next_value impl

* FastEnum in ops only

* Better uniqueness for FastEnum
2024-09-12 20:08:02 +08:00
George HotzandGitHub 9543e4c92e more expand prereqs [run_process_replay] (#6499) 2024-09-12 17:46:12 +08:00
George HotzandGitHub 327eb12600 folding for vectorized consts [run_process_replay] (#6498)
* folding for vectorized consts [run_process_replay]

* remove that if statement

* inf loop
2024-09-12 17:29:37 +08:00
George HotzandGitHub a532d59bbd gep tuple [run_process_replay] (#6495)
* gep tuple [run_process_replay]

* no inf loop, that goes in expander

* fix ops python

* unbreak gep 0

* fix tests

* fix tests

* VECTORIZE/GEP

* oops, broken
2024-09-12 16:37:31 +08:00
George HotzandGitHub 6dfa63cb21 more vconst stuff + gep tuple [run_process_replay] (#6494)
* more vconst stuff [run_process_replay]

* revert that

* fix inf loop
2024-09-12 14:58:14 +08:00
qazalandGitHub 4507ab8016 more upat styling changes [run_process_replay] (#6492)
* more upat styling

* single to doulbe quotes

* wrap line

* comments
2024-09-12 14:40:16 +08:00
George HotzandGitHub 119b0ea4af add UOps.VCONST [run_process_replay] (#6487)
* add UOps.VCONST [run_process_replay]

* VCONST folding

* simpler devectorize

* alu

* revert that type
2024-09-12 14:03:39 +08:00
qazalandGitHub 4dc9436d63 use more UPat.var and UPat.cvar [run_process_replay] (#6491) 2024-09-12 13:52:41 +08:00
George HotzandGitHub 76487a3533 remove nop, use upat [run_process_replay] (#6489)
* remove nop, use upat [run_process_replay]

* mypy passes

* no wonder nothing worked

* fixes
2024-09-12 12:16:19 +08:00
qazalandGitHub dda5c63f4a things we can delete after dtypes.void [run_process_replay] (#6480) 2024-09-11 19:21:41 +08:00
bdd0c06f29 add void type to uop (#6471)
* unwrap_dtype maybe

* uopgraph stuff that hardcoded None

* test_ops passes

* dtypes.py fixups

* update test_linearizer and friends

* more ast updates

* test_beam and test_schedule too

* add void type to uop [run_process_replay]

* remove dumb casts

* start making it green

* more cast cleanups

* more cls methods to fix

* regenerate dataset

* split UOp and NOp const

* maybe that too

* fix docs

* update test_uop_symbolic

* test_verify_ast

* new sops with no diff

* meh, type_ignore is alright

* remove that assert

---------

Co-authored-by: qazal <[email protected]>
2024-09-11 18:16:28 +08:00
George HotzandGitHub 1b4d1823b7 add pyint to DTYPES_DICT [run_process_replay] (#6477)
* add pyint to DTYPES_DICT [run_process_replay]

* also fix uop alu bug

* exclude pyint there too

* ne ne

* force explicit dtype
2024-09-11 17:31:59 +08:00
George HotzandGitHub 1cadddee26 Revert "fold lt (#6472)" (#6473)
This reverts commit 81bda4d304.
2024-09-11 15:59:25 +08:00
George HotzandGitHub 81bda4d304 fold lt (#6472) 2024-09-11 15:56:57 +08:00
chenyuandGitHub d9d1ae7248 more lt folding using gcd (#6469) 2024-09-11 02:09:35 -04:00
chenyuandGitHub 15c4d4f406 fold unrolled arange div pattern (#6465) 2024-09-10 22:35:52 -04:00
George HotzandGitHub 6d195fb653 small changes from new style expand [run_process_replay] (#6462) 2024-09-11 09:10:56 +08:00
qazalandGitHub 1347e49e82 second iteration on UOps.SWIZZLE (#6451)
* new swizzle

* fix the failing tests

* test a double swizzle

* ci
2024-09-10 14:43:21 +08:00
chenyuandGitHub fcc69adfc5 simplify c0*x<c1 for negative int c0,c1 (#6431)
* simplify c0*x<c1 for negative int c0,c1

* fine if rhs is zero
2024-09-09 21:05:53 -04:00
George HotzandGitHub dbd4536167 Revert "add UOps.VALID (#6387)" (#6441)
This reverts commit 8186e4e7d6.
2024-09-09 21:33:00 +08:00
George HotzandGitHub 42e5c8335e remove args from min/max [run_process_replay] (#6430)
* remove args from min/max [run_process_replay]

* it's a ConstType

* sconst_like unused

* any const is fine
2024-09-09 18:18:20 +08:00
8186e4e7d6 add UOps.VALID (#6387)
* uops valid

* broke full_shape

* fixup that st (hardcoded asts still red)

* fixup DEFINE_VAR

debug

more debug

* start moving stuff to ast_const

* move test_linearizer

* move test_linearizer_failures to ast_const

* fixup test_schedule

* small diff change

* regenerate dataset

* fixup test_multitensor

* regen dataset try 2

---------

Co-authored-by: qazal <[email protected]>
2024-09-09 16:58:43 +08:00
chenyuandGitHub ac98f5056e move lt-folding to a function [run_process_replay] (#6422)
and added more tests (some failed to match symbolic)
2024-09-09 02:04:52 -04:00