Skip to content

Commit

Permalink
[AOTI] Disable stack allocation when there is a fallback op (#122367)
Browse files Browse the repository at this point in the history
Summary: Stack allocation is disabled when there is an aten fallback op, see https://github.com/pytorch/pytorch/blob/c84f81b395fff969bbd2f784efad8ab1a8aa52de/torch/_inductor/codegen/cpp_wrapper_cpu.py#L974. But we need to do the same where is a custom op fallback.

Test Plan: CI

Reviewed By: mikekgfb

Differential Revision: D55149369

Pull Request resolved: #122367
Approved by: https://github.com/mikekgfb
  • Loading branch information
desertfire authored and pytorchmergebot committed Mar 21, 2024
1 parent af9b71c commit 628dcde
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torch/_inductor/codegen/cpp_wrapper_cpu.py
Expand Up @@ -1703,6 +1703,8 @@ def generate_extern_kernel_alloc_and_find_schema_if_needed(
raw_args=None,
outputs=None,
):
# No stack allocation when there is a fallback op
self.allow_stack_allocation = False
if config.is_fbcode():
assert op_overload is not None
assert raw_args is not None
Expand Down

0 comments on commit 628dcde

Please sign in to comment.