Skip to content

Fix enablement of mmt4d ukernel test cases based on ISA code paths built - #16637

Merged
bjacob merged 3 commits into
iree-org:mainfrom
bjacob:fixup-windows
Mar 2, 2024
Merged

bjacob merged 3 commits into
iree-org:mainfrom
bjacob:fixup-windows

Conversation

@bjacob

@bjacob bjacob commented Mar 2, 2024 •

Copy link
Copy Markdown
Collaborator

This fixes build_test_all_windows CI and adds CI configuration to trigger it on all ukernel code changes going forward.

There is an unresolved mystery as to what exactly went wrong on build_test_all_windows CI job, as its MSVC compiler failed the check_cxx_compile_flags for /arch:AVX2 while the exact same MSVC version succeeded in the build_test_runtime_windows CI job.

But regardless, there was something not well thought out in how I did the testcase enablement. I had added a global constant bool indicating whether we had linked architecture-specific code, but that was only per-architecture, not accounting for the fact that, depending on check_cxx_compile_flags, some sub-architecture code paths could be individually disabled.

This new PR redoes that: the global constant bools are dropped, and instead, the problem is tackled differently in mmt4d_test vs mmt4d_benchmark:

  • In mmt4d_test, as we really want to avoid testcases silently testing nothing, we keep running without fallback, but we now condition testcases on IREE_UK_BUILD_* cmake-defined variables.
  • In mmt4d_benchmark, we just enable the fallback, so in the worst case if a code path is disabled, the outcome is a poor benchmark result. mmt4d_benchmark doesn't need to catch enablement, that's already done by mmt4d_test.

@bjacob
bjacob force-pushed the fixup-windows branch 3 times, most recently from 8147838 to c8a5f13 Compare March 2, 2024 03:23
@bjacob bjacob changed the title fixup-windows Fix enablement of mmt4d ukernel test cases based on ISA code paths built Mar 2, 2024
@bjacob
bjacob marked this pull request as ready for review March 2, 2024 03:42
Comment thread .github/workflows/ci.yml Outdated
build_test_all_windows:
needs: setup
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_all')
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_all_windows')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding ci-extra: build_test_all_windows to the end of the PR description will also let you opt-in, without needing to edit ci.yml. See https://iree.dev/developers/general/contributing/#ci-behavior-manipulation (and the screenshots there)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah thanks. i keep forgetting that trick and documentation.

@bjacob
bjacob enabled auto-merge (squash) March 2, 2024 04:02
@bjacob
bjacob merged commit f66d7f2 into iree-org:main Mar 2, 2024
bjacob added a commit that referenced this pull request Mar 4, 2024
…test` (#16654)

I had put them behind `#if`'s in #16637 but the tokens being tested in
these `#if`s were only defined in internal headers inside each `arch/`
subdir, so here they are never defined.

Sorry. This PR reverts to just enabling the fallback in `mmt4d_test`,
which removes the whole need to finely enable each case.
bjacob added a commit that referenced this pull request Mar 27, 2024
This -650 lines shrink comes from introducing tables (the .inl files)
where we declare the mmt4d tile functions. From that, we can generate
not only the declarations but also the whole `select_tile_func` logic.

While this PR stands on its own, there is a subtext here that in a
subsequent PR (#16880) I'm going to argue --- against all common sense!
--- for actually exporting these tables, as an interim solution to the
problem discussed in #16848 until the better solutions outlined there
can land. Don't want this to be a distraction on this PR as the tables
are not being exported here, and they are justified by independent
reasons here.

That is entirely within the `arch/` subdir. The only other part of this
PR outside of `arch` is a renaming: `mmt4d_tile.c` only contains the
generic (fallback) tile functions, so made its name reflect that.

I tried hard to also drop the whole CMake configure-checks and
configured-headers and for `IREE_UK_BUILD...`, tried moving that back
into the C files as checks of compiler versions, but ran again into the
mystery about the CI jobs `build_test_all_windows` and
`build_test_runtime_windows` having a very different MSVC behavior there
despite being the exact same version, as noted earlier in
#16637.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants