Repository navigation
[inductor] Add AotOnlyBuffer for AOTI codegen - #182303
desertfire wants to merge 2 commits into
Conversation
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 [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/182303
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 7458100 with merge base 004acb4 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
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 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo [ghstack-poisoned]
|
Starting merge as part of PR stack under #182304 |
2 similar comments
|
Starting merge as part of PR stack under #182304 |
|
Starting merge as part of PR stack under #182304 |
…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
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
…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
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
…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
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
…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
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
…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
Stack from ghstack (oldest at bottom):
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
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo