fix(rtx): reintroduce BF16 support, fall back depthwise conv to PyTorch#4178
Open
tp5uiuc wants to merge 1 commit intopytorch:mainfrom
Open
fix(rtx): reintroduce BF16 support, fall back depthwise conv to PyTorch#4178tp5uiuc wants to merge 1 commit intopytorch:mainfrom
tp5uiuc wants to merge 1 commit intopytorch:mainfrom
Conversation
Remove the global BF16 disable on TensorRT-RTX and instead add a targeted capability_validator that rejects only depthwise convolutions (groups == out_channels) when the input tensor is BF16. This causes the partitioner to fall back to PyTorch for those specific nodes while all other convolutions remain on TRT. Root cause: TensorRT-RTX does not support depthwise conv/deconv in BF16. The previous global disable was overly broad — all non-depthwise ops support BF16 correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lanluo-nvidia
approved these changes
Apr 10, 2026
Collaborator
lanluo-nvidia
left a comment
There was a problem hiding this comment.
lgtm
waiting for the ci to pass.
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.
Description
TensorRT-RTX does not support depthwise convolutions (grouped conv where
groups == out_channels) in BF16. Previously, BF16 was globally disabled on TensorRT-RTX as a workaround. This was overly broad — all non-depthwise ops support BF16 correctly.This PR removes the global BF16 disable and instead adds a targeted
capability_validator(depthwise_bf16_validator) on theaten.convolution.defaultconverter. When a depthwise convolution with a BF16 input tensor is detected on TensorRT-RTX, the validator returnsFalse, causing the partitioner to fall back to PyTorch for that specific node. All other convolutions remain on TRT.Changes:
_TRTInterpreter.py: Remove the globalRuntimeErrorfor BF16 on RTXaten_ops_converters.py: Adddepthwise_bf16_validatorand register it on the convolution converterpytest.skip/@unittest.skipIfguards that blocked BF16 tests on RTXType of change
Checklist: