George Hotz
a7ba3d2d91
move reduce to lowerer [pr] ( #7462 )
...
* move reduce to lowerer [pr]
* simpler
2024-11-01 16:39:20 +08:00
chenyu
a21434504b
update payne_hanek_reduction [pr] ( #7455 )
2024-10-31 18:41:22 -04:00
chenyu
4065c3dec8
remove special 0 case in frexp ( #7450 )
...
we can safely assume input is non-zero, also removed unneeded bitcast
2024-10-31 13:02:33 -04:00
chenyu
0739895b4d
tiny clena up pow2if and payne_hanek_reduction ( #7423 )
2024-10-30 22:22:48 -04:00
chenyu
118dd7721f
clean up transcendental.rintk [pr] ( #7422 )
...
added unit tests and updated the comment. it's rounding away from 0 for negatives
2024-10-30 20:37:28 -04:00
chenyu
16e60d25b9
move polyN to helper [pr] ( #7405 )
...
also move `eval_uop` to `test.helpers`
2024-10-30 10:09:57 -04:00
chenyu
6bf38c35e5
clean up transcendental frexp [pr] ( #7384 )
...
also added some unit tests for frexp
2024-10-29 18:51:37 -04:00
chenyu
d3c192b056
Device method cleanup [pr] ( #7375 )
2024-10-29 12:49:47 -04:00
George Hotz
2cfc7b6695
Index everywhere 2 ( #7363 )
...
* indexing everywhere [pr]
* fix tests
2024-10-29 19:29:40 +08:00
George Hotz
572499c71a
add indexing to ops_python ( #7358 )
...
* add indexing to ops_python
* fix image
2024-10-29 18:11:03 +08:00
George Hotz
b647fa7514
rename MathTraits to maximum [pr] ( #7356 )
2024-10-29 16:43:04 +08:00
George Hotz
3989bd2682
idiv + reciprocal [pr] ( #7354 )
...
* idiv + reciprocal
* remove upcast from div
* fix docs
2024-10-29 15:54:19 +08:00
chenyu
c398f2467c
test uop mul min/max do not have nan in 0*inf ( #7340 )
2024-10-28 17:52:01 -04:00
Sieds Lykles
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 <chenyu@fastmail.com >
2024-10-28 16:01:46 -04:00
chenyu
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
chenyu
d66fe7a66f
fix simplify_valid ( #7313 )
...
the simplex should compare with valid bound, not its vmin
2024-10-26 14:21:12 -04:00
chenyu
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
chenyu
e7cd21c5e3
remove custom render in test_simplify_valid_idx ( #7303 )
...
use UOp render to compare
2024-10-25 10:20:26 -04:00
George Hotz
199a991237
line reduction [pr] ( #7296 )
2024-10-25 17:05:09 +07:00
George Hotz
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 Hotz
004af512e6
try all matches in the function ( #7288 )
2024-10-25 14:17:04 +08:00
chenyu
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 Hotz
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
chenyu
e90bbe6bbc
failed test cases for 3+ views shapetracker strides ( #7226 )
2024-10-22 18:49:13 -04:00
George Hotz
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 Hotz
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
chenyu
f37e6b453b
load_gguf -> gguf_load in doc and test ( #7199 )
2024-10-21 14:03:33 -04:00
leopf
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
leopf
87877d7a91
GGUF cleanup ( #7192 )
...
* cleanup
* remove vocab size hard code
2024-10-21 10:44:54 -04:00
chenyu
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 Hotz
be1806df47
fast sym infer [pr] ( #7177 )
...
* fast sym infer [pr]
* fix pylint
2024-10-21 17:31:32 +08:00
leopf
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 <72895+geohot@users.noreply.github.com >
2024-10-21 16:15:34 +08:00
chenyu
98de58260b
simplify valid itself ( #7112 )
2024-10-19 19:39:25 -04:00
Bhavya Gada
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
chenyu
0cd4b93441
remove CStyleLanguage from test_uop_symbolic ( #7142 )
2024-10-17 19:39:34 -04:00
chenyu
72ed66205d
enable test_resnet_half ( #7141 )
...
already worked so just fixed the test
2024-10-17 19:02:20 -04:00
George Hotz
ded1b38b84
minor dtype cleanup [pr] ( #7124 )
...
* minor dtype cleanup [pr]
* use ptr() function
2024-10-17 17:41:23 +08:00
George Hotz
d990a16326
fix tests to use render ( #7116 )
2024-10-17 14:35:22 +08:00
chenyu
842fe444df
test case for valid only simplification ( #7108 )
2024-10-16 16:40:46 -04:00
Francis Lata
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 <chenyu@fastmail.com >
2024-10-16 14:51:41 -04:00
chenyu
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
chenyu
a99e42cf2f
clean up test_uop_symbolic.py ( #7058 )
...
enable more tests and remove dead tests
2024-10-14 15:35:58 -04:00
chenyu
bd8ecf7fd6
remove NumNode ( #7035 )
2024-10-13 16:42:19 -04:00
George Hotz
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 Hotz
a71bb09ec3
remove symbolic file [pr] ( #7012 )
2024-10-12 18:44:44 +08:00
George Hotz
5ae2de9845
UOp.variable ( #7010 )
...
* UOp.variable [pr]
* fix tests
* clean
* improve name rendering
* last bug
2024-10-12 18:20:44 +08:00
George Hotz
e7a0ffe46a
break out linearization [pr] ( #6994 )
2024-10-11 15:27:33 +08:00
chenyu
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
chenyu
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
ignaciosica
555bcb5e54
static access for code_for_op ( #6889 )
2024-10-05 07:38:01 +08:00