Repository navigation
fix(rocprofiler-compute): Preserve PC sampling code object identity - #13742
vedithal-amd merged 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused change matches the object-relative decoding contract and includes regression coverage, with no unresolved issues identified.
No open issues 🎉
What changed in this PR
Preserves code object identity during PC sampling decoding, preventing finalization failures when GPU addresses are reused.
Changes:
- Decodes instructions using the code object ID and relative address.
- Adds regression coverage for reused addresses within and beyond the older object’s range.
- Documents the fix in the changelog.
| File | Description |
|---|---|
| projects/rocprofiler-compute/src/lib/pc_sampling_collector/tests/test_code_object_translator.h | Defines the translator test fixture. |
| projects/rocprofiler-compute/src/lib/pc_sampling_collector/tests/test_code_object_translator.cpp | Tests decoding distinct objects sharing a load address. |
| projects/rocprofiler-compute/src/lib/pc_sampling_collector/tests/CMakeLists.txt | Registers the new test files. |
| projects/rocprofiler-compute/src/lib/pc_sampling_collector/code_object_translator.cpp | Uses object-specific instruction lookup. |
| projects/rocprofiler-compute/CHANGELOG.md | Records the JAX and PyTorch sampling fix. |
Review effort: Balanced
feizheng10
left a comment
There was a problem hiding this comment.
Two non-blocking notes.
vedithal-amd
left a comment
There was a problem hiding this comment.
LGTM. Decoding by code object id plus offset matches how rocprofv3 decodes samples, and the new test fails without the change: the reused address decodes the old object, and the lookup past the old range throws. Also verified locally on gfx950: cold-cache torch.compile max-autotune runs now write the ISA listing with both stochastic and host_trap.
…13742) ## Motivation <!-- Explain the purpose of this PR and the goals it aims to achieve. --> Prevent JAX/PyTorch PC sampling finalization failures when GPU addresses are reused. ## Technical Details <!-- Explain the changes along with any relevant GitHub links. --> - Decode instructions using the code object ID and relative address. - Add a regression test for reused addresses. ## Issue Tracking <!-- Include a GitHub Issue and/or JIRA ID. Do not post any full JIRA links here. --> <!-- GitHub issue: #1234 --> <!-- JIRA ID: EXAMPLECOMPONENT-1234 --> JIRA ID: ROCM-32558 ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> - Run collector tests. - Validate JAX sampling and PyTorch cold-cache training on MI350X. - Check clean exit, cleanup and ISA output. ## Test Result <!-- Briefly summarize test outcomes. --> - All 68 PC sampling collector tests passed, including the new test for this bug. - JAX and PyTorch validation passed. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
…13742) ## Motivation <!-- Explain the purpose of this PR and the goals it aims to achieve. --> Prevent JAX/PyTorch PC sampling finalization failures when GPU addresses are reused. ## Technical Details <!-- Explain the changes along with any relevant GitHub links. --> - Decode instructions using the code object ID and relative address. - Add a regression test for reused addresses. ## Issue Tracking <!-- Include a GitHub Issue and/or JIRA ID. Do not post any full JIRA links here. --> <!-- GitHub issue: #1234 --> <!-- JIRA ID: EXAMPLECOMPONENT-1234 --> JIRA ID: ROCM-32558 ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> - Run collector tests. - Validate JAX sampling and PyTorch cold-cache training on MI350X. - Check clean exit, cleanup and ISA output. ## Test Result <!-- Briefly summarize test outcomes. --> - All 68 PC sampling collector tests passed, including the new test for this bug. - JAX and PyTorch validation passed. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
…13742) ## Motivation <!-- Explain the purpose of this PR and the goals it aims to achieve. --> Prevent JAX/PyTorch PC sampling finalization failures when GPU addresses are reused. ## Technical Details <!-- Explain the changes along with any relevant GitHub links. --> - Decode instructions using the code object ID and relative address. - Add a regression test for reused addresses. ## Issue Tracking <!-- Include a GitHub Issue and/or JIRA ID. Do not post any full JIRA links here. --> <!-- GitHub issue: #1234 --> <!-- JIRA ID: EXAMPLECOMPONENT-1234 --> JIRA ID: ROCM-32558 ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> - Run collector tests. - Validate JAX sampling and PyTorch cold-cache training on MI350X. - Check clean exit, cleanup and ISA output. ## Test Result <!-- Briefly summarize test outcomes. --> - All 68 PC sampling collector tests passed, including the new test for this bug. - JAX and PyTorch validation passed. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
Motivation
Prevent JAX/PyTorch PC sampling finalization failures when GPU addresses are reused.
Technical Details
Issue Tracking
JIRA ID: ROCM-32558
Test Plan
Test Result
Submission Checklist