Repository navigation
Conversation
UnrollConv3dToConv2d splits a 3D TransposedConvolution into 2D TransposedConvolutions per (input depth, kernel depth) pair and places each result at output depth actIndex * strideZ + depthIndex. The IE.TransposedConvolution filter is stored spatially reversed in Z, Y and X (LegalizeConvBackpropData reverses all spatial axes). Y/X are handled correctly by the 2D TransposedConvolution, but the Z slice was taken as slicedFilters[depthIndex], i.e. from the reversed filter, while the placement uses the original kernel index. Net effect: the kernel is applied flipped along depth, so any 3D ConvolutionBackpropData / ConvTranspose3d with kernelZ > 1 returns wrong results on NPU (cosine similarity ~0 vs CPU for k4 s2 p1; kernelZ == 1 is unaffected). Use slicedFilters[kernelZ - 1 - depthIndex] and update the LIT expectations accordingly. Observed on PTL NPU (driver 1.32.0.20260402, OV 2026.3/2026.4.1): the NPU output of a single ConvolutionBackpropData 5D op equals the CPU reference computed with the kernel flipped along D (cos 1.00000). IGEV++ stereo depth (3x ConvTranspose3d k4 s2 p1 in cost aggregation) gives Middlebury EPE 3.30 px on NPU vs 0.89 px on CPU; with the weights pre-flipped along D the NPU result is 0.892 px. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…roll The existing 3D TransposedConvolution unroll tests use kernelZ = 2 and mostly splat (all-ones) filters, so the per-depth filter slices are identical and a wrong depth kernel index cannot be detected. Add a kernelZ = 3 case whose filter holds different values in every depth slice, and check which slice each unrolled 2D TransposedConvolution uses, which input depth it reads, and the order of the concatenated output. The case is added for NPU37XX/NPU40XX and for NPU50XX+ (which had no TransposedConvolution coverage in this pass). Both new cases fail without the preceding fix and pass with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dyang23
force-pushed
the
fix/unroll-3d-tconv-depth-flip
branch
from
November 17, 2026 02:59
e88be89 to
625b0a5
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
UnrollConv3dToConv2d(TransposedConvGeneralRewriter) unrolls a 3DIE.TransposedConvolutioninto 2D TransposedConvolutions,one per (input depth, kernel depth) pair, and places each result at output depth
actIndex * strideZ + depthIndex - padBeginZ.The
IE.TransposedConvolutionfilter is already spatially reversed:LegalizeConvBackpropDatareverses Z/Y/X when it convertsConvolutionBackpropData. Y/X are handled correctly because the 2D TransposedConvolution consumes the reversed kernel. In depth,though, the pass takes
slicedFilters[depthIndex]from the reversed filter while placing the result with the original(non-reversed) index. As a result, the kernel is applied flipped along depth.
Effect: every 3D ConvTranspose / ConvolutionBackpropData with kernel depth > 1 returns wrong values on the NPU, with no error or
warning. Kernel depth 1 and 2D deconvolution are not affected.
Fix: use
slicedFilters[kernelZ - 1 - depthIndex].Commits:
mapping; it went unnoticed because they use kernelZ = 2 and mostly splat filters.
50XX+ file had no TransposedConvolution coverage for this pass.
JIRA ticket
Target Platform For Release Notes
Classification of this Pull Request
Validation
LIT (Release build on top of develop 56e4d44, OpenVINO 88f8c6bf):
unroll_conv3d_to_conv2d_37XX_40XX.mlirandunroll_conv3d_to_conv2d_50XX+.mlirpass on NPU3720, NPU4000 and NPU5010.dialect/IEdirectory: 4 failures per platform, and the same 4 also fail without this change (unrelated to this PR):convert_precision_to_i32,dump_statistics_of_ie_ops,constant_tracing_ws,low_precision_asymmetric_zp_per_tensor_true_37XX_40XX_50XX_60XX.On device: PTL (NPU5010), Linux NPU driver 1.32.0.20260402, OpenVINO 2026.4.1. The CiD library was built with the
job_build_cid.ymloptions and loaded viaLD_LIBRARY_PATH, with a fresh driver cache for every run. The fixed and unfixedbuilds differ only by this change.
The unfixed build reproduces the installed driver's results exactly.
End-to-end, IGEV++ stereo (3 x ConvTranspose3d k4 s2 p1), Middlebury MiddEval3 15 scenes, 480x640, unmodified model:
Related PRs
🤖 Generated with Claude Code