Fix zero-extent GPU image launches - #6505
Merged
jantonguirao merged 5 commits intoSep 29, 2026
Merged
Conversation
Skip zero-pixel samples in the shared color conversion and Flip launchers before computing launch dimensions. Add a mixed-batch regression test. Fixes NVIDIA#6504 Signed-off-by: Srijan Keshri <212402043+arcusbuilds@users.noreply.github.com>
Contributor
|
This comment has been minimized.
This comment has been minimized.
Keep unsupported conversion pairs rejected when the pixel count is zero, and cover the case in the existing GPU operator test. Signed-off-by: Srijan Keshri <212402043+arcusbuilds@users.noreply.github.com>
4 of 18 tasks
jantonguirao
added a commit
to jantonguirao/DALI
that referenced
this pull request
Sep 29, 2026
RunColorSpaceConversionKernel and FlipImpl have the same class of host-side divide-by-zero bug for zero-extent samples, but that part is already covered by NVIDIA#6505 — drop the duplicate fix here to avoid two PRs touching the same code for the same reason.
3 of 9 tasks
Make block/grid safe for npixels == 0 instead of special-casing it with a second copy of the supported-conversion list. Unsupported conversions now fall through to the single existing DALI_FAIL at the end of the dispatch chain regardless of npixels, so there's one source of truth for which conversions are supported. Also bump copyright years on the touched files to 2026.
Collaborator
|
!build |
Collaborator
|
CI MESSAGE: [70400057]: BUILD STARTED |
Collaborator
|
CI MESSAGE: [70400057]: BUILD FAILED |
CUDA rejects a zero-sized grid with cudaErrorInvalidConfiguration rather than treating it as a no-op, so the color-space-conversion kernel launch (and its error check) must be skipped when npixels == 0 instead of launching with grid == 0. Unsupported conversions still hit DALI_FAIL regardless of npixels. Also fix an ambiguous TensorListShape<3> constructor call in the new zero-extent test (single-element braced-init is ambiguous between the copy/move ctor and the vector<TensorShape<3>> ctor), which was the actual cause of the CI build failure.
Collaborator
|
CI MESSAGE: [70433025]: BUILD STARTED |
Collaborator
|
CI MESSAGE: [70433025]: BUILD FAILED |
Collaborator
|
!build |
Collaborator
|
CI MESSAGE: [70435968]: BUILD STARTED |
Collaborator
|
CI MESSAGE: [70435968]: BUILD PASSED |
jantonguirao
approved these changes
Sep 29, 2026
jantonguirao
added a commit
to jantonguirao/DALI
that referenced
this pull request
Sep 29, 2026
…UDA affine remap InvertTransforms/CopyTransforms and adjustMatrices compute their CUDA launch grid by dividing by a batch-derived count. When the batch is empty, that count is zero, causing a host-side division by zero before any kernel is even launched. Return early from each launcher when there is no work to do. RunColorSpaceConversionKernel and FlipImpl have the same class of bug for zero-extent samples within an otherwise non-empty batch, but that part is already fixed in NVIDIA#6505, so this is scoped to the two remaining call sites. Fixes NVIDIA#6504
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.
Category
Bug fix
Description
Return from the shared GPU Flip and color conversion launchers when a sample has zero pixels, before computing launch dimensions. This prevents host-side division by zero for zero-extent samples in a nonempty batch. Fixes #6504.
Additional information
The guards are in the launchers, so all callers use them. A mixed-batch GTest sends an empty sample and a normal RGB pixel through Flip and color conversion, then checks the BGR output. A second test checks that an unsupported conversion still fails for an empty sample.
Tests
ColorSpaceConversionTest.ZeroExtentSampleGPU,ColorSpaceConversionTest.ZeroExtentUnsupportedConversionGPUChecklist
REQ IDs: N/A
JIRA TASK: N/A