Skip to content

Implement executable linking in VMLA. - #3283

Merged
ScottTodd merged 14 commits into
iree-org:mainfrom
ScottTodd:linking
Oct 13, 2020
Merged

ScottTodd merged 14 commits into
iree-org:mainfrom
ScottTodd:linking

Conversation

@ScottTodd

@ScottTodd ScottTodd commented Sep 28, 2020 •

Copy link
Copy Markdown
Member

Progress on #1587

This extracts the contents of hal.executable ops matching the VMLA backend into a new @linked_vmla executable containing a single @linked_module vm.module.

@ScottTodd ScottTodd added the compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) label Sep 28, 2020
@ScottTodd
ScottTodd requested a review from benvanik September 28, 2020 23:56
@google-cla google-cla Bot added the cla: yes label Sep 28, 2020
```mlir
  hal.variable @_executable_cache init(@_executable_cache_initializer) : !hal.executable_cache
  func @_executable_cache_initializer() -> !hal.executable_cache attributes {sym_visibility = "private"} {
    %dev = hal.ex.shared_device : !hal.device
    %executable_cache_default = hal.executable_cache.create %dev, identifier = "default" : !hal.executable_cache
    hal.device.switch(%dev : !hal.device)
    #hal.device.match.id<"llvm-ir*">(%arg0 = %executable_cache_default : !hal.executable_cache) {
      %0 = hal.variable.load @_executable_layout_0 : !hal.executable_layout
      %executable_main_ex_dispatch_0 = hal.executable_cache.prepare %arg0, layout = %0, caching_mode = "AliasProvidedData|AllowPersistentCaching|AllowOptimization", @main_ex_dispatch_0 : !hal.executable
      hal.variable.store %executable_main_ex_dispatch_0, @_executable_main_ex_dispatch_0 : !hal.executable
      hal.return
      %1 = hal.variable.load @_executable_layout_0 : !hal.executable_layout
      %executable_main_ex_dispatch_1 = hal.executable_cache.prepare %arg0, layout = %1, caching_mode = "AliasProvidedData|AllowPersistentCaching|AllowOptimization", @main_ex_dispatch_1 : !hal.executable
      hal.variable.store %executable_main_ex_dispatch_1, @_executable_main_ex_dispatch_1 : !hal.executable
      hal.return
      %2 = hal.variable.load @_executable_layout_0 : !hal.executable_layout
      %executable_main_ex_dispatch_2 = hal.executable_cache.prepare %arg0, layout = %2, caching_mode = "AliasProvidedData|AllowPersistentCaching|AllowOptimization", @main_ex_dispatch_2 : !hal.executable
      hal.variable.store %executable_main_ex_dispatch_2, @_executable_main_ex_dispatch_2 : !hal.executable
      hal.return
    },
    #hal.device.match.id<"vmla">(%arg0 = %executable_cache_default : !hal.executable_cache) {
      %0 = hal.variable.load @_executable_layout_0 : !hal.executable_layout
      %executable_linked_vmla = hal.executable_cache.prepare %arg0, layout = %0, caching_mode = "AliasProvidedData|AllowPersistentCaching|AllowOptimization", @linked_vmla : !hal.executable
      hal.variable.store %executable_linked_vmla, @_executable_linked_vmla : !hal.executable
      hal.return
    }
    return %executable_cache_default : !hal.executable_cache
  }
```
@ScottTodd
ScottTodd marked this pull request as ready for review October 9, 2020 17:37
@ScottTodd ScottTodd changed the title First pass at executable linking in VMLA. Implement executable linking in VMLA. Oct 9, 2020
@ScottTodd
ScottTodd merged commit 0a225f9 into iree-org:main Oct 13, 2020
@ScottTodd
ScottTodd deleted the linking branch October 13, 2020 17:46
@ScottTodd ScottTodd mentioned this pull request Oct 13, 2020
ScottTodd added a commit that referenced this pull request Oct 22, 2020
Fixes #3137, follows #3283.

This also refactors the LLVM targets to share more code, since they have the same behavior until serialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants