Repository navigation
[inductor][refactor] Extract helpers in CppWrapperCpu - #182265
Closed
desertfire wants to merge 3 commits into
Closed
desertfire wants to merge 3 commits into
desertfire wants to merge 3 commits into
Conversation
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 [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/182265
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Cancelled JobAs of commit 9075d9e with merge base 004acb4 ( NEW FAILURE - The following job has failed:
CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo [ghstack-poisoned]
This was referenced May 4, 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 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo [ghstack-poisoned]
angelayi
approved these changes
May 5, 2026
Collaborator
|
Starting merge as part of PR stack under #182304 |
2 similar comments
Collaborator
|
Starting merge as part of PR stack under #182304 |
Collaborator
|
Starting merge as part of PR stack under #182304 |
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
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
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
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
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
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo