[Memory] Retire graph borrow pool before updating static runs (#37966)

Co-authored-by: Shiyan Deng <dsy842974287@meta.com>
This commit is contained in:
Lianmin Zheng
2026-09-04 02:59:52 -07:00
committed by GitHub
co-authored by Shiyan Deng
parent 2216697f90
commit d7f235daca
2 changed files with 17 additions and 1 deletions
@@ -58,9 +58,11 @@ def set_graph_pool_borrow_runs(runs: list[tuple[int, int]]) -> None:
borrowing.
"""
global _borrow_static_runs
_borrow_static_runs = sorted(runs, key=lambda run: run[1], reverse=True)[
static_runs = sorted(runs, key=lambda run: run[1], reverse=True)[
: BumpArenaStub.MAX_EXTENTS
]
_teardown_borrow_pool()
_borrow_static_runs = static_runs
logger.info(
"Graph pool borrow runs pinned: runs=%d free=%d",
len(_borrow_static_runs),