Repository navigation
end-to-end matmul tests - #7347
Conversation
6ff1d66 to
da250ab
Compare
GMNGeoffrey
left a comment
There was a problem hiding this comment.
I think there's cleanup to do with now-superfluous args and such, but overall I like this a lot better. You probably want to move trace runner out into its own cmake file though.
GMNGeoffrey
left a comment
There was a problem hiding this comment.
Oh no, we need yaml for the tests, so need to update docker images. Let me do that. You've done enough.
| # ARGS: arguments passed to the test binary. | ||
| # DRIVER: If specified, will pass --driver=DRIVER to the test binary and adds | ||
| # a driver label to the test. | ||
| # TEST_INPUT_FILE_ARG: If specified, the input file will be added to TEST_DATA and |
There was a problem hiding this comment.
Hmmm this is going to be a bit of a problem with translation from Bazel where
|
You'll also need to fix the Bazel build: Overall approach LGTM |
Hopefully #7406 will give you what you need. It became rather more of an adventure than I expected, which honestly should be expected because Docker is always broken in some new and interesting way |
Yes, it does fix it! Thanks! |
At this point all of our builds use Python. With #7347 the last holdouts are growing a dep on yaml to be able to run traces. So I squashed `cmake-python` into `cmake` and shortened all the dependents by dropping `python` from their name. Some other cleanups, some of which were unfortunately necessary to be able to rebuild our images. Hooray unreproducible builds! 1. The rbe-toolchain image was never actually updated to bump the swiftshader commit in #7117 and #6859, and the newer commits don't actually build there so I had to restore the commit in the Dockerfile to the one that has actually always been the one the image is using. See #7419. 2. The place we were fetching the Vulkan SDK from is no longer available, so I had to rebundle it and stash it in our GCS. Upgrading Vulkan is a huge undertaking that I'm not going to undertake right now. 3. Deleted the `cmake-bazel-frontends-android` image, which is unused.
|
(dropping myself from reviewer list. Thanks @bjacob for pushing this) |
|
|
||
| def iree_generated_trace_runner_test(**kwargs): | ||
| # TODO: implement this. For now, it's only parsed by bazel_to_cmake.py, so | ||
| # the iree_generated_check_test's are just omitted in bazel builds. | ||
| pass |
There was a problem hiding this comment.
This is in the other file now
| def iree_generated_trace_runner_test(**kwargs): | |
| # TODO: implement this. For now, it's only parsed by bazel_to_cmake.py, so | |
| # the iree_generated_check_test's are just omitted in bazel builds. | |
| pass |
|
Please make sure you squash this when merging. We really don't want all these commits coming into main :-) |
asaadaldien
left a comment
There was a problem hiding this comment.
LGTM! passing it to @benvanik
3432ad9 to
b1f3bd9
Compare
end-to-end matmul tests, meaning: we generate input matrices, perform linalg.matmul's, check that the results are correct.
In an earlier attempt (PR #7154) the test was entirely generated code. That approach was abandoned because it potentially amounted to comparing the compiler's output with itself.
The new approach here is to have a custom C test runner that has its own C reference implementation of matmul and uses it to compare the output of the generated code, which it drives by means of replay-trace. So now each test is not just a
.mlirsource, but a (.mlir,.yaml) pair where the yaml file is a trace, determining the runtime values of the inputs of the code being tested. Both.mlirand.yamlfiles are co-generated by a Python script.A new CMake function
iree_trace_runner_testis added. It is a variant ofiree_check_test, taking a custom trace runner and trace file, instead ofiree_check_test's behavior of just running the module iniree-check-module.A new CMake function
iree_generated_trace_runner_testis added to call the Python script to co-generate the.yamland the.mlirsource and calliree_trace_runner_teston the resulting files.One aspect of PR #7154 is retained here: all the above-mentioned CMake functions are generalized also to allow running
iree-opt(or an alternate tool) as a pre-processing step on the source.mlirfile, before runningiree-translate. That is because by default, new MLIR transformations are not necessarily known toiree-translate. In our case, that's themmt4d-related transformations.The tests added in this PR share the prefix
e2e_matmul(that can be used withctest -R).Notes:
i8andf32tests, on equal footing.dylib-llvm-aotandvmvx. I haven't tried Vulkan.linalg.matmul, and lowering vialinalg.mmt4d, are tested in separate tests (look fordirectvsmmt4din the test names). The majority of the tests aremmt4d.