Changing stream conversion to use a value/op affinity analysis. This reworks some of the prior stack to support transfer ops and analysis to determine the placement of ops for execution and resource control.
diff --git a/tools/test/compile_pipelines.mlir b/tools/test/compile_pipelines.mlir index 2fd4a6c..fb6dbbe 100644 --- a/tools/test/compile_pipelines.mlir +++ b/tools/test/compile_pipelines.mlir
@@ -1,10 +1,10 @@ // RUN: iree-opt --iree-common-input-transformation-pipeline %s | \ // RUN: iree-opt --iree-abi-transformation-pipeline - | \ -// RUN: iree-opt --iree-common-input-transformation-pipeline - | \ +// RUN: iree-opt --pass-pipeline='builtin.module(iree-hal-device-assignment-pipeline{target-devices=local})' --iree-hal-local-target-device-backends=vmvx - | \ // RUN: iree-opt --iree-global-optimization-transformation-pipeline - | \ // RUN: iree-opt --iree-flow-transformation-pipeline - | \ // RUN: iree-opt --iree-stream-transformation-pipeline - | \ -// RUN: iree-opt --iree-hal-transformation-pipeline --iree-hal-target-backends=vmvx - | \ +// RUN: iree-opt --iree-hal-transformation-pipeline - | \ // RUN: iree-opt --iree-vm-transformation-pipeline - | \ // RUN: FileCheck %s
diff --git a/tools/test/compile_to_continuation.mlir b/tools/test/compile_to_continuation.mlir index 9c78153..5476462 100644 --- a/tools/test/compile_to_continuation.mlir +++ b/tools/test/compile_to_continuation.mlir
@@ -1,79 +1,89 @@ // RUN: iree-compile --compile-to=input %s | \ -// RUN: iree-compile --output-format=vm-asm --iree-hal-target-backends=vmvx - | \ +// RUN: iree-compile --output-format=vm-asm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx - | \ // RUN: FileCheck %s --check-prefix=INPUT-PHASE // INPUT-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> // RUN: iree-compile --compile-to=abi %s | \ -// RUN: iree-compile --output-format=vm-asm --iree-hal-target-backends=vmvx - | \ +// RUN: iree-compile --output-format=vm-asm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx - | \ // RUN: FileCheck %s --check-prefix=ABI-PHASE // ABI-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=flow %s | \ -// RUN: iree-compile --output-format=vm-asm --iree-hal-target-backends=vmvx - | \ +// RUN: iree-compile --compile-to=flow --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ +// RUN: iree-compile --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=FLOW-PHASE // FLOW-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=stream %s | \ -// RUN: iree-compile --output-format=vm-asm --iree-hal-target-backends=vmvx - | \ +// RUN: iree-compile --compile-to=flow %s | \ +// RUN: iree-compile --output-format=vm-asm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx - | \ +// RUN: FileCheck %s --check-prefix=FLOW-PHASE-NO-DEVICE +// FLOW-PHASE-NO-DEVICE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> + +// RUN: iree-compile --compile-to=stream --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ +// RUN: iree-compile --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=STREAM-PHASE // STREAM-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=executable-sources --iree-hal-target-backends=vmvx %s | \ +// RUN: iree-compile --compile-to=stream %s | \ +// RUN: iree-compile --output-format=vm-asm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx - | \ +// RUN: FileCheck %s --check-prefix=STREAM-PHASE-NO-DEVICE +// STREAM-PHASE-NO-DEVICE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> + +// RUN: iree-compile --compile-to=executable-sources --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ // RUN: iree-compile --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=EXECUTABLE-SOURCES-PHASE // EXECUTABLE-SOURCES-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=executable-targets --iree-hal-target-backends=vmvx %s | \ +// RUN: iree-compile --compile-to=executable-targets --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ // RUN: iree-compile --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=EXECUTABLE-TARGETS-PHASE // EXECUTABLE-TARGETS-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=hal --iree-hal-target-backends=vmvx %s | \ +// RUN: iree-compile --compile-to=hal --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ // RUN: iree-compile --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=HAL-PHASE // HAL-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=vm --iree-hal-target-backends=vmvx %s | \ +// RUN: iree-compile --compile-to=vm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ // RUN: iree-compile --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=VM-PHASE // VM-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> // RUN: iree-compile --compile-to=input %s | \ -// RUN: iree-compile --compile-from=input --output-format=vm-asm --iree-hal-target-backends=vmvx - | \ +// RUN: iree-compile --compile-from=input --output-format=vm-asm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx - | \ // RUN: FileCheck %s --check-prefix=FROM-ABI-PHASE // FROM-INPUT-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> // RUN: iree-compile --compile-to=abi %s | \ -// RUN: iree-compile --compile-from=abi --output-format=vm-asm --iree-hal-target-backends=vmvx - | \ +// RUN: iree-compile --compile-from=abi --output-format=vm-asm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx - | \ // RUN: FileCheck %s --check-prefix=FROM-ABI-PHASE // FROM-ABI-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=flow %s | \ -// RUN: iree-compile --compile-from=flow --output-format=vm-asm --iree-hal-target-backends=vmvx - | \ +// RUN: iree-compile --compile-to=flow --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ +// RUN: iree-compile --compile-from=flow --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=FROM-FLOW-PHASE // FROM-FLOW-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=stream %s | \ -// RUN: iree-compile --compile-from=stream --output-format=vm-asm --iree-hal-target-backends=vmvx - | \ +// RUN: iree-compile --compile-to=stream --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ +// RUN: iree-compile --compile-from=stream --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=FROM-STREAM-PHASE // FROM-STREAM-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=executable-sources --iree-hal-target-backends=vmvx %s | \ +// RUN: iree-compile --compile-to=executable-sources --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ // RUN: iree-compile --compile-from=executable-sources --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=FROM-EXECUTABLE-SOURCES-PHASE // FROM-EXECUTABLE-SOURCES-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=executable-targets --iree-hal-target-backends=vmvx %s | \ +// RUN: iree-compile --compile-to=executable-targets --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ // RUN: iree-compile --compile-from=executable-targets --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=FROM-EXECUTABLE-TARGETS-PHASE // FROM-EXECUTABLE-TARGETS-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=hal --iree-hal-target-backends=vmvx %s | \ +// RUN: iree-compile --compile-to=hal --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ // RUN: iree-compile --compile-from=hal --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=FROM-HAL-PHASE // FROM-HAL-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view> -// RUN: iree-compile --compile-to=vm --iree-hal-target-backends=vmvx %s | \ +// RUN: iree-compile --compile-to=vm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | \ // RUN: iree-compile --compile-from=vm --output-format=vm-asm - | \ // RUN: FileCheck %s --check-prefix=FROM-VM-PHASE // FROM-VM-PHASE: vm.func private @abs(%arg0: !vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer_view>
diff --git a/tools/test/compile_to_phase.mlir b/tools/test/compile_to_phase.mlir index 0390564..f1861a0 100644 --- a/tools/test/compile_to_phase.mlir +++ b/tools/test/compile_to_phase.mlir
@@ -7,36 +7,44 @@ // ABI-PHASE: %[[INPUT:.+]] = hal.tensor.import %[[ARG0]] "input0" : !hal.buffer_view -> tensor<f32> // ABI-PHASE: math.absf %[[INPUT]] : tensor<f32> -// RUN: iree-compile --compile-to=flow %s | FileCheck %s --check-prefix=FLOW-PHASE +// RUN: iree-compile --compile-to=flow %s --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx | FileCheck %s --check-prefix=FLOW-PHASE // FLOW-PHASE: flow.executable.export public @abs_dispatch_0 // FLOW-PHASE: flow.dispatch @abs_dispatch_0 -// RUN: iree-compile --compile-to=stream %s | FileCheck %s --check-prefix=STREAM-PHASE +// RUN: iree-compile --compile-to=flow %s | FileCheck %s --check-prefix=FLOW-PHASE-NO-DEVICE +// FLOW-PHASE-NO-DEVICE: flow.executable.export public @abs_dispatch_0 +// FLOW-PHASE-NO-DEVICE: flow.dispatch @abs_dispatch_0 + +// RUN: iree-compile --compile-to=stream --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | FileCheck %s --check-prefix=STREAM-PHASE // STREAM-PHASE: stream.executable.export public @abs_dispatch_0 // STREAM-PHASE: stream.cmd.dispatch @abs_dispatch_0 -// RUN: iree-compile --compile-to=executable-sources --iree-hal-target-backends=vmvx %s | FileCheck %s --check-prefix=EXECUTABLE-SOURCES-PHASE +// RUN: iree-compile --compile-to=stream %s | FileCheck %s --check-prefix=STREAM-PHASE-NO-DEVICE +// STREAM-PHASE-NO-DEVICE: stream.executable.export public @abs_dispatch_0 +// STREAM-PHASE-NO-DEVICE: stream.cmd.dispatch @abs_dispatch_0 + +// RUN: iree-compile --compile-to=executable-sources --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | FileCheck %s --check-prefix=EXECUTABLE-SOURCES-PHASE // EXECUTABLE-SOURCES-PHASE: hal.executable private @abs_dispatch_0 // EXECUTABLE-SOURCES-PHASE: hal.executable.variant // EXECUTABLE-SOURCES-PHASE: linalg.generic // EXECUTABLE-SOURCES-PHASE: math.absf -// RUN: iree-compile --compile-to=executable-targets --iree-hal-target-backends=vmvx %s | FileCheck %s --check-prefix=EXECUTABLE-TARGETS-PHASE +// RUN: iree-compile --compile-to=executable-targets --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | FileCheck %s --check-prefix=EXECUTABLE-TARGETS-PHASE // EXECUTABLE-TARGETS-PHASE: hal.executable private @abs_dispatch_0 // EXECUTABLE-TARGETS-PHASE: hal.executable.variant // EXECUTABLE-TARGETS-PHASE: vm.abs.f32 -// RUN: iree-compile --compile-to=hal --iree-hal-target-backends=vmvx %s | FileCheck %s --check-prefix=HAL-PHASE +// RUN: iree-compile --compile-to=hal --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | FileCheck %s --check-prefix=HAL-PHASE // HAL-PHASE: hal.executable private @abs_dispatch_0 // HAL-PHASE: hal.executable.binary // HAL-PHASE: hal.command_buffer.dispatch -// RUN: iree-compile --compile-to=vm --iree-hal-target-backends=vmvx %s | FileCheck %s --check-prefix=VM-PHASE +// RUN: iree-compile --compile-to=vm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | FileCheck %s --check-prefix=VM-PHASE // VM-PHASE: vm.rodata private @abs_dispatch_0 // VM-PHASE: vm.call @hal.command_buffer.dispatch -// RUN: iree-compile --output-format=vm-asm --compile-to=end --iree-hal-target-backends=vmvx %s | FileCheck %s --check-prefix=END-PHASE -// RUN: iree-compile --output-format=vm-asm --iree-hal-target-backends=vmvx %s | FileCheck %s --check-prefix=END-PHASE +// RUN: iree-compile --output-format=vm-asm --compile-to=end --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | FileCheck %s --check-prefix=END-PHASE +// RUN: iree-compile --output-format=vm-asm --iree-hal-target-device=local --iree-hal-local-target-device-backends=vmvx %s | FileCheck %s --check-prefix=END-PHASE // END-PHASE: vm.rodata private @abs_dispatch_0 // END-PHASE: vm.call @hal.command_buffer.dispatch