Repository navigation
test(rocprofiler-sdk): range replay week of 2026-10-05: C1, C2 (stacked) - #12815
Draft
amd-vkale wants to merge 2 commits into
Conversation
…nothing tracing copies (C1, C2) Add tests/range-replay-declines, the first hardware tests that drive an application's range into a decline reason. The application binds its range with one kernel, writes 1 MiB of device memory from pinned host memory with a copy, and reads it back with a second kernel. The tool asks for four passes and configures range replay and nothing else, so no memory-copy tracing is active anywhere in the process. - C1 copies with hipMemcpyAsync on the range's stream. - C2 copies with hsa_amd_memory_async_batch_copy and waits on the host. It probes the entry point with a small copy before the range opens and skips where the runtime lacks it or rejects the operation. Both must close with MEMORY_COPY_IN_RANGE, one observed dispatch and no replayed pass. After end() the application checks its result and every copied element, so a decline that changed what it computes fails too. The copy is larger than GPU_FORCE_BLIT_COPY_SIZE (16 KiB by default) on purpose: HIP performs smaller copies with a kernel on the application's queue, which reaches the range as a dispatch rather than as a copy. A run without a GPU skips: the application tells the tool through the environment, so neither prints a failure. Co-authored-by: Vivek Kale <vivek.kale@amd.com>
…ay test roadmap The first week's tests have landed, so the roadmap no longer says nothing is implemented: the coverage table gains the decline tests and the unit test count is brought up to 92 with the kernarg block retention tests. Writing C1 turned up a gap. HIP performs a hipMemcpyAsync of up to GPU_FORCE_BLIT_COPY_SIZE (16 KiB by default) with a copy kernel on the application's own queue, so a range records it as a dispatch instead of declining, and a replayed pass re-reads host memory the snapshot does not cover (a pinned source the application may have changed, or HIP's reused staging buffer for a pageable one). Describe it under what is missing and schedule C28 into the December buffer week to test whichever behavior is decided. Co-authored-by: Vivek Kale <vivek.kale@amd.com>
1 task
Contributor
|
This pull request has been inactive for 25 days and will be marked as stale. If you would like to keep this PR open, please:
This PR will be automatically closed in 5 days if no further activity occurs. |
Contributor
|
This pull request has been automatically closed due to inactivity (30 days with no updates). If you'd like to continue working on this, feel free to reopen the PR or create a new one. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
First week of the range replay test roadmap (
source/docs/conceptual/range_replay/range_replay_test_plan.md): C1 and C2. Range replay must decline a range when a copy writes device memory inside it, because the replayed passes would run without that write. Two bugs in this area were fixed in #10864 without a regression test:hsa_amd_memory_async_batch_copybypassed it.These are the first tests that drive an application's range into a decline on hardware.
Stacked on the test roadmap branch (
users/vkale/range-replay-test-plan-with-cursor-fixes-help), which is stacked on #10864.Technical Details
New
tests/range-replay-declines/, in the style oftests/range-replay-local-context:Application (
main.cpp). It binds its range with one kernel and writes 1 MiB of device memory from pinned host memory with a copy. A second kernel then reads both ends of the copied buffer into the result.RR_DECLINE_MODEselects the copy:hip-memcpy-async(C1):hipMemcpyAsynchost-to-device on the range's stream.hsa-batch-copy(C2):hsa_amd_memory_async_batch_copywith one linear op, waited for on the host. The entry point is resolved withdlsym. Before the range opens, one small probe copy checks that the runtime accepts the operation, so a runtime that lacks or rejects it skips instead of failing. The case is compiled only where the HSA headers defineHSA_AMD_MEMORY_COPY_OP_VERSION.After
end(), it checks the result and every copied element, because a decline must not change what the application computes.Tool (
client.cpp). It configures the range replay domain and nothing else, so no memory-copy tracing is active in the process. It asks for four passes. It passes only if CLOSE reportsRR_DECLINE_EXPECT(MEMORY_COPY_IN_RANGE), exactly one observed dispatch, and no PASS callback.Copy size. HIP performs a
hipMemcpyAsyncof up toGPU_FORCE_BLIT_COPY_SIZE(16 KiB by default) with a copy kernel on the application's own queue. That kernel reaches the range as a dispatch, not as a copy. The tests copy 1 MiB so the copy goes throughhsa_amd_memory_async_copy*.No GPU. The application exits with
[app] SKIPand tells the tool through the environment, so the test reports skipped rather than failed.Roadmap update (the plan is revisited the first week of each month):
Issue Tracking
Related: #10864 (range replay, whose copy declines these tests guard).
Test Plan
test-range-replay-decline-hip-memcpy-async(C1) andtest-range-replay-decline-hsa-batch-copy(C2) on the mi325 CI jobs.-W -Wall -Wextra -Wshadow -Werroragainst the in-tree headers;[app] SKIPreports Skipped.Test Result
CI for this PR is pending. Nothing could be run on a GPU locally. The device code was not compiled here, because the in-tree HIP headers need a newer clang than the one on the build machine.
The base, #10864 at
0844152fe6, was green for range replay on mi325: 103 range replay tests passed and 1 was skipped on ubuntu-22.04, and 100 passed with 1 skipped on TheRock gfx94X. Its red jobs were:rocprofv3-test-attachment-attach-once-att(TheRock): the attached app's JSON output was missing. This also fails on develop.thread-trace-api-triple-buffer-no-pause-testand thekernel-replay-spmsample (ubuntu-22.04): both aborted. Thekernel-replay-spmsample and the-multiple-cmdstriple-buffer variant have aborted on develop before. I have not seen the-no-pausevariant fail on develop.Submission Checklist