Skip to content

[Helion + torch.compile] Refactor HelionTemplateBuffer to use TemplateBuffer base class#1723

Merged
yf225 merged 1 commit intomainfrom
yf225/stack/70
Mar 19, 2026
Merged

[Helion + torch.compile] Refactor HelionTemplateBuffer to use TemplateBuffer base class#1723
yf225 merged 1 commit intomainfrom
yf225/stack/70

Conversation

@yf225
Copy link
Copy Markdown
Contributor

@yf225 yf225 commented Mar 16, 2026

Stacked PRs:


[Helion + torch.compile] Refactor HelionTemplateBuffer to use TemplateBuffer base class

Switch from TritonTemplateBuffer to TemplateBuffer base class to enable
prologue/epilogue fusion support. This refactors the template buffer to
use make_kernel_render closure, build_multi_outputs, and the standard
render() path instead of the custom codegen_template_override/
emit_kernel_override/call_kernel overrides.

Also adds get_needed_import_lines() to output_header.py, refactoring
get_needed_imports() to use it.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 16, 2026
@yf225 yf225 marked this pull request as draft March 16, 2026 22:29
@yf225 yf225 marked this pull request as ready for review March 16, 2026 22:30
@yf225 yf225 marked this pull request as draft March 16, 2026 22:36
@yf225 yf225 marked this pull request as ready for review March 16, 2026 22:36
@yf225 yf225 marked this pull request as draft March 16, 2026 22:43
@yf225 yf225 marked this pull request as ready for review March 16, 2026 22:44
yf225 added a commit that referenced this pull request Mar 16, 2026
…eBuffer base class

Switch from TritonTemplateBuffer to TemplateBuffer base class to enable
prologue/epilogue fusion support. This refactors the template buffer to
use make_kernel_render closure, build_multi_outputs, and the standard
render() path instead of the custom codegen_template_override/
emit_kernel_override/call_kernel overrides.

Also adds get_needed_import_lines() to output_header.py, refactoring
get_needed_imports() to use it.

stack-info: PR: #1723, branch: yf225/stack/70
@yf225 yf225 marked this pull request as draft March 16, 2026 23:46
@yf225 yf225 marked this pull request as ready for review March 16, 2026 23:46
@yf225 yf225 marked this pull request as draft March 17, 2026 00:00
@yf225 yf225 marked this pull request as ready for review March 17, 2026 00:01
yf225 added a commit that referenced this pull request Mar 17, 2026
…eBuffer base class

Switch from TritonTemplateBuffer to TemplateBuffer base class to enable
prologue/epilogue fusion support. This refactors the template buffer to
use make_kernel_render closure, build_multi_outputs, and the standard
render() path instead of the custom codegen_template_override/
emit_kernel_override/call_kernel overrides.

Also adds get_needed_import_lines() to output_header.py, refactoring
get_needed_imports() to use it.

stack-info: PR: #1723, branch: yf225/stack/70
@yf225 yf225 marked this pull request as draft March 17, 2026 00:20
@yf225 yf225 marked this pull request as ready for review March 17, 2026 00:20
@yf225 yf225 marked this pull request as draft March 17, 2026 01:58
@yf225 yf225 marked this pull request as ready for review March 17, 2026 01:59
@yf225 yf225 marked this pull request as draft March 17, 2026 04:20
@yf225 yf225 marked this pull request as ready for review March 17, 2026 04:20
@yf225 yf225 marked this pull request as draft March 17, 2026 04:42
@yf225 yf225 marked this pull request as ready for review March 17, 2026 04:42
@yf225 yf225 marked this pull request as draft March 17, 2026 04:55
@yf225 yf225 marked this pull request as ready for review March 17, 2026 04:56
…eBuffer base class

Switch from TritonTemplateBuffer to TemplateBuffer base class to enable
prologue/epilogue fusion support. This refactors the template buffer to
use make_kernel_render closure, build_multi_outputs, and the standard
render() path instead of the custom codegen_template_override/
emit_kernel_override/call_kernel overrides.

Also adds get_needed_import_lines() to output_header.py, refactoring
get_needed_imports() to use it.

stack-info: PR: #1723, branch: yf225/stack/70
@yf225 yf225 marked this pull request as draft March 17, 2026 04:58
@yf225 yf225 marked this pull request as ready for review March 17, 2026 04:58
@yf225 yf225 requested review from jansel, oulgen and shunting314 March 17, 2026 05:20
yf225 added a commit that referenced this pull request Mar 17, 2026
…eBuffer base class

Switch from TritonTemplateBuffer to TemplateBuffer base class to enable
prologue/epilogue fusion support. This refactors the template buffer to
use make_kernel_render closure, build_multi_outputs, and the standard
render() path instead of the custom codegen_template_override/
emit_kernel_override/call_kernel overrides.

Also adds get_needed_import_lines() to output_header.py, refactoring
get_needed_imports() to use it.

stack-info: PR: #1723, branch: yf225/stack/70
@yf225 yf225 merged commit 31dc55c into main Mar 19, 2026
32 of 34 checks passed
hinriksnaer pushed a commit to hinriksnaer/helion that referenced this pull request Mar 20, 2026
umechand-amd pushed a commit to umechand-amd/helion that referenced this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants