Commit Graph

5551 Commits

Author SHA1 Message Date
chenyu
e6c7c3e499 update pylint path to check indent/space for all (#6022)
also fixed many errors. it was not checking nested dirs. exclude autogen for now.

can we use ruff for this?
2024-08-10 14:41:09 -04:00
George Hotz
cfb04c67d1 run unit tests separate from others (and only once) (#6020)
* run unit tests separate from others

* ignore unit tests elsewhere
2024-08-10 11:17:56 -07:00
George Hotz
8302dd6ea4 remove noqa: E501 from transcendental 2024-08-10 10:30:05 -07:00
chenyu
350276e947 simpler device_from_env [run_process_replay] (#6015)
* simpler device_from_env [run_process_replay]

fixed type ignore too

* combine
2024-08-10 13:17:46 -04:00
uuuvn
ee3b015407 ELF loader strtab fix and tests (#6011)
* ELF loader strtab fix and tests

* ruff

* typos

* only one test
2024-08-10 10:13:16 -07:00
Jun Zhang
54e176fb4f Ignore non-computational backends when overwriting the default (#5770) 2024-08-10 09:23:29 -07:00
qazal
3ef2788c4f hotfix: run the entire test_conv_bw schedule (#6014) 2024-08-10 17:55:41 +03:00
qazal
0e62076cf5 more process replay cleanups (#6013)
* more process replay cleanups

* comma benchmark missing
2024-08-10 17:29:10 +03:00
qazal
266afad8ed hotfix: skip schedule capture in benchmarks (#6012) 2024-08-10 17:13:53 +03:00
chenyu
63a8bc29d4 addition divisor in UOp div_folding (#6002)
in addition to try gcd of all terms, also try least common divisor of all MULs
2024-08-09 20:09:05 -04:00
chenyu
52a74e1d6f recursive div_folding to simplify logic (#6008)
* recursive div_folding to simplify logic

* fix mypy
2024-08-09 19:23:06 -04:00
chenyu
a4ec4e890a merge mul div pattern into div_folding (#6006) 2024-08-09 18:49:36 -04:00
chenyu
5961faa4be minor change to UOp div_fold (#6004)
remove an unnecessary gcd and swap the quo rem order, minimize diff for divisor pr
2024-08-09 17:09:59 -04:00
qazal
7373b05ee8 assert conv bw reduceops merge [compare_schedule] (#6001)
* assert conv bw reduceops merge [compare_schedule]

* diff with ref_commit_hash
2024-08-09 19:29:56 +03:00
qazal
b67d521a07 assert test_conv_bw correctness (#6000)
* assert test_conv_bw correctness

* reorder half

* metal and clang still red
2024-08-09 18:30:36 +03:00
nimlgen
ce066fd754 nv do not recalc mv_address (#5998) 2024-08-09 17:16:34 +03:00
qazal
a833f1a735 scheduler process replay with [compare_schedule] (#5997) 2024-08-09 16:58:22 +03:00
qazal
24c7c41ce0 diff LazyBuffer schedules in process replay (#5996)
* start diff printing

* this should be 2

* add to process_replay.py

* enable schedule capture

* arange diff is process replay
2024-08-09 14:16:43 +03:00
wozeparrot
d269bc95fa faster tinychat (#5993) 2024-08-08 19:16:26 -07:00
chenyu
1f1eb46af6 more failed simplified UOp div test case (#5992)
this speculative div was handled by "divisor" in symbolic.
2024-08-08 18:39:25 -04:00
gswangg
94dc61aa1f typeguard fixes for beautiful-mnsit JIT=2 METAL=1 [run_process_replay] (#5984)
* fix 'npdtype is not a class' typeguard error

* list -> tuple to fix Tensor.shrink typeguard errors

* list -> tuple to pass global_size typeguard check

* convert src -> list to fix partition typeguard error

* add type annotation and dtype assert to do_reduce

* update partition instead of caller
2024-08-08 17:53:33 -04:00
chenyu
c3e1ae2535 add failed simplified UOp div test case (#5990)
more cases!
2024-08-08 17:37:48 -04:00
nimlgen
38d5eecc68 hcq profiler support args (#5989)
* hcq profiler support args

* bytes -> _bytes

* fix

* add test

* mypy

* not f strings

* percison
2024-08-09 00:18:36 +03:00
qazal
45b1761175 smaller test_llama_embedding + assert correctness (#5986)
* smaller test_llama_embedding in CI

* test correctness
2024-08-08 22:11:29 +03:00
Timmy
8c99bdab08 More Multireduce Tests (#5968)
* multireduce tests

* linters

* more linters

* more linters

* seeing how it works with parallel
2024-08-08 22:04:08 +03:00
chenyu
3c0924cac4 UOp int alu patterns match all int (#5987)
instead of just dtypes.int
2024-08-08 14:50:58 -04:00
gswangg
df44a4e861 Make vectorization of CONST explicit (#5322)
* remove test_const_vectorize_fold

* remove const folding UPat for VECTORIZE

* refactor cstyle render_const

* remove calls to dtype.scalar() in render_const

* add assert

* add vectorized const to UOp.const

* add UPat GEP-VECTORIZE-CONST -> CONST

* render_vectorize for DEFINE_ACC in cstyle

* add back missing render_cast in render_const

* generate vectorized consts as UOps for DEFINE_ACC

* update asserts for DEFINE_ACC with VECTORIZE src

* add UPats for PHI with VECTORIZE src

* use prev rendered vectorize in DEFINE_ACC render

* update DEFINE_ACC in python runtime

* update vectorized DEFINE_ACC in PTXRenderer

* rebase DEFINE_ACC changes on lowerer

* verbose rewrite of bad UPats

* simplify UOps.CONST implementation in ops_python

* update sum_collapse UPats for DEFINE_ACC-VECTORIZE

* revert linearizer to TOT

* fix DEFINE_ACC implementation in ops_python

* simplify DEFINE_ACC in cstyle

* Fix linter error

* support VECTORIZE in fold gated load/store UPat

* support VECTORIZE in other fold gated load UPats

* rewrite VECTORIZE in UPat for no input DEFINE_ACC

* simplify DEFINE_ACC render in cstyle

* make VECTORIZE rules more concise

* add more vectorize fold tests

* inline VECTORIZE-CONSTs in cstyle render

* revert VECTORIZE/GEP rule refactor

* revert cstyle render_const refactor

* inline VECTORIZE-CONSTs in cstyle render

* implicitly vectorized const rendering -> explicit

* WMMA VECTORIZE CONST process replay hacks

* VECTORIZE CONST NAN process_replay hacks

* more VECTORIZE CONST NAN hacks

* cleanup process_replay hacks

* isnan() -> not isfinite() cstyle VECTORIZE CONST

* tweak isnan and isfinite checks VECTORIZE CONST

* tweak for positive vs negative infinity VECTORIZE CONST

* add assert to PTX CONST render

* process_replay VECTORIZE CONST render parity for PTX STORE

* vmin/vmax for VECTORIZE'd CONST

* update WMMA folding rules

* add tests for WMMA VECTORIZE fold

* hack for cstyle half4 CONST zero process_replay parity

* revert PTX backend changes

* add back minimal DEFINE_ACC PTX change

* remove cstyle process_replay hacks

* remove dead code in PTX CONST render

* cleanup vmin/vmax logic for VECTORIZE'd CONSTs

* update vectorize fold tests to use DEFINE_VAR

* fix long line formatting in test

* remove unwanted merge artifact

* more vmin/vmax cleanup

* remove unnecessary asserts

* yet more vmin/vmax cleanup

* get rid of explicit VECTORIZE CONST logic in _min_max

* reuse CONST instead of creating a new one

* remove unneeded cast

* handle DType correctly in sconst

* improve readability of tests

* save a line

* save another line

* tuplize pats in src

* remove GEP-VECTORIZE pats

* add vec +0 fold

* HACK: fold only vec8 +0

* remove vectorized ALU fold hack

---------

Co-authored-by: qazal <qazal.software@gmail.com>
Co-authored-by: qazal <77887910+Qazalin@users.noreply.github.com>
2024-08-08 20:59:05 +03:00
chenyu
62c77a2831 trim const in UOp div_folding (#5982)
simplify `(4*x+4*y+7)//16` to `(x+y+1)//4`.
fixed `GPU=1 UOP_IS_SYMBOLIC=1 IMAGE=2 python -m pytest test/test_ops.py -k conv`
2024-08-08 12:49:05 -04:00
qazal
e6d41b0ce7 hotfix: adjust test_backward_pass_diamond_model thresholds (#5981) 2024-08-09 00:20:53 +08:00
gswangg
08d22066ee simplify ALU vmin==vmax fold (#5962) 2024-08-08 11:29:16 -04:00
Elias Wahl
c9b4602854 no load in INITMLPERF (#5957) 2024-08-08 11:28:24 -04:00
nimlgen
183c4c91a3 fix non-jitted transfers in profile (#5980)
* fix transfers in profile

* fix linter

* sync to be sure everythin is recorded
2024-08-08 17:58:08 +03:00
nimlgen
76eca0d27e nv fix host mem mappings (#5979) 2024-08-08 17:03:44 +03:00
nimlgen
e89eff11a6 amd raise when not supported arch (#5978) 2024-08-08 14:46:14 +03:00
George Hotz
bc55c8a30e pmatmul example + GB/s bugfix [run_process_replay] (#5974)
* pmatmul example + bugfix

* improve pmatmul

* Update real_pmatmul.py
2024-08-07 22:32:11 -07:00
George Hotz
c5baa3d66b hotfix: don't run OOM test in CI 2024-08-07 22:19:29 -07:00
chenyu
859d0e4709 UOp simplify (x+c0)*c1 -> x*c1+c0*c1 (#5973) 2024-08-07 21:25:22 -04:00
wozeparrot
97d708252a remove realize from threefry (#5969) 2024-08-07 15:08:49 -07:00
George Hotz
bf8ec23b00 hotfix: contiguous on precompute_freqs_cis 2024-08-07 14:40:56 -07:00
wozeparrot
d3e427c8d9 fix sqlite3 locks (#5971) 2024-08-07 14:38:19 -07:00
nimlgen
cc37c99ae4 tiny hcq touchups (#5964) 2024-08-07 21:03:20 +03:00
nimlgen
8d8704af2d fix amd exec_update for locals (#5966) 2024-08-07 21:02:56 +03:00
ignaciosica
0ddcd005f5 fix priority width and give more space for src (#5509) 2024-08-07 10:48:18 -07:00
tyoc213
0c4e9dbe71 retrieve defined opencl error codes (#5792) 2024-08-07 10:46:24 -07:00
ignaciosica
4b48f166ec Refactor render_kernel for NV [run_process_replay] (#5965)
* start working on it

* blind test with process replay

* remove noqa:E501 refactoring make_cuda_dtype

* refactor even more but with known bug

* fix known bug with duplicated includes

* working locally

* add noqa:e501

* remove comment and move map

* fix qaz comments

* remove comment

---------

Co-authored-by: qazal <qazal.software@gmail.com>
2024-08-07 20:36:04 +03:00
qazal
d6f4a61c42 graph LBScheduleItem [run_process_replay] (#5960)
* add toposort key to LBScheduleItem

* use dedup

* graph LBScheduleItem

* make that comment beautiful again

* diff_schedule utils

* update fuzz_schedule
2024-08-07 19:59:11 +03:00
George Hotz
0a8668cf30 improvements to docs 2024-08-07 09:57:24 -07:00
qazal
7677361d90 test pushing through different expands in 1 kernel (#5963)
* test pushing through different expands in 1 kernel

* realize eye

* back to test_example_matmul
2024-08-07 19:33:18 +03:00
nimlgen
564a352194 nv unify _gpu_free (#5961)
* nv unify _gpu_free

* revert this
2024-08-07 18:18:17 +03:00
Eitan Turok
39c8c9c00a Add docs (#5942)
* init commit

* finish writing

* add to docs

* fix docs

* fix typo

* delete new line

* rename to tensor properties

---------

Co-authored-by: George Hotz <72895+geohot@users.noreply.github.com>
2024-08-07 07:38:51 -07:00