Commit Graph

6704 Commits

Author SHA1 Message Date
qazal
bd14e466f1 schedule.py minor cleanups [pr] (#7551)
* schedule.py cleanups [pr]

* view

* sink then preschedule [pr]

* end
2024-11-05 19:43:20 +08:00
qazal
773b036c61 share can_pad in ops [pr] (#7550) 2024-11-05 17:58:50 +08:00
qazal
f95404412e recurse schedule graph once [pr] (#7548) 2024-11-05 17:40:28 +08:00
qazal
a36680555d mark realized bufs out of fuse.py [pr] (#7547) 2024-11-05 15:49:03 +08:00
qazal
eab8020269 track assigns in context 2 [pr] (#7546) 2024-11-05 15:23:22 +08:00
qazal
ec38fbb123 realize views with rules (#7485)
* realize views with rules

* recreate the same logic

* delete

* delete some more

* simple_pads can go

* here we go again

* real cast things

* p2

* view real
2024-11-05 14:54:12 +08:00
George Hotz
d87adccb6c fast scalar (#7545)
* fast scalar set on dtype

* prevent loop

* lru_cache those
2024-11-05 14:08:08 +08:00
George Hotz
5682955c7b faster min_max [pr] (#7544) 2024-11-05 13:32:15 +08:00
George Hotz
d419364b66 faster dtype compare [pr] (#7542)
* faster dtype compare [pr]

* simpler reduce and bring name back

* preserve pr

* lines

* now pr will pass

* use fields in vec

* remove that assert
2024-11-05 13:09:48 +08:00
George Hotz
075bdb81b3 remove Ops.REDUCE (#7541) 2024-11-05 09:41:28 +08:00
George Hotz
ab14fc1f5b GroupOp.Irreducible [pr] (#7540) 2024-11-05 09:35:34 +08:00
chenyu
4669a25f88 faster uop_given_valid [pr] (#7538)
only try a valid as a replace target if valid is in sparents. if it's not in sparents the rewrite is no-op.

`PYTHONPATH=. TRACK_MATCH_STATS=2 python3 test/external/external_benchmark_schedule.py`

simplify_valid_load 90ms -> 50ms
2024-11-04 15:13:18 -05:00
George Hotz
d30537494a remove do_reduce [pr] (#7536) 2024-11-05 01:46:11 +08:00
George Hotz
cb57774b64 pre index load and store [pr] (#7535)
* pre index load and store [pr]

* check ptrtype
2024-11-05 01:21:14 +08:00
George Hotz
e34b89645a hotfix: fix sorting of match_stats 2024-11-05 01:06:20 +08:00
qazal
3163bbc48a proposal: forced_realize is Ops.CONTIGUOUS (same buffer) (#7533)
* forced_realize is Ops.CONTIGUOUS

* Revert "forced_realize is Ops.CONTIGUOUS"

This reverts commit d8bcd5d301.

* forced_realize is Ops.CONTIGUOUS (same buffer)

* fold contig is lazy
2024-11-05 00:58:43 +08:00
George Hotz
76cc59940d only match with op, not arg [pr] (#7534) 2024-11-05 00:43:17 +08:00
George Hotz
99bd4372a5 Ops.ALU is no more, the arg is just an op (#7525)
* op arg alu [pr]

* more

* more passing

* fix more tests

* more tests passing

* fix single failing test

* so much cleaner

* noop to not have process replay trigger

* fix ptx
2024-11-05 00:22:22 +08:00
Ahmed Harmouche
36488a2a43 Use is_dtype_supported in more places in tests (#7529) 2024-11-04 09:21:15 -05:00
qazal
1d4df72798 shorter schedule ops import [pr] (#7531) 2024-11-04 22:02:43 +08:00
qazal
b5718ae135 image dtype fusion tests [pr] (#7530)
* update test_lil_model

* add test_image_matmul
2024-11-04 22:00:16 +08:00
qazal
bf31585444 check assign buffers in group [pr] (#7527) 2024-11-04 20:27:22 +08:00
qazal
9fe596ce6e early assert assign [pr] (#7526)
* early assert assign [pr]

* self

* don't need base
2024-11-04 20:04:39 +08:00
George Hotz
e2204378d9 more GroupOp [pr] (#7524) 2024-11-04 18:40:06 +08:00
George Hotz
c1585bcc9e flatten ops (#7523)
* flatten ops

* fix mypy
2024-11-04 18:07:23 +08:00
George Hotz
9c3ee64a3e hotfix: QoL assert if op is a str 2024-11-04 17:11:38 +08:00
George Hotz
0c19b6298b rename ops to have unique names (#7522) 2024-11-04 17:09:45 +08:00
George Hotz
9a7cc04843 fix viz [pr] (#7519)
* fix viz [pr]

* Update serve.py
2024-11-04 15:02:41 +08:00
George Hotz
6bb230287b pass the src into Metal [pr] (#7518)
* pass the src into Metal [pr]

* put that comment back

* keep old functionality

* move all to disassembler

* metal supports parallel beam

* touchups

* comment in correct place
2024-11-04 12:35:30 +08:00
George Hotz
bac251d2c1 idx_load_store in lowerer [pr] (#7477)
* idx_load_store in lowerer [pr]

* fix tests (#7513)

Co-authored-by: John Doe <null@mail.com>

* work

---------

Co-authored-by: Carl Basho <76494676+oldpondplop@users.noreply.github.com>
Co-authored-by: John Doe <null@mail.com>
2024-11-04 10:18:40 +08:00
chenyu
7758f7211b Revert "s/UPat/Pat (#7506)" [pr] (#7517)
* Revert "s/UPat/Pat (#7506)"

This reverts commit 400011a8c1.

* fix
2024-11-03 16:33:02 -05:00
chenyu
e641bbc859 safe softmax trick in MCTS ucb_explored_children (#7515)
* safe softmax trick in MCTS ucb_explored_children

fixed
```
  File "numpy/random/mtrand.pyx", line 971, in numpy.random.mtrand.RandomState.choice
ValueError: probabilities contain NaN
```
when all ucb_explored_children are big negative numbers result in all NaN probabilities

* better type
2024-11-03 15:59:31 -05:00
chenyu
3ef3b5b5f8 simpler ops_python CAST (#7514) 2024-11-03 14:40:43 -05:00
chenyu
df49439b9a remove reassoc from LLVM flags (#7512)
reassoc reorders compute and breaks transcendental
2024-11-03 13:11:56 -05:00
chenyu
2f70fb893e move transcendental fuzzer test to test_transcendental (#7511) 2024-11-03 12:36:50 -05:00
chenyu
84592225d8 tweak tqdm (#7510)
reduce parentheses and fuzz more tests now there's no sleep
2024-11-03 12:07:11 -05:00
chenyu
c25a69b97e fix tqdm tests (#7509)
time.sleep masked two issues:
(1) iters_per_sec might have unitscale in it, and calling `float` on it fails
(2) default rate is too low to ensure the output matches, it might skip updating
2024-11-03 10:53:22 -05:00
chenyu
4617c9a565 move COMMUTATIVE flipping to symbolic (#7507)
* move COMMUTATIVE flipping to symbolic

it cannot go with TRANSCENDENTAL

* skip LLVM
2024-11-03 09:03:45 -05:00
qazal
50ea2105e5 clean schedule ctx after fusing arange/conv_bw [pr] (#7508) 2024-11-03 21:55:14 +08:00
chenyu
400011a8c1 s/UPat/Pat (#7506) 2024-11-03 08:26:19 -05:00
qazal
37f8578953 s/BUFFER_UOPS/BUFOPS (#7501) 2024-11-03 10:17:33 +02:00
George Hotz
c8bf09b7d4 s/UOps/Ops (#7500)
* s/UOps/Ops [pr]

* fix
2024-11-03 11:26:10 +08:00
George Hotz
d078dcd0c8 TrackedPatternMatcher needs to loop [pr] (#7499) 2024-11-03 11:18:58 +08:00
George Hotz
6f93e91deb hotfix: lower mnist threshold for non determinism 2024-11-03 11:05:12 +08:00
George Hotz
06f476b371 late transcendental (#7498) 2024-11-03 10:53:58 +08:00
chenyu
91a3b27fa9 disable test_setitem_inplace_operator again (#7495)
it was flaky, not broken broken
2024-11-02 19:01:23 -04:00
chenyu
ba0c246cfd update test_setitem_overlapping_inplace1 (#7494)
failed on LLVM and remu, not real AMD
2024-11-02 18:40:53 -04:00
chenyu
f887de0fd6 update test_setitem (#7493)
some tests passed now
2024-11-02 17:53:04 -04:00
chenyu
49ae2df036 ConstLike type [pr] (#7492)
* ConstLike type [pr]

`ConstLike = ConstType|Variable|Tuple[ConstType, ...]`. fixed the wrong `Tuple[ConstType]`

* old pylint
2024-11-02 17:13:17 -04:00
chenyu
dc9ffb41a8 cleanup multi [pr] (#7491) 2024-11-02 16:38:34 -04:00