Helion + Inductor prologue / epilogue fusion#1324
Conversation
| return out | ||
|
|
||
|
|
||
| class TestMutation(RefEagerTestDisabled, TestCase): |
There was a problem hiding this comment.
@oulgen I added this test class to check the correctness of mutation analysis
24b4c33 to
ed56113
Compare
| subscript, | ||
| value, | ||
| store_index, | ||
| ) |
There was a problem hiding this comment.
The overall design is we insert the prologue / epilogue ops into the Helion-generated Triton kernel during hl.load / hl.store codegen. I explored several approaches and this feels the most natural, since the Inductor scheduler IR node representing the prologue / epilogue op is already at Triton statement level, so inserting them into the Helion kernel at codegen level is easiest and doesn't need to go from lower IR level to higher IR level.
e797791 to
f18d7c0
Compare
| self.assertIn("epilogue", code.lower()) | ||
|
|
||
| def test_inductor_output_code_has_helion_generated_triton_kernel(self): | ||
| """Test that Inductor-generated wrapper code contains Helion-generated Triton code.""" |
There was a problem hiding this comment.
Adding this test to show that Inductor output code contains Helion-generated Triton code.
3833f17 to
84d588d
Compare
0a4c1ef to
487bd88
Compare
487bd88 to
c924c63
Compare
| self._prologue_fused_once.clear() | ||
| # Ensure config is available (triggers autotuning if needed) | ||
| if self._autotune_args: | ||
| self._bound_kernel.ensure_config_exists(self._autotune_args) |
There was a problem hiding this comment.
TODO: can this support AOT autotuning (not JIT)? if so, how does the UX of passing in a config look like?
| from helion._compiler.host_function import HostFunction | ||
|
|
||
|
|
||
| def _find_mutated_inputs( |
There was a problem hiding this comment.
This is extremely useful. Do you think you could land this first so that I can start using it? Thanks
c924c63 to
7992d20
Compare
|
Hi @yf225! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
NOTE: CI is failing because we need pytorch/pytorch#171683 to land first.