Revert "[inductor] dont reuse buffers if it affects peak (#145883) (#159530)"

This reverts commit 3be70dc30e893b552fc0f23ca06cd8f7949b6d08.

Reverted https://github.com/pytorch/pytorch/pull/159530 on behalf of https://github.com/clee2000 due to newly added test fail internally D80316528, probably just a targets change, but also imo the tests should probably go into a testcase class from common or inductor utils.  While I'm pretty sure CI can run the globally defined ones, theres some CI related functionality that on the testcase class that CI benefits from ([comment](https://github.com/pytorch/pytorch/pull/159530#issuecomment-3191947506))
This commit is contained in:
PyTorch MergeBot
2025-08-15 15:49:04 +00:00
parent 846963fa9b
commit 9df07ecfbe
5 changed files with 2 additions and 615 deletions

View File

@ -2073,7 +2073,6 @@ class Scheduler:
)
self.nodes = [self.create_scheduler_node(n) for n in nodes]
self.current_node: Optional[BaseSchedulerNode] = None
self.update_zero_dim_cpu_tensor()
# some new constants could have been created above
self.available_buffer_names.update(V.graph.constants.keys())
@ -4990,7 +4989,6 @@ class Scheduler:
assert device.index is not None, "device should have an index"
V.graph.wrapper_code.codegen_device_guard_enter(device.index)
self.current_node = node
self.buffer_names_to_free.update(node.last_usage)
if node.is_template():