fix(hip): stage the luma plane onto the device before the ADM DWT2 launch - #1370
Draft
lusoris wants to merge 3 commits into
Draft
fix(hip): stage the luma plane onto the device before the ADM DWT2 launch#1370lusoris wants to merge 3 commits into
lusoris wants to merge 3 commits into
Conversation
lusoris
pushed a commit
that referenced
this pull request
Sep 6, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
Sep 7, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/hip-integer-adm-picture-staging
branch
from
September 7, 2026 06:54
d1e33ff to
73eaca0
Compare
lusoris
pushed a commit
that referenced
this pull request
Sep 7, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/hip-integer-adm-picture-staging
branch
2 times, most recently
from
September 7, 2026 09:16
feff236 to
f6b3809
Compare
lusoris
pushed a commit
that referenced
this pull request
Sep 7, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/hip-integer-adm-picture-staging
branch
from
September 7, 2026 10:18
f6b3809 to
07ef118
Compare
…unch integer_adm_hip faulted the GPU on the first frame and killed the process: Memory access fault by GPU node-1 on address 0x556905b5a000. Reason: Page not present or supervisor privilege. Running the test under AMD_SERIALIZE_KERNEL=3 HIP_LAUNCH_BLOCKING=1 AMD_LOG_LEVEL=3 named the offender as the very first kernel launched, adm_dwt2_8_vert_hori_kernel_4_16_32768_128_8_uint8_t, and put the faulting address in the host heap range — the tell that a host pointer reached a device kernel. It did. extract_fex_hip passed ref_pic->data[0] and dis_pic->data[0] straight into dwt2_8_device_hip / dwt2_16_device_hip, but the HIP backend is host-pic (ADR-0530), so those are HOST pointers. The CUDA twin needs no staging because vmaf_cuda_picture_* hands it device memory already; the HIP port inherited the CUDA call shape without the thing that made it valid. integer_psnr_hip already staged correctly via ref_in / dis_in, which is exactly why test_hip_psnr_parity passed while the ADM test cored. Fixed by allocating a per-side device staging buffer for the scale-0 luma plane in init_fex_hip and copying the host plane across with hipMemcpy2DAsync before the DWT2 launch. The staged rows are tightly packed, so the element stride handed to the kernel becomes w rather than the picture's stride. Verified on a gfx1030: test_hip_adm_parity 3/3 (was a GPU coredump), HIP parity suite 16 pass/1 fail -> 17 pass/1 fail, and `vmaf --backend hip --feature adm_hip` returns integer_adm2 = 0.962084 instead of killing the process. The one remaining HIP failure is the separately-tracked, ADR-0564-deferred ssim float kernel. Closes T-HIP-INTEGER-ADM-GPU-PAGE-FAULT-2026-09-05 and the second half of T-GAP-HIP-INTEGER-ADM-PICTURE-STAGING-DEFERRED-2026-09-02. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…(ADR-1206) Extends the large-fixture variants to HIP, now that ADR-1211 lets the HIP ADM extractor run at all. Verified on a gfx1030: 16 pass, 0 fail, 1 skip. Two tests are handled explicitly rather than silently. `float_ssim_hip` is a documented v1 scale=1-only extractor, so its large variant records that contract as a skip and still fails loudly if the twin ever stops refusing. `test_hip_ssim_parity` is excluded from the list: its divergence is the ADR-0564-deferred 11-tap float Gaussian (T-GAP-HIP-INTEGER-SSIM-FLOAT-KERNEL-DEFERRED-2026-09-02), so a second fixture would only re-report a deferred gap at another resolution. Metal is now the only family without large-fixture variants — no Apple hardware on this workstation to verify against. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/hip-integer-adm-picture-staging
branch
from
September 7, 2026 11:14
07ef118 to
0938742
Compare
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.
Summary
integer_adm_hipfaulted the GPU on the first frame and killed the process:Tracked as
T-HIP-INTEGER-ADM-GPU-PAGE-FAULT-2026-09-05; reproduced here on a gfx1030.Running the test under
AMD_SERIALIZE_KERNEL=3 HIP_LAUNCH_BLOCKING=1 AMD_LOG_LEVEL=3named the offender as the very first kernel launched,adm_dwt2_8_vert_hori_kernel_4_16_32768_128_8_uint8_t, and put the faulting address in the host heap range — the tell that a host pointer reached a device kernel.It did.
extract_fex_hippassedref_pic->data[0]anddis_pic->data[0]straight intodwt2_8_device_hip/dwt2_16_device_hip, but the HIP backend is host-pic (ADR-0530), so those are HOST pointers. The CUDA twin needs no staging becausevmaf_cuda_picture_*hands it device memory already — the HIP port inherited the CUDA call shape without the thing that made it valid.integer_psnr_hipalready stages correctly via itsref_in/dis_inbuffers, which is exactly whytest_hip_psnr_paritypassed while the ADM test cored.Fixed by allocating a per-side device staging buffer for the scale-0 luma plane in
init_fex_hipand copying the host plane across withhipMemcpy2DAsyncbefore the DWT2 launch. The staged rows are tightly packed, so the element stride handed to the kernel becomeswrather than the picture's stride.test_hip_adm_parityvmaf --backend hip --feature adm_hipinteger_adm2 = 0.962084The one remaining HIP failure is
test_hip_ssim_parity(4.53e-03), the separately-trackedT-GAP-HIP-INTEGER-SSIM-FLOAT-KERNEL-DEFERRED-2026-09-02— an 11-tap float Gaussian where the CPU uses a 9-tap int64 kernel, formally deferred under ADR-0564. Untouched here.Also in this PR: HIP large-fixture parity variants (ADR-1206)
With the ADM extractor able to run, the 960x540 sweep that found the SYCL bug (#1369) could finally run on HIP too. Result on gfx1030: 16 pass, 0 fail, 1 skip — no new HIP defects, which is a useful negative result.
Two tests are handled explicitly rather than silently:
float_ssim_hipis a documented v1 scale=1-only extractor; its large variant records that contract as a skip, and still fails loudly if the twin ever stops refusing.test_hip_ssim_parityis excluded from the list: its divergence is the ADR-0564-deferred 11-tap float Gaussian, so a second fixture would only re-report a deferred gap at another resolution.Metal is now the only family without large-fixture variants — no Apple hardware here to verify against.
Type
fix— bug fixsycl/cuda/simd— backend-specific (HIP)Checklist
make format && make lintis green locally (pre-commit run --filesclean;assertion-density,check-copyright,check-state-md-rowspass).meson test -C build— HIP parity suite 17/1 on a gfx1030; the failure is the pre-existing deferred ssim gap./cross-backend-diffand the worst ULP is ≤ 2 — equivalent done directly:test_hip_adm_paritycompares CPU vs HIP at places=4 and now passes, where it previously could not run at all..c/.h— no new source files.docs/adr/_index_fragments/— index in sync.Bug-status hygiene (ADR-0165)
docs/state.mdupdated —T-HIP-INTEGER-ADM-GPU-PAGE-FAULT-2026-09-05moved to Recently closed; it also closes the second half ofT-GAP-HIP-INTEGER-ADM-PICTURE-STAGING-DEFERRED-2026-09-02.Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.Deep-dive deliverables (ADR-0108)
## Alternatives consideredin ADR-1211, including making the whole HIP backend device-pic and disabling the extractor with.flags = 0, and why both were rejected.AGENTS.mdinvariant note — added tocore/src/hip/AGENTS.md.changelog.d/fixed/hip-integer-adm-picture-staging.md.docs/rebase-notes.md, "ADR-1211 — HIP is host-pic; device kernels need staged input".Reproducer
Needs a ROCm device. Note
-Denable_hipcc=true— without it the HIP picture allocator is an-ENOSYSstub and every HIP extractor fails withproblem reading picturesfor an unrelated reason.meson setup build core -Denable_hip=true -Denable_hipcc=true -Denable_cuda=false -Denable_sycl=false ninja -C build meson test -C build test_hip_adm_parityOn
masterthe process dies withMemory access fault by GPU node-1; on this branch the test is 3/3.Known follow-ups
hipStreamSynchronizefor correctness on this first cut; overlapping it with the existing ref/dis events is a performance follow-up.🤖 Generated with Claude Code