-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MetaSchedule][M3a] SpaceGenerator #9079
[MetaSchedule][M3a] SpaceGenerator #9079
Conversation
Co-authored-by: Junru Shao <junrushao1994@gmail.com> Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com> Co-authored-by: Hongyi Jin <3231950289@qq.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn>
@comaniac Would you please review this PR when you got time? |
I don't have other comments because we have been working together on the preparation branch for quite a while lol. Waiting for more reviewers to appear :-) |
* main: (37 commits) [ONNX] [Relay] Dynamic squeeze (apache#9095) [Meta Schedule][M3b] Database (apache#9061) [Bugfix] Add nullptr checking for `AttrStmt` with `coproc_uop_scope` attr key (apache#9123) [Codegen] Swap out analyzer when outlining (apache#9117) [CI] bash.sh, build.sh: add option to set the container name and hostname (apache#9110) Ensure google-mock is installed and setup (apache#9107) Arm(R) Ethos(TM)-U NPU TIR to CS for Conv2D (apache#8811) Frontend: add onnx GlobalLpPool op (apache#8845) [LLVM] Refactor MakeCallPacked, NFC (apache#9118) prevent casting handle to other types (apache#9114) fix annotation of tir generic (apache#9119) [Relay] Register layout conversion function to more reduce ops (apache#9048) Fix the missing `dtype` attribute of `tir.Shuffle` in Python level (apache#9131) add `multiply` and remove `subtract` for dnnl json runtime (apache#9120) relu of dnnl json runtime only support 4-dims input (apache#9122) [Meta Schedule][M3a] SpaceGenerator (apache#9079) [TensorIR][Bugfix] Disallow fusing loops with dependency (apache#9112) adding Jorn to reviewers list (apache#9105) [BYOC] Fix incorrect conv2d padding handling of `dnnl with c source runtime` (apache#9097) [Frontend][TFLite] fix apache#9078 (apache#9099) ...
* Add meta shedule space generator. Co-authored-by: Junru Shao <junrushao1994@gmail.com> Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com> Co-authored-by: Hongyi Jin <3231950289@qq.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn> * Clean up. * Minor fix. * Move utils.h. Co-authored-by: Junru Shao <junrushao1994@gmail.com> Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com> Co-authored-by: Hongyi Jin <3231950289@qq.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn>
* Add meta shedule space generator. Co-authored-by: Junru Shao <junrushao1994@gmail.com> Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com> Co-authored-by: Hongyi Jin <3231950289@qq.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn> * Clean up. * Minor fix. * Move utils.h. Co-authored-by: Junru Shao <junrushao1994@gmail.com> Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com> Co-authored-by: Hongyi Jin <3231950289@qq.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn>
def schedule_matmul(sch: Schedule): | ||
block = sch.get_block("matmul") | ||
i, j, k = sch.get_loops(block=block) | ||
# TODO(@zxybazh): Change to `sample_perfect_tile` after upstreaming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC sample-perfect-tile is already in apache/tvm. So I guess you can just use it without waiting?
tvm/include/tvm/tir/schedule/schedule.h
Lines 203 to 212 in 2c654b5
/*! | |
* \brief Sample the factors to perfect tile a specific loop | |
* \param loop_rv The loop to be tiled | |
* \param n The number of tiles to be sampled | |
* \param max_innermost_factor The maximum tile size allowed to be sampled in the innermost loop | |
* \param decision The sampling decision | |
* \return A list of length `n`, the random perfect tile sizes sampled | |
*/ | |
virtual Array<ExprRV> SamplePerfectTile(const LoopRV& loop_rv, int n, int max_innermost_factor, | |
Optional<Array<Integer>> decision = NullOpt) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's already there now. Feel free to update the test :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's working perfectly in my testing branch : )
This PR is part of the stage M3a of the meta schedule project (#8473).
The architecture is re-designed by Junru and Xiyou.
SpaceGenerator
is designed to generate design spaces in order to select measure candidates from. Apart from the c++ side implementation, we also include python-side customizable design space generator classPySpaceGenerator
, union of space generator classSpaceGeneratorUnion
and schedule function based space generator classScheduleFn
. Unit tests are also included.Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
Co-authored-by: Hongyi Jin <3231950289@qq.com>
Co-authored-by: Wuwei Lin <wuwei@apache.org>
Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn>