Commit Graph

36 Commits

Author SHA1 Message Date
qazal
c6c12ba94a save schedule graph pre validation (#4317) 2024-04-27 12:06:15 +03:00
qazal
53853e6d08 save the schedule graph in SAVE_SCHEDULE (#4248)
* save the schedule graph with assigns

* extend graph
2024-04-24 12:08:51 +03:00
George Hotz
ad28fdecb1 si.inputs+outputs -> bufs (#4279) 2024-04-24 15:12:34 +08:00
David Hou
f6eea03749 SAVE_SCHEDULE as contextvar (#4230) 2024-04-19 18:51:57 -04:00
qazal
2094b3b327 graph ScheduleItems (#4224)
* graph schedules

* add logging

* inplace

---------

Co-authored-by: George Hotz <72895+geohot@users.noreply.github.com>
2024-04-19 16:17:11 +04:00
George Hotz
b9570d6100 clean up update stats (#4226)
* WIP: clean up update stats

* line savings now

* fix graphs

* fix tests

* tighter prints

* remove extra jit=false

* debug=2 means wait

* that won't update stats

* still wait
2024-04-19 15:41:30 +04:00
qazal
1c87e5dbf6 fuzz schedule context vars (#4223)
* fuzz schedule context vars

* fuzz unique toposorts

* merge ground truth with the rest

* Revert "merge ground truth with the rest"

This reverts commit 1f3463bb57.

* readability>

* can override
2024-04-19 13:16:25 +03:00
qazal
abb10c83cd tunable multi output fusion 2024-04-19 07:44:31 +03:00
qazal
f75020a903 minimal diff for multioutput reduce pairs (#4030)
* simple fusion

* compiler cache patch

* Revert "compiler cache patch"

This reverts commit fa18049597.

* Revert "Revert "compiler cache patch""

This reverts commit 57f8d41f98.

* delete that

* early sort

* teeny renames

* spec

* .empty is great

* delete sort

* Update test_schedule.py

* this is one kernel now

---------

Co-authored-by: George Hotz <72895+geohot@users.noreply.github.com>
2024-04-17 10:55:44 -04:00
qazal
ba8602612b Fuzz all permutations of schedule (#4136)
* simple toposort

* fuzzer

* init in_degree

* move to tests

* same seed

* configure paths

* internal graph

* compare LazyBuffers

* simpler

* simple graph

* assign works

* simpler

* fix JIT

* upstream ci

* move ci

* fix the path

* DEBUG=1

* limit max paths

* launch a cmp kernel

* Revert "launch a cmp kernel"

This reverts commit 791c608992.

* exec ground truth

* better perf

* copy ground truth once

* gpu allclose ast try1

* Revert "gpu allclose ast try1"

This reverts commit 1f82103af3.

* prerealized bufs freezing

* teeny cleanups

* reuse Buffers

* Revert "reuse Buffers"

This reverts commit a71de94b03.

---------

Co-authored-by: George Hotz <72895+geohot@users.noreply.github.com>
2024-04-17 05:03:21 +04:00
David Hou
97d846dd67 in forced_realize, unchase last op if it is upcast (#4185)
* in forced_realize, unchase last op if it is upcast

* start on test

* flesh out test

* more test

* comment

* comment out parallel reduce test

* reorder

* unused
2024-04-16 17:15:17 -04:00
qazal
286ea697f3 keep order in realizes (#4180) 2024-04-16 01:25:50 +04:00
qazal
c0796374e4 refactor membufs (#4147) 2024-04-11 08:30:44 -07:00
George Hotz
2e6c39b0b2 Do less realizes (#4141)
* less realize

* corealize jit inputs

* prints

* print before we run
2024-04-10 19:50:50 -07:00
chenyu
06bcae13b4 PADTO SUM if parents of sum are all zero-preserving (#4140)
* PADTO SUM if parents of sum are all zero-preserving

* test case unsafe ops after sum is fine

* reuse UNSAFE_PAD_OPS

* update db version
2024-04-10 22:16:12 -04:00
George Hotz
a35375df85 run_schedule is so simple now (#4130) 2024-04-10 09:49:30 -07:00
George Hotz
08ddeb5685 create schedule has global vars (#4125)
* abstractions3 is currently wishful thinking

* create_schedule_with_vars
2024-04-09 21:42:16 -07:00
qazal
c390828f61 refactor outbufs (#4112) 2024-04-08 14:54:10 -07:00
qazal
eea42d864f account for all outputs (#4113) 2024-04-08 10:04:19 -07:00
chenyu
92c0675ccf setitem initial support (#4093)
* wip setitem

it's an eager assign to output shapetracker view

* cleanups and tests

* more cleanups
2024-04-07 20:35:22 -04:00
qazal
1ea8fcbe1b graph schedule items (#4054) 2024-04-03 08:52:37 -07:00
George Hotz
7425a0c646 CommandQueue is the future (#3950)
* start of command queue

* cq work

* runs

* cleanup

* outs set

* read is gone

* future buffer work

* command queue is better

* command queue works

* loadops

* delete unneeded

* command queue works

* upd

* fix tests

* use CommandQueue in compile

* delay sync
2024-04-01 17:35:48 -07:00
chenyu
bee8eeae55 Revert "don't simplify st in _recursive_lazyop when unbind (#4011)" (#4013)
This reverts commit 2b704d7452.
2024-03-30 17:36:17 -04:00
chenyu
2b704d7452 don't simplify st in _recursive_lazyop when unbind (#4011)
st here should be the same, calling simplify.unbind generates a different st and break cache
2024-03-30 17:03:40 -04:00
chenyu
c71627fee6 move GlobalCounter to helpers (#4002)
break circular import between ops and buffer
2024-03-30 00:30:30 -04:00
George Hotz
9eef44521b ScheduleItem uses Buffer (#3995)
* schedule Buffer

* update

* update tests

* master

* works

* remove LoadOps.WAIT

* fix compile2

* bad test

* rename and note
2024-03-29 20:50:27 -07:00
George Hotz
1bd4f01da2 size instead of st.size (#4001) 2024-03-29 19:59:02 -07:00
George Hotz
8f1e34a2a0 early src delete (#3996)
* early src delete

* fix bad test

* fix test_linearizer
2024-03-29 19:46:07 -07:00
chenyu
d9ff636cf5 use is to compare with enum (#3993)
* use is to compare with enum

currently it's mixed between `==` and `is`, moved all to `is`

* more
2024-03-29 13:02:56 -04:00
George Hotz
9a6ac2a50a create the buffer with the LazyBuffer (#3977)
* create the buffer with the LazyBuffer

* fixes

* hack underlying buffer when we change dtype

* we only care about allocated buffers

* asserts
2024-03-28 19:31:28 -07:00
qazal
2bfb1d3e39 dynamic assign idx (#3975) 2024-03-28 13:59:32 -07:00
qazal
03d129baa8 inputs -> membufs (#3964) 2024-03-27 17:34:39 -07:00
George Hotz
60639cccac hotfix: RuntimeError for assign 2024-03-27 11:18:48 -07:00
qazal
9fb573d73c DAG cycle asserts (#3955)
* assert cycles

* these are cycle errors

* flip to positive
2024-03-27 11:09:59 -07:00
George Hotz
91f3326c0b hotfix: increase recursion limit 2024-03-26 21:26:54 -07:00
George Hotz
68ca4d4276 split to schedule.py (#3949)
* split to schedule.py

* split
2024-03-26 21:02:46 -07:00