Add converter for aten::_grouped_mm.default
#2805
Open
+23
−0
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.
Implemented the converter for
aten::_grouped_mm.defaultto address #2795.Changes
aten_grouped_mmfunction inonnxscript/function_libs/torch_lib/ops/core.pyImplementation Details
The
aten::_grouped_mmoperator performs grouped matrix multiplication. This implementation handles the batch/dense mode (whenoffsisNone), where groups are implicit in the batch dimension:self: (G, M, K),mat2: (G, K, N)→ result:(G, M, N)op.MatMulfor the core computationbiasaddition viaop.Addout_dtypecasting viaop.CastThe offset-based mode (when
offsis provided) raisesNotImplementedError, as it requires segment-level matrix multiplications that are not directly expressible with standard ONNX operators.Testing
The function follows the same patterns as other converters in
core.py(e.g.,aten_bmm,aten_mm) and uses the@torch_opdecorator for automatic registration.Fixes #2795