Repository navigation
Conversation
qi7876
marked this pull request as ready for review
October 31, 2026 06:28
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.
InternVideo3 vision patch embedding applies Conv3d to independent inputs whose spatial/temporal dimensions exactly match the convolution kernel. On PyTorch 2.9.1 + cuDNN 9.10.2 with BF16 contiguous tensors, this dispatches to
aten::slow_conv_dilated3d, dominating inference while leaving the GPU lightly utilized.Replace this patch projection with the mathematically equivalent
F.linear, flattening the existing Conv3d weight. The Conv3d module, parameter names/shapes, bias, checkpoint loading and patch order remain intact.PyTorch 2.9.1 explicitly disables cuDNN for contiguous FP16/BF16 3D convolutions with non-unit kernels on cuDNN 9.8–9.14, as a workaround for a known cuDNN issue: https://github.com/pytorch/pytorch/blob/v2.9.1/aten/src/ATen/native/Convolution.cpp#L417-L427 . On the same machine, profiling confirms FP16/BF16 contiguous inputs use the slow fallback, while channels_last_3d inputs and FP32 inputs use cuDNN. This is a version/dtype/layout-dependent problem, not a claim that all Conv3d implementations are slow. Current PyTorch main no longer contains this exact guard; it was not runtime-tested here. This change avoids the unnecessary convolution backend dependency entirely.
Validation:
The same fix should also be synchronized into the published Hugging Face custom model code, which has the same patch-embedding forward.