Skip to content

DAG DSL: multi-input concatenate mis-infers the concatenated axis (0.27.0) #667

Description

@michalharakal

DAG DSL → StableHLO: multi-input concatenate mis-infers the concatenated axis (0.27.0)

Surfaced by the conformance harness. A 3-input concat along dim=1 infers the output
shape with the channel extent of the first operand instead of the sum of all operands.
The 2-input concat in the op micro-suite produces the correct shape, so this is
arity/axis-specific — distinct from #663 (self-containment) and #666 (reshape/norms).

Repro (verified, 0.27.0)

A YOLO-style detection head concatenating three branches (1,1,8,8) + (1,4,8,8) + (1,1,8,8)
along the channel axis emits:

%out = stablehlo.concatenate %a, %b, %c, dim = 1
     : (tensor<1x1x8x8xf32>, tensor<1x4x8x8xf32>, tensor<1x1x8x8xf32>)
    -> tensor<1x1x8x8xf32>     // EXPECTED: tensor<1x6x8x8xf32>

The result type keeps 1 on the concatenated axis (operand 0's extent) instead of
1+4+1 = 6. iree-compile then rejects the module (operand/result shapes inconsistent).

Expected

concatenate over dim = d should set the result extent on d to the sum of the operands'
extents on d (here 6), for any number of operands.

cc #663

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions