Commit Graph

11106 Commits

Author SHA1 Message Date
George Hotz
431666da74 POSTOPT=2 work (#12012)
* POSTOPT=2 work

* bugfixes

* add chain in one place

* tensor cores match

* better hcopt check

* match from old

* Change POSTOPT ContextVar value to 0

* we didn't need to check that
2025-09-04 16:55:56 -07:00
George Hotz
30eb42a69e fix POSTOPT pad (#11999)
* fix POSTOPT=1

* fix some tests

* Revert "fix some tests"

This reverts commit 8ee058e206.

* fix padding restrictions

* cuda has two tensor cores

* Set POSTOPT ContextVar to 0 in helpers.py
2025-09-04 14:28:58 -07:00
qazal
da61b40604 some viz tests don't need track_rewrites (#12010) 2025-09-04 23:59:32 +03:00
qazal
be364a1adb viz: add default tracing group (#12009)
This enables seeing rewrites in unit tests like `VIZ=1 python3 test/test_uop_graph.py TestUOpGraph.test_in_bounds_access_gated_local` that call graph_rewrite directly.

`@track_rewrites` keeps existing as an optional helper to organize larger traces.
2025-09-04 23:29:56 +03:00
chenyu
52166fd7eb smaller test_ops inputs (#12007) 2025-09-04 16:22:33 -04:00
chenyu
dc8501af30 clean up wino tests (#12008)
removed the one that tests hcopt and added one for backward kernel counts
2025-09-04 16:14:55 -04:00
chenyu
8c720e8760 less iterations for symbolic double for loops (#12006) 2025-09-04 15:09:17 -04:00
George Hotz
70ce29b630 test pyrender (#12005)
* test pyrender

* make them print

* switch to pyrendered
2025-09-04 11:48:40 -07:00
George Hotz
560df206cc split tc test (#12003)
* split tc test

* split hand coded opts

* remove some skipped tests

* skips on emulated
2025-09-04 11:47:56 -07:00
qazal
4996bb668b load all traces before asserting in test_viz (#12004) 2025-09-04 21:34:48 +03:00
George Hotz
9dee724fc4 make EMULATE a context var (#12002)
* make EMULATE a context var

* fix test amx
2025-09-04 11:15:43 -07:00
George Hotz
09106e4aae refactor and split test_linearizer (#12001)
* refactor and split test_linearizer

* forget that file

* imports

* remove from docs

* test gen float4
2025-09-04 10:53:07 -07:00
chenyu
fb71d1e5fd delete some test_search tests (#11998)
TC_SEARCH_OVER_SHAPE was removed so should the tests
2025-09-04 11:19:49 -04:00
chenyu
ca7574cb2d ci set PYTHONPATH for all (#11997) 2025-09-04 10:06:04 -04:00
nimlgen
e213b85810 cpu: add thread_id to worker (#11995) 2025-09-04 14:58:13 +03:00
qazal
35f37a64a9 viz: remove useless ctx.save and restore calls (#11996)
It's a UI no-op since we always set the styles right before drawing.
2025-09-04 14:56:41 +03:00
Sieds Lykles
572a3c15c6 Move Ops.SPECIAL arg to src (#11918)
* initial moving bound to src

* arg to src

* remove import

* fixup linearizer

* arg to src

* fix test_uop_graph

* fix more tests

* fix python renderer

* get const value from const uop

* ssimplify uop estimates

* fix webgpu locals

* fix old test

* gate Ops.SPECIAL in linearizer

* use ssimplify() for local/global_size

* remove toposort gate_parents_instead_of_self

* fix rendering in comment

* cleanup

* rename and add comments

* add BottomUpGate with test
2025-09-04 09:31:44 +02:00
George Hotz
5cf42dc4db add Scheduler to replace Kernel with POSTOPT=2 (#11924)
* ** simple kernel to replace Kernel for postopt

* support old

* fix beam

* beaming

* beam on old

* bring tensor cores back

* raise

* postbeam

* test ops passes on mac

* skip that

* postopt default

* gate that

* fix tensor cores

* a few test fixes

* dsp fix

* tc fix

* loop

* support swap

* test_gemv

* fix beam for variable

* test opts from high level stuff

* range annoying

* compile slow

* metal slow

* better beam

* no POSTBEAM

* fix nolocals

* hc opt mostly works

* put that back

* lil

* some work

* fix that

* POSTOPT 2

* fix tests

* no postopt 2

* work

* back

* padded tensors cores

* shift_to

* postopt 0 passes?

* write PADTO

* fix padded tensor cores

* compare hcopt

* 18000 lines

* should pass tests

* fix rangeify

* put types back
2025-09-03 19:23:30 -07:00
chenyu
b13e071463 move test_winograd to unit test (#11993) 2025-09-03 21:47:32 -04:00
chenyu
edc8b99853 more tests that pass PTX now (#11992) 2025-09-03 21:18:14 -04:00
chenyu
ed2f45712b remove skip PTX in test_arange (#11991)
all passes now
2025-09-03 20:45:19 -04:00
George Hotz
a5f2b4872a use_tensor_cores is a heuristic (#11989)
* use_tensor_cores is a heuristic

* context
2025-09-03 17:05:10 -07:00
George Hotz
63e930fec3 apply_tensor_cores is a heuristic (#11988)
* apply_tensor_cores is a heuristic

* delete extra_opts
2025-09-03 16:39:33 -07:00
chenyu
d0e739453e update many einsum tests (#11981)
correct the exception testing, and raise ValueError instead of assert when checking args
2025-09-03 15:40:20 -04:00
George Hotz
55e4bdd353 split_uop is a method (#11984) 2025-09-03 10:46:17 -07:00
ttomsa
1877eddde4 broadcast for upat (#11940) 2025-09-03 10:04:23 -07:00
George Hotz
5ed262982a remove some tc hacks from BEAM (#11980)
* remove some tc hacks from BEAM

* cosmetic changes

* revert that
2025-09-03 09:59:10 -07:00
b1tg
6d53cac457 dtype fuzz: log need input > 0 (#11979)
Co-authored-by: b1tg <b1tg@users.noreply.github.com>
2025-09-03 12:10:42 -04:00
Jordan Chalupka
68e83b850f nbytes should raise an exception when size is unlimited (#11928)
* nbytes should raise an exception when size is unlimited

* adding a test
2025-09-03 07:06:20 -07:00
Sieds Lykles
86e908db57 cast parents of int64 alu to int32 if possible (#11977)
* add overflows helper

* add rules

* x -> y

* check overflow of u too

* cleaner

* use alu instead of replace to preserve vectorization

* just one rule

* add test
2025-09-03 11:05:04 +02:00
Sieds Lykles
033184b3cb parse_valid with non const rhs (#11957)
* const to using vmin/vmax

* add test

* convert to int

* remove left over part of and
2025-09-03 08:08:46 +02:00
Sieds Lykles
53eff8970a add Ops.GEP to _min_max (#11976) 2025-09-03 07:07:54 +02:00
Sieds Lykles
d1d0960e6e remove intermediate cast using bounds - weaker pattern (#11974) 2025-09-03 06:24:40 +02:00
Sieds Lykles
8a2846b31a assert embedding input is integer dtype (#11963)
* cast embedding input

* raise error if not using int for index embedding
2025-09-03 01:44:26 +02:00
wozeparrot
d16cc6c012 feat: resume ckpt (#11970) 2025-09-02 15:47:48 -07:00
George Hotz
1b73993521 pyrender to render uops (#11968)
* pyrender to render uops

* new pyrender style

* pyrender works

* list str

* store render
2025-09-02 15:44:01 -07:00
chenyu
e921fb44ee clean up testnvidia env (#11969) 2025-09-02 18:29:00 -04:00
chenyu
69dd1817d0 raise RuntimeError in merge_dicts instead of assert [pr] (#11965) 2025-09-02 17:18:44 -04:00
qazal
f750c15965 viz: add python marker (#11952)
* viz: add python marker

* remove duplicate
2025-09-02 23:44:00 +03:00
George Hotz
550cf2ca7f tests from postopt (#11964)
* tests from postopt

* reraise is fine
2025-09-02 13:34:17 -07:00
qazal
b977ec0813 viz: axes domains cleanup (#11962) 2025-09-02 19:30:45 +03:00
nimlgen
897254ad6c ci: add dev<->cpu copy speeds (#11959) 2025-09-02 15:22:44 +03:00
George Hotz
74040663bf make ptrdtype a UOp property (#11955) 2025-09-01 16:35:43 -07:00
George Hotz
0dfca4e74b add failing test for rangeify setitem (#11954) 2025-09-01 16:24:35 -07:00
wozeparrot
7c21271a5f feat: end_lr envvar (#11953) 2025-09-01 14:53:07 -07:00
chenyu
6a40216724 correct bf16 fuzz input in test_dtype_alu (#11933)
it was using float16 inputs, now it's uint16 then convert to bf16
2025-09-01 10:52:26 -04:00
chenyu
965ea59b16 test_dtype_alu use AMD_LLVM from helpers (#11950) 2025-09-01 10:03:17 -04:00
b1tg
a9f07c31bc fix amd llvm sqrt (#11936)
* fix amd llvm sqrt

* lint

---------

Co-authored-by: b1tg <b1tg@users.noreply.github.com>
Co-authored-by: chenyu <chenyu@fastmail.com>
2025-09-01 09:31:14 -04:00
qazal
0a53e72f70 viz: fix trace duration in python test decoder (#11949) 2025-09-01 14:32:25 +03:00
qazal
27c9ed5a84 viz: more consistent naming of events (#11948)
* s/shapes/events in test_viz

* s/bufs/events in the memory packer
2025-09-01 14:16:47 +03:00