Summary
When a model traced through the KSP-generated tracer wrapper reaches the StableHLO converter, conv1d (and conv3d) outputs are emitted as tensor<?xf32> instead of their correct static shape. This breaks iree-compile with type-mismatch errors on every downstream op that consumes the conv result.
Observed 12 occurrences in the Whisper encoder during the IREE / Vulkan GPU bring-up.
Example MLIR fragment produced today:
%v116 = stablehlo.add %v116_conv, %v1 : tensor<?xf32>
%v1 is a static tensor<384xf32> bias, so the add is rejected as a type mismatch.
Root cause
VoidTensorOps.conv1d already computes a static output shape — that path is correct. The shape is lost in DefaultExecutionTape.recordTrace (skainet-compile-dag), which builds TensorSpecs from trace.attributes["outputShapes"] / ["inputShapes"].
The KSP-generated tracer wrapper only populates those attributes for ops in a hard-coded allowlist (conv2d, unary/binary/scalar ops, shape ops). conv1d and conv3d fall through to AttributeStrategy.DefaultMapping, which records only stride/padding/dilation/groups. With the shape attributes absent, TensorSpec.shape becomes null and TypeMapper.formatShape(null) emits ?.
The TensorRef objects in the trace already carry the correct static Shape (captured from the runtime tensor via TraceSession.refOf), so there's a free, always-correct fallback available.
Fix
In DefaultExecutionTape.recordTrace, fall back to TensorRef.shape.dimensions.toList() (and TensorRef.dtype.name) when the attributes are missing.
Related / out of scope
RecordingTensorOpsDecorator.conv1d / .conv3d in skainet-compile-core override the parent but don't call record(...) at all (unlike conv2d). That's a separate latent gap — a tracked follow-up issue.
Context
- Whisper-on-GPU pipeline for MagentaTV One (Amlogic, Mali Valhall, Android 14)
- Branch:
feature/iree-vulkan-gpu in skainet-whisper
- Upstream issues log:
skainet-hlo-issues.md (Issue 5)
Reproduction
./gradlew :SKaiNET-voice:testDebugUnitTest --tests "*WhisperHloExportTest*"
iree-compile SKaiNET-voice/build/iree/encoder_skainet.mlir \
--iree-hal-target-backends=vulkan-spirv --iree-vulkan-target=valhall4 \
-o encoder_skainet_vulkan.vmfb
Summary
When a model traced through the KSP-generated tracer wrapper reaches the StableHLO converter,
conv1d(andconv3d) outputs are emitted astensor<?xf32>instead of their correct static shape. This breaksiree-compilewith type-mismatch errors on every downstream op that consumes the conv result.Observed 12 occurrences in the Whisper encoder during the IREE / Vulkan GPU bring-up.
Example MLIR fragment produced today:
%v1is a statictensor<384xf32>bias, so the add is rejected as a type mismatch.Root cause
VoidTensorOps.conv1dalready computes a static output shape — that path is correct. The shape is lost inDefaultExecutionTape.recordTrace(skainet-compile-dag), which buildsTensorSpecs fromtrace.attributes["outputShapes"]/["inputShapes"].The KSP-generated tracer wrapper only populates those attributes for ops in a hard-coded allowlist (
conv2d, unary/binary/scalar ops, shape ops).conv1dandconv3dfall through toAttributeStrategy.DefaultMapping, which records onlystride/padding/dilation/groups. With the shape attributes absent,TensorSpec.shapebecomesnullandTypeMapper.formatShape(null)emits?.The
TensorRefobjects in the trace already carry the correct staticShape(captured from the runtime tensor viaTraceSession.refOf), so there's a free, always-correct fallback available.Fix
In
DefaultExecutionTape.recordTrace, fall back toTensorRef.shape.dimensions.toList()(andTensorRef.dtype.name) when the attributes are missing.Related / out of scope
RecordingTensorOpsDecorator.conv1d/.conv3dinskainet-compile-coreoverride the parent but don't callrecord(...)at all (unlikeconv2d). That's a separate latent gap — a tracked follow-up issue.Context
feature/iree-vulkan-gpuin skainet-whisperskainet-hlo-issues.md(Issue 5)Reproduction
./gradlew :SKaiNET-voice:testDebugUnitTest --tests "*WhisperHloExportTest*" iree-compile SKaiNET-voice/build/iree/encoder_skainet.mlir \ --iree-hal-target-backends=vulkan-spirv --iree-vulkan-target=valhall4 \ -o encoder_skainet_vulkan.vmfb