nod-ai / iree-amd-aie

IREE plugin repository for the AMD AIE accelerator
Apache License 2.0
64 stars 29 forks source link

Add initial link executable pass #388

Closed nirvedhmeshram closed 4 months ago

nirvedhmeshram commented 4 months ago

This links the aie.device code from different modules into the same module

e.g

hal.executable dispatch_0 {
  builtin.module {
    aie.device {
      func.func dispatch_0
    }
  }
}

hal.executable dispatch_1 {
  builtin.module {
    aie.device {
      func.func dispatch_1
    }
  }
}

Is changed to

hal.executable linked_dispatches {
  builtin.module {
    aie.device {
      func.func dispatch_0
    }
    aie.device {
      func.func dispatch_1
    }
  }
}

Progress towards: https://github.com/nod-ai/iree-amd-aie/issues/380

nirvedhmeshram commented 4 months ago

Hi @nirvedhmeshram - if the difference between this and the upstream utility is based on the std::string names, would it be better to create a common utility/pass for both wherein you just specify those names via a pass flag?

Good point, but I think we want our own pass here to do more custom things in the future (e.g xclbin specific requirements). The core logic of merging executables is already used from upstream.