Skip to content

[inductor][refactor] Extract LazyKernelCompileResult to shared header - #182264

Closed
desertfire wants to merge 2 commits into
gh/desertfire/703/basefrom
gh/desertfire/703/head
Closed

desertfire wants to merge 2 commits into
gh/desertfire/703/basefrom
gh/desertfire/703/head

Conversation

@desertfire

@desertfire desertfire commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Move LazyKernelCompileResult struct from the JIT-only
lazy_triton_compile.h to a shared header at
aoti_include/kernel_compile_result.h. This makes the struct
accessible to both JIT and AOTI compilation paths, which is
needed for the upcoming AOTI lazy Triton compilation support.

Authored with Claude

Move LazyKernelCompileResult struct from the JIT-only
lazy_triton_compile.h to a shared header at
aoti_include/kernel_compile_result.h. This makes the struct
accessible to both JIT and AOTI compilation paths, which is
needed for the upcoming AOTI lazy Triton compilation support.

Authored with Claude

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented May 4, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/182264

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit e9d4578 with merge base 004acb4 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

…ared header"

Move LazyKernelCompileResult struct from the JIT-only
lazy_triton_compile.h to a shared header at
aoti_include/kernel_compile_result.h. This makes the struct
accessible to both JIT and AOTI compilation paths, which is
needed for the upcoming AOTI lazy Triton compilation support.

Authored with Claude

[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #182304

2 similar comments
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #182304

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #182304

pytorchmergebot pushed a commit that referenced this pull request May 6, 2026
Pure refactoring with no behavior change. Extract inline blocks from
write_header / write_prefix / write_wrapper_decl / finalize_prefix into
named private methods to make the upcoming dual-mode infrastructure
change easier to review.

Authored with Claude

Pull Request resolved: #182265
Approved by: https://github.com/angelayi
ghstack dependencies: #182264
pytorchmergebot pushed a commit that referenced this pull request May 6, 2026
Add AotOnlyBuffer(IndentedBuffer), a mirror with flipped defaults for
pure-AOTI codegen. Base IndentedBuffer gets stub methods with pure-JIT
defaults (writeline_jit=writeline, writeline_aot=noop, splice_jit=splice,
splice_aot=noop); AotOnlyBuffer flips them so writeline_aot/splice_aot
write while writeline_jit/splice_jit drop.

This lets call sites use writeline_jit/writeline_aot uniformly across
pure-JIT and pure-AOTI without sprinkling V.graph.aot_mode checks.
make_codegen_buffer() picks the right type per mode.

Authored with Claude

Pull Request resolved: #182303
Approved by: https://github.com/angelayi
ghstack dependencies: #182264, #182265
pytorchmergebot pushed a commit that referenced this pull request May 6, 2026
…182304)

PythonWrapperCodegen.__init__ now constructs self.header / self.prefix /
self.wrapper_call via make_codegen_buffer(), which returns AotOnlyBuffer
in AOT mode and plain IndentedBuffer otherwise. CppWrapperCpu picks up
the right type automatically — no override needed since aot_mode is the
graph-level flag that drives the choice.

Authored with Claude

Pull Request resolved: #182304
Approved by: https://github.com/angelayi
ghstack dependencies: #182264, #182265, #182303
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
…pytorch#182264)

Move LazyKernelCompileResult struct from the JIT-only
lazy_triton_compile.h to a shared header at
aoti_include/kernel_compile_result.h. This makes the struct
accessible to both JIT and AOTI compilation paths, which is
needed for the upcoming AOTI lazy Triton compilation support.

Authored with Claude
Pull Request resolved: pytorch#182264
Approved by: https://github.com/angelayi
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
Pure refactoring with no behavior change. Extract inline blocks from
write_header / write_prefix / write_wrapper_decl / finalize_prefix into
named private methods to make the upcoming dual-mode infrastructure
change easier to review.

Authored with Claude

Pull Request resolved: pytorch#182265
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
Add AotOnlyBuffer(IndentedBuffer), a mirror with flipped defaults for
pure-AOTI codegen. Base IndentedBuffer gets stub methods with pure-JIT
defaults (writeline_jit=writeline, writeline_aot=noop, splice_jit=splice,
splice_aot=noop); AotOnlyBuffer flips them so writeline_aot/splice_aot
write while writeline_jit/splice_jit drop.

This lets call sites use writeline_jit/writeline_aot uniformly across
pure-JIT and pure-AOTI without sprinkling V.graph.aot_mode checks.
make_codegen_buffer() picks the right type per mode.

Authored with Claude

Pull Request resolved: pytorch#182303
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264, pytorch#182265
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
…ytorch#182304)

PythonWrapperCodegen.__init__ now constructs self.header / self.prefix /
self.wrapper_call via make_codegen_buffer(), which returns AotOnlyBuffer
in AOT mode and plain IndentedBuffer otherwise. CppWrapperCpu picks up
the right type automatically — no override needed since aot_mode is the
graph-level flag that drives the choice.

Authored with Claude

Pull Request resolved: pytorch#182304
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264, pytorch#182265, pytorch#182303
@github-actions
github-actions Bot deleted the gh/desertfire/703/head branch June 6, 2026 02:28
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
…pytorch#182264)

Move LazyKernelCompileResult struct from the JIT-only
lazy_triton_compile.h to a shared header at
aoti_include/kernel_compile_result.h. This makes the struct
accessible to both JIT and AOTI compilation paths, which is
needed for the upcoming AOTI lazy Triton compilation support.

Authored with Claude
Pull Request resolved: pytorch#182264
Approved by: https://github.com/angelayi
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
Pure refactoring with no behavior change. Extract inline blocks from
write_header / write_prefix / write_wrapper_decl / finalize_prefix into
named private methods to make the upcoming dual-mode infrastructure
change easier to review.

Authored with Claude

Pull Request resolved: pytorch#182265
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
Add AotOnlyBuffer(IndentedBuffer), a mirror with flipped defaults for
pure-AOTI codegen. Base IndentedBuffer gets stub methods with pure-JIT
defaults (writeline_jit=writeline, writeline_aot=noop, splice_jit=splice,
splice_aot=noop); AotOnlyBuffer flips them so writeline_aot/splice_aot
write while writeline_jit/splice_jit drop.

This lets call sites use writeline_jit/writeline_aot uniformly across
pure-JIT and pure-AOTI without sprinkling V.graph.aot_mode checks.
make_codegen_buffer() picks the right type per mode.

Authored with Claude

Pull Request resolved: pytorch#182303
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264, pytorch#182265
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
…ytorch#182304)

PythonWrapperCodegen.__init__ now constructs self.header / self.prefix /
self.wrapper_call via make_codegen_buffer(), which returns AotOnlyBuffer
in AOT mode and plain IndentedBuffer otherwise. CppWrapperCpu picks up
the right type automatically — no override needed since aot_mode is the
graph-level flag that drives the choice.

Authored with Claude

Pull Request resolved: pytorch#182304
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264, pytorch#182265, pytorch#182303
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…pytorch#182264)

Move LazyKernelCompileResult struct from the JIT-only
lazy_triton_compile.h to a shared header at
aoti_include/kernel_compile_result.h. This makes the struct
accessible to both JIT and AOTI compilation paths, which is
needed for the upcoming AOTI lazy Triton compilation support.

Authored with Claude
Pull Request resolved: pytorch#182264
Approved by: https://github.com/angelayi
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
Pure refactoring with no behavior change. Extract inline blocks from
write_header / write_prefix / write_wrapper_decl / finalize_prefix into
named private methods to make the upcoming dual-mode infrastructure
change easier to review.

Authored with Claude

Pull Request resolved: pytorch#182265
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
Add AotOnlyBuffer(IndentedBuffer), a mirror with flipped defaults for
pure-AOTI codegen. Base IndentedBuffer gets stub methods with pure-JIT
defaults (writeline_jit=writeline, writeline_aot=noop, splice_jit=splice,
splice_aot=noop); AotOnlyBuffer flips them so writeline_aot/splice_aot
write while writeline_jit/splice_jit drop.

This lets call sites use writeline_jit/writeline_aot uniformly across
pure-JIT and pure-AOTI without sprinkling V.graph.aot_mode checks.
make_codegen_buffer() picks the right type per mode.

Authored with Claude

Pull Request resolved: pytorch#182303
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264, pytorch#182265
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…ytorch#182304)

PythonWrapperCodegen.__init__ now constructs self.header / self.prefix /
self.wrapper_call via make_codegen_buffer(), which returns AotOnlyBuffer
in AOT mode and plain IndentedBuffer otherwise. CppWrapperCpu picks up
the right type automatically — no override needed since aot_mode is the
graph-level flag that drives the choice.

Authored with Claude

Pull Request resolved: pytorch#182304
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264, pytorch#182265, pytorch#182303
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…pytorch#182264)

Move LazyKernelCompileResult struct from the JIT-only
lazy_triton_compile.h to a shared header at
aoti_include/kernel_compile_result.h. This makes the struct
accessible to both JIT and AOTI compilation paths, which is
needed for the upcoming AOTI lazy Triton compilation support.

Authored with Claude
Pull Request resolved: pytorch#182264
Approved by: https://github.com/angelayi
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
Pure refactoring with no behavior change. Extract inline blocks from
write_header / write_prefix / write_wrapper_decl / finalize_prefix into
named private methods to make the upcoming dual-mode infrastructure
change easier to review.

Authored with Claude

Pull Request resolved: pytorch#182265
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
Add AotOnlyBuffer(IndentedBuffer), a mirror with flipped defaults for
pure-AOTI codegen. Base IndentedBuffer gets stub methods with pure-JIT
defaults (writeline_jit=writeline, writeline_aot=noop, splice_jit=splice,
splice_aot=noop); AotOnlyBuffer flips them so writeline_aot/splice_aot
write while writeline_jit/splice_jit drop.

This lets call sites use writeline_jit/writeline_aot uniformly across
pure-JIT and pure-AOTI without sprinkling V.graph.aot_mode checks.
make_codegen_buffer() picks the right type per mode.

Authored with Claude

Pull Request resolved: pytorch#182303
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264, pytorch#182265
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…ytorch#182304)

PythonWrapperCodegen.__init__ now constructs self.header / self.prefix /
self.wrapper_call via make_codegen_buffer(), which returns AotOnlyBuffer
in AOT mode and plain IndentedBuffer otherwise. CppWrapperCpu picks up
the right type automatically — no override needed since aot_mode is the
graph-level flag that drives the choice.

Authored with Claude

Pull Request resolved: pytorch#182304
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#182264, pytorch#182265, pytorch#182303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants