Repository navigation
[WebGPU] Add compilation tests for xla_ops/ and tosa_ops/ (again). - #11327
Conversation
| # compiler target backends are enabled. Just assume all are enabled and only | ||
| # rely on the runtime HAL driver check above for filtering. | ||
|
|
||
| # HACK: Always skip WebGPU when cross compiling until it has a HAL driver. |
There was a problem hiding this comment.
could we make this not run the tests if DRIVER is omitted? I see a note about it above but am unclear why we'd allow not passing DRIVER to still run.
There was a problem hiding this comment.
Soooo....
We already skip running tests if there is no DRIVER, and that's what WebAssembly is relying on today:
Lines 393 to 402 in 51d4dc6
This gets tricky with cross-compilation though. We don't currently have a way to know from the cross-compilation CMake environment which compiler targets were enabled in the host tools build. Since the WebGPU compiler target is not enabled by default, one of our Android builds was trying to build the WebGPU tests. Thinking about this a bit more, I can tweak this hack to skip all tests that omit DRIVER when cross compiling. The real fix is mentioned in the PR description though - stop trying to use iree_check_test for just testing compilation. It's much easier to edit iree_check_test than it is to add a new test type though :/
There was a problem hiding this comment.
@GMNGeoffrey will you forgive me for the hack in iree_check_test? 😅
(I'll wait a bit before merging to give some time if you'd like to review that part)
There was a problem hiding this comment.
Eeeew. I'm pretty sure we're just not doing cross compiling correctly... We should be able to query the iree compiler tool to see what backends it supports, shouldn't we? I guess that opens us up to silent failures when the tool isn't compiled as expected though. In CMake you can actually have tests depend on other tests. I've been thinking for a while that that's actually how we should do the compilation tests rather than having them as part of the build system. That would resolve the weird iree-test-deps target too. But that is for another time. I guess this isn't the worst.
There was a problem hiding this comment.
Can you at least add a TODO and file an issue (or attach it to an existing issue)? "Rewrite absolutely all of our tests". "good first issue"
There was a problem hiding this comment.
In CMake you can actually have tests depend on other tests. I've been thinking for a while that that's actually how we should do the compilation tests rather than having them as part of the build system.
Yeah, that would be great. I can file an issue for that and add it to my backlog (or someone else can tackle it :D)
…ain). (iree-org#11327)" This reverts commit 72e0d3c.

This reverts #10918 to roll forward #10909, adding a hack to skip WebGPU testdata compilation when cross compiling. The right way to add this test coverage is likely either
IREE_HAL_DRIVER_WEBGPUoption and running tests with it (this won't really work until I have more tests working, and the tools are updated to somehow handle async readback... so I'm not hopeful about this approach for at least several months)