Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c2d1d3f
fix(hrr): [ROCM-29823] order driver-memcpy D2D against non-blocking r…
danielbolsson Aug 20, 2026
3c0fe83
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Aug 21, 2026
cb519c6
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Aug 21, 2026
678d0f7
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Aug 24, 2026
52d7162
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Aug 24, 2026
9f33b4e
fix(hrr): make zero-init capture oracle deterministic
danielbolsson Aug 24, 2026
2e88b22
test(hrr): retain hipMalloc zero-init coverage
danielbolsson Aug 24, 2026
b5ef163
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Aug 24, 2026
af577f8
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 26, 2026
dc72d7d
test(hrr): rely on HIP's HSA package lookup
danielbolsson Aug 27, 2026
a2b71ad
Merge remote-tracking branch 'origin/develop' into fix/rocm-29823-drv…
danielbolsson Aug 27, 2026
df24caa
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 27, 2026
d93471a
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 27, 2026
61b4219
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 28, 2026
aa89556
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 28, 2026
e8d66f4
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 29, 2026
32fe12e
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 30, 2026
b3170ca
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 30, 2026
0ec397e
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
sunhmy-amd Aug 31, 2026
0a89520
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Sep 1, 2026
718453f
Enabled some tests on linux
danielbolsson Sep 1, 2026
cac4880
test(hrr): disable DrvMemcpy/ZeroInit roundtrip cases on amd_linux too
danielbolsson Sep 1, 2026
ff58e8c
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Sep 1, 2026
9189154
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
rahulc-gh Sep 3, 2026
424f19d
Merge remote-tracking branch 'origin/develop' into fix/rocm-29823-drv…
danielbolsson Sep 7, 2026
f81a8bc
Move HRR into standalone project
mangupta Aug 26, 2026
75c4ba0
Update CODEOWNERS
mangupta Aug 26, 2026
125cab8
Address HRR review feedback
mangupta Aug 26, 2026
68c8c81
Wire HRR_CLR_LIB for integration tests and CI
danielbolsson Aug 31, 2026
0d07b58
Revert "Wire HRR_CLR_LIB for integration tests and CI"
danielbolsson Aug 31, 2026
185b339
Document HRR runtime pairing requirement
mangupta Sep 2, 2026
a6587df
Add HRR build-only CI coverage
mangupta Sep 3, 2026
bef77f9
Address latest HRR review comments
mangupta Sep 3, 2026
174b6e2
Merge remote-tracking branch 'origin/users/mangupta/hrr-migration'
danielbolsson Sep 8, 2026
32a4953
Merge remote-tracking branch 'origin/develop'
danielbolsson Sep 9, 2026
4d1f3a4
Clarify A5 unrecorded write wording across platforms
Copilot Sep 9, 2026
04a75c2
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Sep 9, 2026
d60f1d0
Spell out the hsa_amd_memory_fill word count
danielbolsson Sep 9, 2026
14c1bba
Merge branch 'develop' into fix/rocm-29823-drv-memcpy-null-stream-ord…
danielbolsson Sep 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions projects/hrr/tests/integration/hrr_repro_workload_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* - embedded device pointers inside a by-value struct kernel argument,
* - an uncaptured host write that deterministically diverges replay,
* - the "null optional output pointer + 0x20000" GPU-fault class, and
* - replay zero-init of an otherwise-uninitialised device allocation.
* - replay zero-init of an allocation whose capture-time contents come from
* an unrecorded write (host or HSA runtime).
*
* Like hrr_workload.cc, every TEST_CASE here is hidden with the Catch2 [.] tag
* so it is NOT auto-discovered by CTest. Each is driven from hrr_roundtrip.cc:
Expand All @@ -28,6 +29,10 @@

#include "hrr_test_common.hh"

#ifndef _WIN32
#include <hsa/hsa_ext_amd.h>
#endif

#include <cstdint>

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -274,19 +279,30 @@ TEST_CASE("Unit_HRR_NullOptionalPtr_Direct", "[.][hrr-direct]") {
}

// ===========================================================================
// A5. Zero-init read of an uninitialised device allocation
// A5. Zero-init read of an allocation initialized by an unrecorded write
//
// hipMalloc a buffer and do NOT initialise it; a kernel copies it to `out`,
// then D2H. Fresh ROCm allocations are zeroed, so at capture out == 0 and the
// recorded blob is all-zero. Replay with HIP_HRR_REPLAY_ZERO_INIT=1 reproduces
// the zeroed source deterministically, so the replayed out matches; with the
// knob off, replay may reuse stale bytes and diverge.
// hipMalloc a buffer and zero it through the lower-level HSA runtime. HRR
// records HIP calls only, so replay sees the allocation but not the HSA fill and
// must reproduce the zeros through HIP_HRR_REPLAY_ZERO_INIT. This makes the
// capture oracle deterministic without recording a hipMemset that playback
// would execute independently of the zero-init knob.
// ===========================================================================
TEST_CASE("Unit_HRR_ZeroInitRead_Direct", "[.][hrr-direct]") {
HRR_HIP_CHECK(hipSetDevice(0));

float* dsrc = nullptr; // intentionally never written
float* dsrc = nullptr;
#ifndef _WIN32
HRR_HIP_CHECK(hipMalloc(&dsrc, kSZ));
// hsa_amd_memory_fill() counts in 32-bit words, not elements. kN happens to
// be the same number here only because kSZ is float[kN]; spell out the unit
// so a change of element type cannot silently under- or over-fill.
REQUIRE(hsa_amd_memory_fill(dsrc, 0, kSZ / sizeof(uint32_t)) == HSA_STATUS_SUCCESS);
#else
// Native Windows has no ROCr/HSA runtime. Keep its deterministic oracle via
// host stores; Linux retains coverage of the ordinary hipMalloc replay path.
HRR_HIP_CHECK(hipMallocManaged(&dsrc, kSZ));
for (int i = 0; i < kN; ++i) dsrc[i] = 0.0f;
#endif
float* dout = nullptr;
HRR_HIP_CHECK(hipMalloc(&dout, kSZ));

Expand Down
9 changes: 3 additions & 6 deletions projects/hrr/tests/integration/hrr_roundtrip_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,9 @@ HRR_TEST_CASE(Unit_HRR_EmbeddedPtrRoundtrip) {
/**
* Test Description
* ----------------
* - Capture Unit_HRR_ZeroInitRead_Direct (uninitialised device buffer copied
* to out, then D2H; captured blob is all-zero on a zeroing driver).
* - Capture Unit_HRR_ZeroInitRead_Direct (hipMalloc allocation zeroed through
* an unrecorded HSA fill on ROCr, copied to out, then D2H; native Windows
* uses managed memory and unrecorded CPU stores because HSA is unavailable).
* - Replay with HIP_HRR_REPLAY_ZERO_INIT=1: the replayed source is zeroed
* deterministically, so the D2H validates (exit 0, pass >= 1). Verifies the
* zero-init replay knob. Note: with the knob off the replay may reuse stale
Expand All @@ -741,12 +742,8 @@ HRR_TEST_CASE(Unit_HRR_ZeroInitRoundtrip) {
int d2h_pass = 0, d2h_fail = 0;
REQUIRE(hrr_parse_d2h_summary(out, d2h_pass, d2h_fail));
INFO("D2H pass=" << d2h_pass << " fail=" << d2h_fail);
// With ASAN enabled this won't be true, because inside Unit_HRR_ZeroInitRead_Direct
// fresh device allocations are not zeroed with ASAN enabled
#if !defined(ENABLE_ADDRESS_SANITIZER)
CHECK(d2h_pass >= 1);
CHECK(d2h_fail == 0);
#endif
}

/**
Expand Down
10 changes: 10 additions & 0 deletions projects/hrr/tests/integration/hrr_workload_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2784,6 +2784,12 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") {
p.srcPitch = SZ; p.srcHeight = 1;
p.dstPitch = SZ; p.dstHeight = 1;
HRR_HIP_CHECK(hipDrvMemcpy3D(&p)); }
// hipDrvMemcpy3D is host-synchronous only when the copy touches host memory;
// ihipMemcpyParam3D() forces the D2D case asynchronous, so (3) is merely
// enqueued on the null stream. s was created with hipStreamNonBlocking and so
// never joins the null stream, leaving the readback below unordered against
// the copy unless it is drained here.
HRR_HIP_CHECK(hipDeviceSynchronize());
Comment thread
danielbolsson marked this conversation as resolved.
Resolved

int* h = new int[N]();
HRR_HIP_CHECK(hipMemcpyAsync(h, C, SZ, hipMemcpyDeviceToHost, s));
Expand Down Expand Up @@ -2894,6 +2900,10 @@ TEST_CASE("Unit_HRR_DrvMemcpy2DUnaligned_Direct", "[.][hrr][direct]") {
p.dstMemoryType = hipMemoryTypeDevice; p.dstDevice = reinterpret_cast<hipDeviceptr_t>(B); p.dstPitch = SZ;
p.WidthInBytes = SZ; p.Height = 1;
HRR_HIP_CHECK(hipDrvMemcpy2DUnaligned(&p)); }
// Same ordering hazard as the 3D workload above: hipDrvMemcpy2DUnaligned goes
// through ihipMemcpyParam3D(), which forces the D2D case asynchronous on the
// null stream, and s is non-blocking.
HRR_HIP_CHECK(hipDeviceSynchronize());

int* h = new int[N]();
HRR_HIP_CHECK(hipMemcpyAsync(h, B, SZ, hipMemcpyDeviceToHost, s));
Expand Down
Loading