[comgr][hotswap] Bound symbol-less return inference memory - #3608
[comgr][hotswap] Bound symbol-less return inference memory#3608harsh-amd wants to merge 2 commits into
Conversation
ea602cd to
8afcbe2
Compare
|
PR #3608 reduces peak memory use when HotSwap infers return regions for functions that have no symbol. The previous approach checked every candidate against every other candidate, which did not scale. This PR processes candidates in a single pass and skips any that have already been ruled out. A follow-up commit frees discarded candidates from memory immediately and ensures the selection order is deterministic. Translation output is unchanged. Focused tests
This includes:
Full offline corpusCorpus: original July 24, 2026 HotSwap corpus (2,685 paths, gfx1250).
There were 0 pass-to-fail regressions, 0 new crashes, and 0 new timeouts. For all 2,645 objects that succeeded in both builds: 0 changed output hashes, 0 changed output sizes. Built COMGR hashes: Docker runtime smokeImage:
|
harsh-amd
left a comment
There was a problem hiding this comment.
Reviewed head 8afcbe217e7069cd46ba265c1efe0b916b589f66 against merge base 2f69da2a91b3392dbe6cbe38c1e9692199093f29.
The streaming owner/tombstone state machine preserves the old singleton-overlap-component result for direct and transitive overlaps, while releasing invalidated region vectors. A fresh standalone Release production build succeeded, and HotswapMCTests passed 175/175 in both Release and exact ASan builds.
One process item also needs updating before landing: the PR description still says this is a cumulative draft that must not be merged, links the old #3598 source commit, and reports the older 213-test validation. The current PR is marked ready, is cleanly based on amd-staging, contains two commits, and has current 175-test/corpus results in a comment. Please update the description so the review range and landing status are unambiguous.
No semantic correctness issues found; the remaining code issue is the formatter failure noted inline.
| llvm::SmallVector<SymbolLessReturnRegion, 4> Regions; | ||
| std::vector<int64_t> RegionOwner(5, -1); | ||
|
|
||
| EXPECT_TRUE(claimSymbolLessReturnRegion( |
There was a problem hiding this comment.
[nit] Please run git clang-format over the final review range. The required code_formatter check currently fails on this block and several later assertions in the new ownership tests; the CI formatter diff starts here.
Filter symbol-less call groups that are already declared or externally reachable, and replace the final quadratic overlap scan with streaming ownership tombstones. Preserve transitive overlap rejection while releasing invalid region instruction vectors, and cover the ownership transition with focused and end-to-end tests. Co-authored-by: Paul-Zhang <31449988+paulzzy@users.noreply.github.com>
Swap invalidated regions with empty storage so heap-backed SmallVectors are released immediately. Deduplicate overlapping owners deterministically with sort/unique and test the storage-release invariant.
8afcbe2 to
a38e862
Compare
Scope
Bound symbol-less return-inference memory without changing the accepted fixed-point result.
Clean review range
Review status
Draft for early review. GitHub cannot base an upstream ROCm PR on a branch in the fork, so the Files changed view is temporarily cumulative with unmerged prerequisites. Review the clean fork PR and exact source commits linked above. This branch will be rebased and reduced after dependencies land; do not merge the cumulative snapshot.
#3598 remains unchanged as the immutable 2,685/2,685 integration reference.
Validation provenance
The source commits are exact ancestors of corpus-tested ab3cdd6. The cumulative integration passed 2,685/2,685 corpus paths, 213/213 HotswapMCTests, and COMGR lit with 168 passed, 14 unsupported, and 0 failed. Standalone current-staging formatting, focused tests, CI, and the appropriate corpus transition gate are required before this draft becomes ready.