Fix stablehlo.transpose and stablehlo.dot_general MLIR emission#520
Merged
michalharakal merged 1 commit intodevelopfrom Apr 18, 2026
Merged
Fix stablehlo.transpose and stablehlo.dot_general MLIR emission#520michalharakal merged 1 commit intodevelopfrom
michalharakal merged 1 commit intodevelopfrom
Conversation
iree-compile rejected MLIR emitted by LinalgOperationsConverter because the converter used syntax that does not match the StableHLO spec: - transpose emitted `: outputType` instead of `: (inputType) -> outputType`, which iree-compile flagged as "invalid kind of type specified". - dot_general emitted `contracting_dims = [[N], [M]]` (ArrayAttr-style) instead of `contracting_dims = [N] x [M]`, omitted batching_dims entirely for batched matmuls, and dropped the `(lhsType, rhsType) ->` input-type clause — all three are required by the StableHLO parser. LinalgOperationsConverter now threads input TensorSpecs through to the emission, derives batching_dims from lhs rank for bmm (supporting 2D, 3D, and 4D+ inputs instead of the previous 3D-only assumption), and writes the `(lhs, rhs) -> result` type tuple. Tests updated accordingly; full :skainet-compile-hlo:jvmTest passes. These are the first two of four items from a skainet-whisper IREE Vulkan bring-up on branch `feature/iree-vulkan-gpu` (SKaiNET 0.18.0). The remaining two are tracked separately. Related: #518, #519 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 18, 2026
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.
iree-compile rejected MLIR emitted by LinalgOperationsConverter because the converter used syntax that does not match the StableHLO spec:
: outputTypeinstead of: (inputType) -> outputType, which iree-compile flagged as "invalid kind of type specified".contracting_dims = [[N], [M]](ArrayAttr-style) instead ofcontracting_dims = [N] x [M], omitted batching_dims entirely for batched matmuls, and dropped the(lhsType, rhsType) ->input-type clause — all three are required by the StableHLO parser.LinalgOperationsConverter now threads input TensorSpecs through to the emission, derives batching_dims from lhs rank for bmm (supporting 2D, 3D, and 4D+ inputs instead of the previous 3D-only assumption), and writes the
(lhs, rhs) -> resulttype tuple. Tests updated accordingly; full :skainet-compile-hlo:jvmTest passes.These are the first two of four items from a skainet-whisper IREE Vulkan bring-up on branch
feature/iree-vulkan-gpu(SKaiNET 0.18.0). The remaining two are tracked separately.Related: #518, #519