Skip to content

[tsl] Add ScopedAllocationTrace to help debugging OOMs#44246

Draft
ezhulenev wants to merge 2 commits into
openxla:mainfrom
ezhulenev:scoped-allocation-trace
Draft

[tsl] Add ScopedAllocationTrace to help debugging OOMs#44246
ezhulenev wants to merge 2 commits into
openxla:mainfrom
ezhulenev:scoped-allocation-trace

Conversation

@ezhulenev

Copy link
Copy Markdown
Contributor

Adds tsl::ScopedAllocationTrace, a thread-local scoped annotation stack that lets higher-level XLA/PJRT code attach allocation context to device memory allocations.

This is used by the BFC allocator to capture allocation annotations on live chunks and include them in OOM memory dumps, making it easier to identify which executable and buffer allocation caused or contributed to an OOM.

This is a something like a TraceMe/TraceMeEncode but for allocations.

@github-actions

Copy link
Copy Markdown

PR #44246 additions: 1637, deletions: 280, total: 1917

🔴 This PR has a very large delta of over 1000. In order to enable an effective code reivew, please break the PR down into smaller and more focused PRs.
See the Small CLs Google Eng practice for more details on how to write compact PRs.

@ezhulenev ezhulenev marked this pull request as draft June 12, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant