Repository navigation
Closed
Labels
codegenShared code generation infrastructure and dialectscompiler/dialectsRelating to the IREE compiler dialects (flow, hal, vm)
Description
There are some lit tests failed when turning Linalg on tensors by default:
There are different kind of errors, e.g., in iree/compiler/Dialect/Vulkan/Utils/test:target_env_conversion.mlir.test
failed to legalize operation 'hal.interface.load.tensor'
And in convert_to_gpu.mlir.test, some of entry_point function are changed:
Before:
hal.executable.target @vulkan, filter="vulkan*" {
hal.executable.entry_point @parallel_4D_static attributes {interface = @legacy_io, ordinal = 0 : i32, signature = (!flow.dispatch.tensor<readonly:?x?xf32>, !flow.dispatch.tensor<readonly:?x?xf32>, !flow.dispatch.tensor<writeonly:?x?xf32>) -> ()} {
^bb0(%arg0: index, %arg1: index, %arg2: index): // no predecessors
%c1 = constant 1 : index
%c12 = constant 12 : index
hal.return %c12, %c1, %c1 : index, index, index
}
After:
hal.executable.entry_point @parallel_4D_static attributes {interface = @legacy_io, ordinal = 0 : i32, signature = (!flow.dispatch.tensor<readonly:?x?xf32>, !flow.dispatch.tensor<readonly:?x?xf32>, !flow.dispatch.tensor<writeonly:?x?xf32>) -> ()} {
^bb0(%arg0: index, %arg1: index, %arg2: index): // no predecessors
%c1 = constant 1 : index
%0 = affine.apply #map()[%arg0, %arg1, %arg2]
hal.return %0, %c1, %c1 : index, index, index
}
Here is the list:
iree/compiler/Conversion/LinalgToSPIRV/test:convert_to_gpu.mlir
iree/compiler/Conversion/LinalgToSPIRV/test:linalg_tile_and_fuse.mlir
iree/compiler/Conversion/LinalgToSPIRV/test:pipeline_test.mlir
iree/compiler/Conversion/LinalgToSPIRV/test:pipeline_test_cooperative_mat.mlir
iree/compiler/Conversion/LinalgToSPIRV/test:workgroup_memory_promotion.mlir
iree/compiler/Dialect/HAL/Target/LLVM/test:binary_op.mlir
iree/compiler/Dialect/HAL/Target/LLVM/test:matmul_op.mlir
iree/compiler/Dialect/HAL/Target/VulkanSPIRV/test:smoketest.mlir
iree/compiler/Dialect/Vulkan/Utils/test:target_env_conversion.mlir
note: some lit tests will be out-dated, like all the tests under iree/test/e2e/structural/.
To Reproduce
Run the test with -iree-flow-dispatch-linalg-on-tensors -iree-codegen-spirv-experimental-linalg-on-tensors -iree-codegen-llvm-experimental-linalg-on-tensors
Metadata
Metadata
Assignees
Labels
codegenShared code generation infrastructure and dialectscompiler/dialectsRelating to the IREE compiler dialects (flow, hal, vm)
Activity
hanhanW commentedon Apr 1, 2021
The below lit tests failed if I turned Linalg on tensors on by default. I haven't looked into reasons yet. IMO, we would want to add some tests for Linalg on tensors based on below. We don't have to rewrite all the tests, this is more like clean-up and adding proper tests to me. Some tests were derived from end-to-end, and the pipeline changed. In this case, they could be outdated.
LinalgToSPIRV
HAL
Vulkan Utils
hanhanW commentedon Apr 5, 2021
@asaadaldien @MaheshRavishankar @ThomasRaoux @antiagainst could you help on some of these? I'm not familiar with all the passes/components, and could miss some cases. I think I can work on HAL and Vulkan Util tests, there won't be too many mysteries to me.
Add a target_env_conversion test for Linalg on tensors. (#5309)
antiagainst commentedon Apr 6, 2021
Thanks Hanhan! I'll take a look of the SPIR-V ones later this week.
Add smoketest_linalg_on_tensors to LLVM and Vulkan-SPIRV targets.
hanhanW commentedon Apr 6, 2021
Thanks @antiagainst , I added smoketests to HAL Targets for Linalg on tensors path in #5324 .
Add smoketest_linalg_on_tensors to LLVM and Vulkan-SPIRV targets. (#5324
Set IREE codegen to Linalg on tensors by default.
Set IREE codegen to Linalg on tensors by default.
Set IREE codegen to Linalg on tensors by default. (#5375)
[spirv] Migrate matmul pipeline test to linalg on tensors (#5381)
2 remaining items
hanhanW commentedon Apr 26, 2021
The rest of tests are:
After that we can fully delete
-iree-codegen-spirv-experimental-linalg-on-tensorsand the CodeGen option.hanhanW commentedon Apr 26, 2021
I had a version for pipeline_test_cooperative_mat.mlir (which tests
CooperativeMatrix+f16) but hit issues like:https://gist.githubusercontent.com/hanhanW/0c56446ba41b3184add1bc671bf60bfa/raw
@ThomasRaoux did I do something wrong? Is it a bug? If so, could you help on fixing it?
antiagainst commentedon Apr 26, 2021
Cooperative matrix functionalities needs more care to be ported. I've a patch ready. Sending out soon.
antiagainst commentedon Apr 26, 2021
#5607 for cooperative matrix stuff.
antiagainst commentedon Apr 26, 2021
#5609 and #5610 should migrate the rest SPIR-V tests in preparation for removing the old path.