Skip to content

Conversation

@Old-cpu
Copy link
Contributor

@Old-cpu Old-cpu commented Nov 19, 2025

Operator fusion of residual networks has been added to the front end.

Before fusion:

    %cst_26 = arith.constant dense<0.000000e+00> : tensor<1x1536xf32>
    %129 = linalg.matmul {cast = #linalg.type_fn<cast_signed>} ins(%128, %arg14 : tensor<1x1536xf32>, tensor<1536x1536xf32>) outs(%cst_26 : tensor<1x1536xf32>) -> tensor<1x1536xf32>
    %130 = tosa.reshape %129 {new_shape = array<i64: 1, 1, 1536>} : (tensor<1x1536xf32>) -> tensor<1x1x1536xf32>
    %131 = tosa.add %2, %130 : (tensor<1x1x1536xf32>, tensor<1x1x1536xf32>) -> tensor<1x1x1536xf32>

After fusion

    %129 = tosa.reshape %2 {new_shape = array<i64: 1, 1536>} : (tensor<1x1x1536xf32>) -> tensor<1x1536xf32>
    %130 = linalg.matmul {cast = #linalg.type_fn<cast_signed>} ins(%128, %arg14 : tensor<1x1536xf32>, tensor<1536x1536xf32>) outs(%129 : tensor<1x1536xf32>) -> tensor<1x1536xf32>
    %131 = tosa.reshape %130 {new_shape = array<i64: 1, 1, 1536>} : (tensor<1x1536xf32>) -> tensor<1x1x1536xf32>

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant