Repository navigation
perf(sycl,hip): compact nonzero terms before psnr_hvs readback (ADR-1397) - #1733
Merged
Merged
Conversation
…397) Compact nonzero terms directly on the device prior to host readback for both psnr_hvs_sycl and psnr_hvs_hip. Because x + 0.0f == x for all floats in the running sum, zero error terms contribute nothing to plane scores. By computing 64-bit nonzero bitmasks per block and performing work-group prefix scans, each frame compacts nonzero terms into contiguous device buffers and reads back only nonzero terms. Results: - Readback shrinks by 94-97% across resolutions (4K drops from 198.3 MB to 11.0 MB). - 4K throughput improves from 39.23 ms to 29.30 ms/frame on Arc A380 and from 41.18 ms to 35.53 ms/frame on gfx1036. - SYCL kernels remain completely scratch-free (0 private memory, 0 spills). - All 5 test cases remain 100% bit-identical to CPU at --precision max. Updates T-SYCL-HIP-PSNR-HVS-EXACT-SUM-THROUGHPUT-2026-10-01.
lusoris
force-pushed
the
perf/sycl-hip-psnr-hvs-tune
branch
from
October 1, 2026 16:36
29f3279 to
8816294
Compare
This was referenced Oct 1, 2026
11 of 18 tasks
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
Compact nonzero terms directly on the device prior to host readback for both
$x + 0.0\text{f} == x$ for all
psnr_hvs_syclandpsnr_hvs_hip. Becausefloats in the running sum, zero error terms contribute nothing to plane scores.
Compaction shrinks readback buffer size by 94-97% (198.3 MB -> 11.0 MB at 4K)
and speeds up 4K throughput to 29.30 ms/frame on Arc A380 and 35.53 ms/frame on gfx1036.
Type
feat— new featurefix— bug fixperf— performance improvementrefactor— no behavior changedocs— documentation onlytest— test-onlybuild/ci— tooling / infraport— cherry-pick from upstream Netflix/vmafsycl/cuda/simd— backend-specificChecklist
make format && make lintis green locally.python3 scripts/ci/run_meson_test.py -- -C build./cross-backend-diffand the worst ULP is ≤ 2..c/.cpp/.cu/.h/.hpp, it has the appropriate license header (seeCONTRIBUTING.md).!orBREAKING CHANGE:and the migration path is documented below.docs/adr/_index_fragments/<NNNN-slug>.mdand the slug is appended todocs/adr/_index_fragments/_order.txt— do not editdocs/adr/README.mddirectly (regenerated byscripts/docs/concat-adr-index.sh; see ADR-0221).Bug-status hygiene (ADR-0165)
docs/state.mdupdated in this PR with a row in the appropriate section (Open / Recently closed / Confirmed not-affected / Deferred), ORno state delta: REASON.Updates
T-SYCL-HIP-PSNR-HVS-EXACT-SUM-THROUGHPUT-2026-10-01.Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.Cross-backend numerical results
Bit-identical (diff 0.00e+00) across all 5 test sets against
--backend cpuof the same binary at--precision max:Performance (if
perforfeat)ms/frame, median of 3 runs of (t(N) - t(2)) / (N - 2), before -> after:
Readback size:
Deep-dive deliverables (ADR-0108)
AGENTS.mdinvariant note — no rebase-sensitive invariants.changelog.d/changed/perf-sycl-hip-psnr-hvs-device-compact.mddocs/rebase-notes.mdunder a new ID.Reproducer
Known follow-ups
Row
T-SYCL-HIP-PSNR-HVS-EXACT-SUM-THROUGHPUT-2026-10-01remains open for remaining tuning (SYCL: 29.30 ms vs 22.4 ms pre-ADR-1401 baseline; HIP: 35.53 ms vs 18.3 ms baseline).