Skip to content

Linalg-on-tensors fusion not handling rank-0 tensors #5115

Closed

Description

@benvanik

from discord:
"Its a corner case that isnt covered by current fusion in linalg. It is looking for affine maps being projected permutations. I guess empty map is not treated as one."

  %2 = linalg.init_tensor [] : tensor<i1>
  %3 = linalg.generic {indexing_maps = [affine_map<() -> ()>, affine_map<() -> ()>], iterator_types = []} ins(%1 : tensor<i32>) outs(%2 : tensor<i1>) {
  ^bb0(%arg0: i32, %arg1: i1):  // no predecessors
    %11 = cmpi sge, %c3_i32, %arg0 : i32
    linalg.yield %11 : i1
  } -> tensor<i1>
  %4 = linalg.init_tensor [] : tensor<i8>
  %5 = linalg.generic {indexing_maps = [affine_map<() -> ()>, affine_map<() -> ()>], iterator_types = []} ins(%3 : tensor<i1>) outs(%4 : tensor<i8>) {
  ^bb0(%arg0: i1, %arg1: i8):  // no predecessors
    %11 = zexti %arg0 : i1 to i8
    linalg.yield %11 : i8
  } -> tensor<i8>

Activity

  1. added
    codegen
    performance ⚡
    on Mar 15, 2021
  2. MaheshRavishankar commented on Mar 15, 2021

    @MaheshRavishankar
    Collaborator

    This seems to working with ToT as is. So closing for now.

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

Metadata

Metadata

Labels

codegenperformance ⚡

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions