feat: add aten.glu converter - #4475
Open
zupengwang wants to merge 1 commit into
Open
Conversation
zupengwang
marked this pull request as ready for review
August 11, 2026 06:58
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
Adds Dynamo converter support for
torch.ops.aten.glu.default. The converter implements GLU as an equal split followed by sigmoid and elementwise multiplication, and conservatively requires the split dimension to be statically known and even while allowing other dimensions to remain dynamic.This avoids a PyTorch fallback and extra TensorRT engine partitions for models that use GLU, including the Conformer use case described in #2197. No additional dependencies are required.
Validation performed locally:
dim=0/1/-1, rank 2/3, and a dynamic batch range.torch.exportchecks on two RTX 3090 GPUs produced a single TensorRT module with no PyTorch fallback for FP32, FP16, and dynamic shapes; outputs matched eager PyTorch exactly in the tested cases.git diff --checkpassed for the changed files.The full repository test suite and GitHub CI have not been run. The dynamic GLU split dimension remains unsupported; invalid odd split dimensions retain PyTorch's existing error behavior.
Fixes #2663
Type of change
Checklist: