Repository navigation
perf(sycl): preallocate pinned host pictures for zero-copy 4K CLI upload (ADR-1410) - #1693
Merged
Merged
Conversation
Contributor
Author
|
ADR number collision: |
lusoris
force-pushed
the
perf/sycl-pageable-upload
branch
from
October 1, 2026 12:18
a6b829d to
f615060
Compare
…oad (ADR-1410) When running the vmaf CLI with --backend sycl, pictures were previously allocated in standard pageable host heap memory, causing the driver to perform staging copies on the host thread on upload. At 4K (3840x2160), luma upload alone cost 2.2 to 3.0 ms per frame, and chroma was packed into intermediate staging buffers. Introduce a pinned host USM picture pool: 1. Extend VmafPicturePoolConfig with optional custom picture allocation, free, sync, and attach callbacks, and add buffer type VMAF_PICTURE_BUFFER_TYPE_SYCL_HOST_PINNED. 2. In core/src/sycl/picture_sycl.cpp, implement pinned picture allocation using vmaf_sycl_malloc_host() with 32-byte plane alignment. 3. In libvmaf.c:prepare_picture_pool(), wire pinned allocation callbacks when SYCL backend is enabled, synchronizing on upload completion events prior to picture buffer reuse. 4. In sycl_enqueue_chroma_plane() and vmaf_sycl_shared_frame_upload(), detect host USM pictures; for contiguous host memory, bypass staging buffers to enqueue direct asynchronous DMA copies to the device. 5. In test_sycl_pic_preallocation.c, verify pinned pool preallocation, fetch, and cleanup cycles. Measured on an Intel Arc A380 under Linux xe driver with BBB 3840x2160 8-bit YUV: luma + chroma upload time dropped from 2.2–3.0 ms down to 0.70 ms steady-state (~3-4x speedup in upload latency). Scores across PSNR Y, Cb, Cr are bit-identical (0.0 ULP drift). Closes T-SYCL-PAGEABLE-UPLOAD-HOST-STAGING-2026-09-29. ADR-1410.
lusoris
force-pushed
the
perf/sycl-pageable-upload
branch
from
October 1, 2026 12:41
f615060 to
37ea301
Compare
This was referenced Oct 1, 2026
This was referenced Oct 1, 2026
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
When running the
vmafCLI with--backend sycl, pictures were previously allocated in standard pageable host heap memory, causing the driver to perform synchronous staging copies on the host thread during plane upload. At 4K (3840x2160), luma upload alone took 2.2 to 3.0 ms per frame, and chroma was packed into intermediate staging buffers.This PR introduces a pinned host USM picture pool:
VmafPicturePoolConfigwith optional custom callbacks (alloc_picture_callback,free_picture_callback,sync_picture_callback,attach_picture_callback,cookie) and buffer typeVMAF_PICTURE_BUFFER_TYPE_SYCL_HOST_PINNED.vmaf_sycl_picture_alloc_pinned()(core/src/sycl/picture_sycl.cpp) usingvmaf_sycl_malloc_host()(sycl::malloc_host) with 32-byte plane alignment matching the contiguous layout.libvmaf.c:prepare_picture_pool(), wires pinned allocation callbacks when the SYCL backend is enabled, synchronizing on upload completion events prior to picture buffer reuse.sycl_enqueue_chroma_plane()andvmaf_sycl_shared_frame_upload(), detects host USM pictures; for contiguous host memory, bypasses staging buffers to enqueue direct asynchronous DMA copies to the device.test_sycl_pic_preallocation.c, tests pinned pool preallocation, fetch, and cleanup cycles.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 Recently closed section.Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.Measurements
Measured on an Intel Arc A380 under Linux
xedriver with BBB 3840x2160 8-bit YUV:Closes
T-SYCL-PAGEABLE-UPLOAD-HOST-STAGING-2026-09-29. ADR-1410.Deep-dive deliverables (ADR-0108)
## Alternatives considered(ADR-1410).AGENTS.mdinvariant note — no rebase-sensitive invariants: CLI-level picture pool allocation using existing SYCL USM allocator primitives.changelog.d/changed/perf-sycl-cli-pinned-host-picture-pool.mdadded.docs/rebase-notes.md.Reproducer
Known follow-ups
None.