Repository navigation
perf(cuda): psnr_hvs — __ldg() + __restrict__ + __launch_bounds__(64) (ADR-0764) - #563
Merged
Merged
Conversation
… (ADR-0764) Apply the F3 struct-by-value fix (PR #96 candidate #5) to the psnr_hvs CUDA kernel in core/src/feature/cuda/integer_psnr_hvs/psnr_hvs_score.cu: - Extract `const float *__restrict__ ref_buf` and `dist_buf` from the VmafCudaBuffer struct args before the cooperative 64-thread tile load. - Apply `__ldg()` to both per-thread element reads, routing them through the L1 read-only texture cache (LDG.E.CONSTANT in SASS). - Add `__launch_bounds__(64)` matching the actual 8x8 block dispatch. No arithmetic change; bit-identical scores (ADR-0214 places=4). Predicted -3 to -5% kernel duration at >=1080p (mirrors ADR-0754 1080p -4.2% result). Six deep-dive deliverables: ADR-0764, Research-0764, changelog.d/perf, AGENTS.md invariant extended, rebase-notes.md entry, state.md row. Rebased from #107 onto current master. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 of 9 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
__ldg()+__restrict__pointer extraction +__launch_bounds__(64)pattern to thepsnr_hvsCUDA kernel (core/src/feature/cuda/integer_psnr_hvs/psnr_hvs_score.cu), PR docs(cuda): ADR-0756 F3 struct-by-value audit — 20 kernels, top-5 dispatch #96 candidate chore(deps): Update fedora:45 Docker digest to 0c1f63e #5.const float *__restrict__ ref_bufanddist_buffromVmafCudaBufferstruct args before the 64-thread cooperative tile load, routing all 128 reads through the L1 read-only texture cache via__ldg().__launch_bounds__(64)matching the actual 8×8 block dispatch.Rebased from original #107 branch onto current master.
Six deep-dive deliverables
docs/research/0764-cuda-psnr-hvs-ldg-launch-bounds-2026-05-29.md## Alternatives consideredcore/src/feature/cuda/AGENTS.md— psnr_hvs__ldg()tile load invariantmeson test -C build --suite=fast(CPU) — no CUDA gate required; arithmetic is unchangedchangelog.d/perf/cuda-psnr-hvs-ldg-launch-bounds.mddocs/rebase-notes.md— ADR-0764 section addedTest plan
no rebase impact: psnr_hvs_score.cu is fork-local; no upstream C/Python changes
Closes #107
🤖 Generated with Claude Code