Commit Graph
1310 Commits
Author SHA1 Message Date
75dcd98e79 Fix calculation of vmin and vmax in multiplication when one src is negative and the other src has negative min and positive max (#7333)
Co-authored-by: chenyu <[email protected]>
2024-10-28 16:01:46 -04:00
chenyuandGitHub 4c855ae692 unit test transcendental helpers (#7325)
added a test to run UOps with const inputs. seems to have issue with both payne_hanek_reduction and cody_waite_reduction
2024-10-27 19:55:00 -04:00
chenyuandGitHub d66fe7a66f fix simplify_valid (#7313)
the simplex should compare with valid bound, not its vmin
2024-10-26 14:21:12 -04:00
chenyuandGitHub 0a4d01f6d4 disable simplify_valid (#7312)
fixed test_failure_55. will reenable it later after fixing the bug
2024-10-26 12:42:48 -04:00
chenyuandGitHub e7cd21c5e3 remove custom render in test_simplify_valid_idx (#7303)
use UOp render to compare
2024-10-25 10:20:26 -04:00
George HotzandGitHub 199a991237 line reduction [pr] (#7296) 2024-10-25 17:05:09 +07:00
George HotzandGitHub 4812801aa6 try for canonical order (#7286)
* try for canonical order

* cmp better

* disable bad tests

* flip const order

* fix test

* fix tests

* different fix for NOOP

* metaclass here

* fix tests

* narrower scope
2024-10-25 16:04:54 +08:00
George HotzandGitHub 004af512e6 try all matches in the function (#7288) 2024-10-25 14:17:04 +08:00
chenyuandGitHub 90f720d703 limit idiv by neg bound to only if s0 is non-negative [pr] (#7277)
also updated the tests when div by negative const
2024-10-24 15:46:50 -04:00
George HotzandGitHub 63048ad880 don't recreate COMMUTATIVE the other way (#7255)
* don't recreate COMMUTATIVE the other way

* add shl and add passing test

* fix tests and move assignment to __new__

* that can stay there

* happy mypy
2024-10-24 14:38:29 +08:00
chenyuandGitHub e90bbe6bbc failed test cases for 3+ views shapetracker strides (#7226) 2024-10-22 18:49:13 -04:00
George HotzandGitHub 4013c9848c don't use tons of memory for tests non CI [pr] (#7209)
* don't use tons of memory for tests

* fix import and clean up pre-commit

* use pathlib

* no shm on windows

* Revert "use pathlib"

This reverts commit 7c38489820.

* run pre-commit hooks in test

* ugh, fix later
2024-10-22 15:04:51 +08:00
George HotzandGitHub be64ac417e move GGUF test to it's own file [pr] (#7208)
* move GGUF test to it's own file [pr]

* skip tests if modules aren't installed
2024-10-22 13:24:55 +08:00
chenyuandGitHub f37e6b453b load_gguf -> gguf_load in doc and test (#7199) 2024-10-21 14:03:33 -04:00
leopfandGitHub 815e1a340c GGUF Cleanup - raise if type is not supported (#7194)
* raise if ggml type is unsupported

* test raise
2024-10-21 11:32:11 -04:00
leopfandGitHub 87877d7a91 GGUF cleanup (#7192)
* cleanup

* remove vocab size hard code
2024-10-21 10:44:54 -04:00
chenyuandGitHub 08a3b97ddc more generic lt_folding (#7171)
* more generic lt_folding

instead of checking gcd for all uop, check the gcd of the ones that have const_factor() > 1 and still can simplify if others are smallish

* fixed that stride too
2024-10-21 09:41:02 -04:00
George HotzandGitHub be1806df47 fast sym infer [pr] (#7177)
* fast sym infer [pr]

* fix pylint
2024-10-21 17:31:32 +08:00
b6d9b276bb GGUF support (#7046)
* basic loader, untested

* testing

* remove utils import in test

* q8_0

* q4_1

* end to end testing

* minor cleanup

* fix casting

* moved to state

* move tests

* move dequant to fn

* fix lint elif

* remove gguf from extra

* fix dict union

* q6_k simpler

* naming and spacing

* gpt2-gguf example

* cleanup

* move gguf example

* minor cleanup

---------

Co-authored-by: George Hotz <[email protected]>
2024-10-21 16:15:34 +08:00
chenyuandGitHub 98de58260b simplify valid itself (#7112) 2024-10-19 19:39:25 -04:00
Bhavya GadaandGitHub 534597e753 fix all test warnings (#7024)
* fix pytorch warning in nn.conv2d for same padding

* fix future warning in torch load

* fix overflow warning in tensor list test: https://github.com/numpy/numpy/issues/23606#issuecomment-1512752172

* fix floating point warnings in dtype tests using docs https://numpy.org/doc/stable/reference/generated/numpy.errstate.html and a neat solution https://stackoverflow.com/questions/53634965/change-np-seterr-behavior-inside-a-function-only

* put err state in one place; comment taken care of by function hover

* enter np errstate context manager on test setup

* put decorator on class
2024-10-18 08:56:40 +08:00
chenyuandGitHub 0cd4b93441 remove CStyleLanguage from test_uop_symbolic (#7142) 2024-10-17 19:39:34 -04:00
chenyuandGitHub 72ed66205d enable test_resnet_half (#7141)
already worked so just fixed the test
2024-10-17 19:02:20 -04:00
George HotzandGitHub ded1b38b84 minor dtype cleanup [pr] (#7124)
* minor dtype cleanup [pr]

* use ptr() function
2024-10-17 17:41:23 +08:00
George HotzandGitHub d990a16326 fix tests to use render (#7116) 2024-10-17 14:35:22 +08:00
chenyuandGitHub 842fe444df test case for valid only simplification (#7108) 2024-10-16 16:40:46 -04:00
90eff347e2 tinytqdm write support (#6359)
* add write support

* add test

* update test case to compare write outputs

* assert final write output

* flush when using write

* update write logic

* Revert "update write logic"

This reverts commit 5e0e611b46.

---------

Co-authored-by: chenyu <[email protected]>
2024-10-16 14:51:41 -04:00
chenyuandGitHub 2008bac6bf use validhack logic to rewrite buffer idx (#6740)
* use validhack logic to rewrite buffer idx

saved a whopping one mod in the conv backward kernel...

* cleanup more
2024-10-14 16:47:31 -04:00
chenyuandGitHub a99e42cf2f clean up test_uop_symbolic.py (#7058)
enable more tests and remove dead tests
2024-10-14 15:35:58 -04:00
chenyuandGitHub bd8ecf7fd6 remove NumNode (#7035) 2024-10-13 16:42:19 -04:00
George HotzandGitHub 85a45164fb remove pyint [pr] (#7016)
* remove pyint

* bump time on tp [pr]

* dont truncate in const fold

* remove dead code

* Revert "dont truncate in const fold"

This reverts commit 29c81db0f7.

* remove define_var
2024-10-12 22:36:24 +08:00
George HotzandGitHub a71bb09ec3 remove symbolic file [pr] (#7012) 2024-10-12 18:44:44 +08:00
George HotzandGitHub 5ae2de9845 UOp.variable (#7010)
* UOp.variable [pr]

* fix tests

* clean

* improve name rendering

* last bug
2024-10-12 18:20:44 +08:00
George HotzandGitHub e7a0ffe46a break out linearization [pr] (#6994) 2024-10-11 15:27:33 +08:00
chenyuandGitHub e3dc10f8f6 improve fold_unrolled_divs (#6977)
addressed #6935
the first few terms in fold_unrolled_divs might have been folded already, so the check should first try to add those terms back. there is a case that every but one term is folded which is not an add chain anymore, so just added as a failed test case for now
2024-10-10 10:52:05 -04:00
chenyuandGitHub 08414d7b7c cleanup test_uop_symbolic.py (#6894)
no more test_symbolic for reference, so force expected output to be exact instead of a set
2024-10-04 20:53:10 -04:00
ignaciosicaandGitHub 555bcb5e54 static access for code_for_op (#6889) 2024-10-05 07:38:01 +08:00
George HotzandGitHub a0cb16ac61 node cleanup + local metal test speed [pr] (#6880)
* node cleanup [pr]

* fix tests, including the double one on metal

* no time tqdm tests
2024-10-04 18:14:23 +08:00
George HotzandGitHub cdff1d75b6 things that are only used in one place don't belong in helpers [pr] (#6878)
* things that are only used in one place don't belong in helpers [pr]

* pretty print moved
2024-10-04 17:27:38 +08:00
George HotzandGitHub f4ec39fe58 switch symbolic from old to uops, final PR (#6872)
* switch symbolic from old to uops, final PR

* two wrong answers

* not needed resolves

* symbolic ops passes

* symbolic ops passes

* progress

* tests pass (almost)

* fix last test

* fix some tests

* global binding and unbinding

* Revert "global binding and unbinding"

This reverts commit 9456725630.

* that test works now

* vars on uop doesn't recurse

* fix fuzzer

* update

* fix type

* fix gpt, it's UOp now

* ssimplify symbolics
2024-10-04 16:42:27 +08:00
George HotzandGitHub 738a5794a9 last update for new symbolic [pr] (#6877) 2024-10-04 14:58:51 +08:00
George HotzandGitHub e10245909a explore global uop cache [pr] (#6863)
* explore global uop cache

* wvd uops

* remove useless lru caches

* key is is

* simpler rewriter
2024-10-03 13:08:13 +08:00
chenyuandGitHub c3c93f332a symbolic bool raise ValueError when not sure [pr] (#6853) 2024-10-02 09:10:58 -04:00
George HotzandGitHub 7214450c23 little symbolic changes [pr] (#6849)
* little symbolic changes [pr]

* symbolic needs resolve too

* no resolve

* less change
2024-10-02 17:12:30 +08:00
George HotzandGitHub be12409b51 changes for symbolic (#6844)
* changes for symbolic

* only for ints

* check int first
2024-10-02 12:57:16 +08:00
geohot 100ce7a684 hotfix: min/max on CMPNE was wrong 2024-10-02 10:15:03 +08:00
George HotzandGitHub 1ac83aaa4b lil sym changes (#6837)
* lil sym changes [pr]

* fix inf crap

* Update ops.py

* remove that, it's wrong
2024-10-02 09:54:17 +08:00
George HotzandGitHub 84726e8855 good changes from symbolic removal [run_process_replay] (#6835)
* good changes from symbolic removal [run_process_replay]

* fix __ne__
2024-10-01 18:49:09 +08:00
George HotzandGitHub e907b25792 move some pm rules to uopgraph.py [run_process_replay] (#6831)
* move some pm rules to uopgraph.py [run_process_replay]

* move more

* move lt and clean

* end maybe

* put back
2024-10-01 18:28:41 +08:00
George HotzandGitHub 8a93c48901 pickle main pattern matcher [run_process_replay] (#6827)
* pickle main pattern matcher [run_process_replay]

* del line
2024-10-01 13:58:42 +08:00