Repository navigation
Closed
Description
Manifested in one build run on Windows only - may be an indicator of non-determinism.
2021-01-07T00:04:00.7571560Z [3108/3308] Generating check_llvm-ir_llvm_matmul.mlir_module.module
2021-01-07T00:04:00.7572709Z FAILED: iree/test/e2e/linalg_tensor_ops/check_llvm-ir_llvm_matmul.mlir_module.module
2021-01-07T00:04:00.7576590Z cmd.exe /C "cd /D D:\a\iree\iree\iree-build\iree\test\e2e\linalg_tensor_ops && D:\a\iree\iree\iree-build\iree\tools\iree-translate.exe -iree-mlir-to-vm-bytecode-module --iree-hal-target-backends=dylib-llvm-aot -iree-flow-dispatch-linalg-on-tensors -iree-flow-dispatch-linalg-on-tensors-tile-sizes=1,1 -iree-codegen-llvm-experimental-linalg-on-tensors D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir -o check_llvm-ir_llvm_matmul.mlir_module.module"
2021-01-07T00:04:00.7581181Z D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir:8:8: remark: unable to materialize shape calculation (unsupported op 'flow.dispatch.input.load'?): falling back to runtime resolution
2021-01-07T00:04:00.7582575Z %D = linalg.matmul ins(%A, %B: tensor<2x3xf32>, tensor<3x4xf32>)
2021-01-07T00:04:00.7583142Z ^
2021-01-07T00:04:00.7584389Z D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir:8:8: note: see current operation: %2 = flow.dispatch.input.load %arg0, offsets = [%arg4, %c0], sizes = [%1, %c3], strides = [%c1, %c1] : !flow.dispatch.input<2x3xf32> -> tensor<?x3xf32>
2021-01-07T00:04:00.7586492Z D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir:8:8: remark: unable to materialize shape calculation (unsupported op 'flow.dispatch.input.load'?): falling back to runtime resolution
2021-01-07T00:04:00.7587868Z %D = linalg.matmul ins(%A, %B: tensor<2x3xf32>, tensor<3x4xf32>)
2021-01-07T00:04:00.7588433Z ^
2021-01-07T00:04:00.7589721Z D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir:8:8: note: see current operation: %8 = flow.dispatch.input.load %arg1, offsets = [%c0, %arg5], sizes = [%c3, %7], strides = [%c1, %c1] : !flow.dispatch.input<3x4xf32> -> tensor<3x?xf32>
2021-01-07T00:04:00.7591789Z D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir:8:8: remark: unable to materialize shape calculation (unsupported op 'flow.dispatch.input.load'?): falling back to runtime resolution
2021-01-07T00:04:00.7593696Z %D = linalg.matmul ins(%A, %B: tensor<2x3xf32>, tensor<3x4xf32>)
2021-01-07T00:04:00.7594273Z ^
2021-01-07T00:04:00.7595533Z D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir:8:8: note: see current operation: %13 = flow.dispatch.input.load %arg2, offsets = [%arg4, %arg5], sizes = [%1, %7], strides = [%c1, %c1] : !flow.dispatch.input<2x4xf32> -> tensor<?x?xf32>
2021-01-07T00:04:00.7597580Z D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir:8:8: remark: unable to materialize shape calculation (unsupported op 'linalg.matmul'?): falling back to runtime resolution
2021-01-07T00:04:00.7598817Z %D = linalg.matmul ins(%A, %B: tensor<2x3xf32>, tensor<3x4xf32>)
2021-01-07T00:04:00.7599372Z ^
2021-01-07T00:04:00.7600553Z D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir:8:8: note: see current operation: %19 = linalg.matmul {__internal_linalg_transform__ = "workgroup"} ins(%6, %12 : tensor<?x3xf32>, tensor<3x?xf32>) outs(%18 : tensor<?x?xf32>) -> tensor<?x?xf32>
2021-01-07T00:04:00.7602064Z PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
2021-01-07T00:04:00.7602867Z Stack dump:
2021-01-07T00:04:00.7606318Z 0. Program arguments: D:\\a\\iree\\iree\\iree-build\\iree\\tools\\iree-translate.exe -iree-mlir-to-vm-bytecode-module --iree-hal-target-backends=dylib-llvm-aot -iree-flow-dispatch-linalg-on-tensors -iree-flow-dispatch-linalg-on-tensors-tile-sizes=1,1 -iree-codegen-llvm-experimental-linalg-on-tensors D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir -o check_llvm-ir_llvm_matmul.mlir_module.module
2021-01-07T00:04:00.7609873Z 1. 2. In-Flight Diagnostics:
2021-01-07T00:04:00.7611020Z loc("D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir":8:8): error: expected dispatch function to have a single call operation
2021-01-07T00:04:00.7612411Z loc("D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir":8:8): error: expected dispatch function to have a single call operation
2021-01-07T00:04:00.7614153Z loc("D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir":8:8): remark: unable to materialize shape calculation (unsupported op 'flow.dispatch.input.load'?): falling back to runtime resolution
2021-01-07T00:04:00.7616289Z loc("D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir":8:8): remark: unable to materialize shape calculation (unsupported op 'flow.dispatch.input.load'?): falling back to runtime resolution
2021-01-07T00:04:00.7618322Z loc("D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir":8:8): remark: unable to materialize shape calculation (unsupported op 'flow.dispatch.input.load'?): falling back to runtime resolution
2021-01-07T00:04:00.7620279Z loc("D:/a/iree/iree/main_checkout/iree/test/e2e/linalg_tensor_ops/matmul.mlir":8:8): remark: unable to materialize shape calculation (unsupported op 'linalg.matmul'?): falling back to runtime resolution
Metadata
Metadata
Assignees
Labels
No labels
Activity
MaheshRavishankar commentedon Jan 7, 2021
I think this is due to the recent PR for linalg on tensors. Will take a look (have to spin up my windows build again) in a bit.
stellaraccident commentedon Jan 7, 2021
benvanik commentedon Jan 7, 2021
First place I look with things like this is use of unordered maps - the msft STL differs from libc++ and often exposes issues related to them.
MaheshRavishankar commentedon Jan 7, 2021
There is probably a DenseMap iteration somewhere.
ScottTodd commentedon Jan 8, 2021
FWIW, I'm also seeing this on my Windows machine.
MaheshRavishankar commentedon Jan 8, 2021
Sorry, i didnt get a chance to look at this. Ill try to repro it on my windows machine
nicolasvasilache commentedon Jan 8, 2021
I've seen this
expected dispatch function to have a single call operationmessage in the the WorkGroupFn thing, I'll send a simple tentative fix. Could someone give it a quick shot on Windows?I don't have a repro myself, which I find quite weird ..
Fix iree-org#4409
Fix iree-org#4409
stellaraccident commentedon Jan 8, 2021
FYI - I just got this one time on a Linux/GCC build and then it worked the next. So definitely a non-determinism.
4 remaining items
MaheshRavishankar commentedon Jan 20, 2021
Building in debug mode I see the following assertion hit :
@nicolasvasilache this is new code, and I dont have full context on the ABI. Can you take a look?
nicolasvasilache commentedon Jan 21, 2021
Unable to repro locally with 1e5 runs..
@MaheshRavishankar this is fishy: as if there was a race condition in conversion pattern application.
Can you run with
-debug-only=dialect-conversion -print-ir-after-alland paste what you see on failure ?Once the enclosing llvmFunc exists (i.e. the MLIR func has been converted), it must have arguments otherwise there is nowhere to get the pointers to the buffers.
MaheshRavishankar commentedon Jan 21, 2021
Here is the output of dump https://gist.github.com/MaheshRavishankar/bfc1ce7d42c58843516896683e1ab26f
MaheshRavishankar commentedon Jan 21, 2021
FYI, on my windows machine (with Debug build) this is not intermittent. The assert triggers always. I am using MSVC 2019.
MaheshRavishankar commentedon Jan 21, 2021
Its a problem of competing patterns. The ConvertToLLVM2 pass adds a pattern from
func->llvm.funcand so doespopulateStdToLLVMPatterns. THe latter is triggered and causes the issue.benvanik commentedon Jan 21, 2021
Ahh good catch - that would explain the differences between compilers. I did notice there's an
LLVM_REVERSE_ITERATION:BOOLflag that causes all unordered containers to be iterated in reverse order and that may be useful to have on a CI to catch issues like this vs. how we are doing it now by just compiling with different compilers that iterate differently :PBump benefit of pattern to convert from func -> llvm.func in ConvertT…
Bump benefit of pattern to convert from func -> llvm.func in ConvertT…
ScottTodd commentedon Jan 22, 2021
This could be tracked separately, but I'm still seeing warnings (not errors/failures) that spam the build log each time I build
all:these are also visible on Linux and in our presubmit logs: https://source.cloud.google.com/results/invocations/03718313-dccb-4f52-b604-4a1cf455248e/targets/iree%2Fgcp_ubuntu%2Fcmake%2Flinux%2Fx86-swiftshader%2Fpresubmit/log
MaheshRavishankar commentedon Jan 22, 2021
Yeah thats a separate issue. It has to do with the shape dialect. It might be a few days before I get around to this. It could be as simple as just removing the remark, but it would probably be better if someone with more knowhow about shape dialect (@silvasean ?) take a look.
silvasean commentedon Jan 26, 2021
This is basically what gets printed if we don't have a shape transfer function registered when we materialize shape calculations. My suggestion is to not use the tie shape pass / materialize shape calculations within flow.dispatch.workgroups, and instead just insert raw dim ops and let them canonicalize to a fixed point.
nicolasvasilache commentedon Jan 27, 2021
silvasean commentedon Jan 27, 2021
Sure. I'm deep in an npcomp change. Will try to get to this in the next week.
silvasean commentedon Jan 29, 2021
This PR should remove most of the tie_shape nonsense: #4664
(there is still flow.dispatch.tie_shape and the shapex.tie_shape on the flow.dispatch.workgroups op itself, but those are much more constrained in how they affect the code)