NVIDIA / TensorRT-Incubator

Experimental projects related to TensorRT
81 stars 12 forks source link

stablehlo.reduce_window dynamic shape issue #359

Closed yizhuoz004 closed 1 week ago

yizhuoz004 commented 1 week ago

trunk.txt

Got error:

(t8589)error: expected cluster to yield the result of a 'plan.with_shape' operation but got %71502 = "stablehlo.reduce_window"(%71501, %101) <{padding = dense<0> : tensor<4x2xi64>, window_dimensions = array<i64: 1, 1, 2, 2>, window_strides = array<i64: 1, 1, 2, 2>}> ({
    ^bb0(%arg559: tensor<f32>, %arg560: tensor<f32>):
      %71503 = "stablehlo.maximum"(%arg559, %arg560) : (tensor<f32>, tensor<f32>) -> tensor<f32>
      "stablehlo.return"(%71503) : (tensor<f32>) -> ()
    }) : (tensor<?x288x256x256xf32>, tensor<f32>) -> tensor<?x?x?x?xf32>
    (t8589)error: failed to materialize destination operand of type 'tensor<?x?x?x?xf32>'

A minimum repro:

module @ins_x_outs_t3_1 {
  func.func @main(%arg0: tensor<?x?x?x?xf32> {tensorrt.shape_profile = #tensorrt.shape_profile<min = [1, 3, 1024, 1024], opt = [2, 3, 1024, 1024], max = [8, 3, 1024, 1024]>}) -> tensor<?x?x?x?xf32> {
    %cst = stablehlo.constant dense<0.000000e+00> : tensor<f32>
    %0 = "stablehlo.reduce_window"(%arg0, %cst) <{padding = dense<0> : tensor<4x2xi64>, window_dimensions = array<i64: 1, 1, 2, 2>, window_strides = array<i64: 1, 1, 2, 2>}> ({
    ^bb0(%arg1: tensor<f32>, %arg2: tensor<f32>):
      %1 = stablehlo.maximum %arg1, %arg2 : tensor<f32>
      stablehlo.return %1 : tensor<f32>
    }) : (tensor<?x?x?x?xf32>, tensor<f32>) -> tensor<?x?x?x?xf32>
    return %0 : tensor<?x?x?x?xf32>
  }
}
yizhuoz004 commented 1 week ago

Addressed by #370