Repository navigation
Update WebGPU target using latest Tint code. - #10134
Conversation
Separately, I can look into getting automated build/test coverage for WebGPUTarget.
042804b to
626eec9
Compare
| # Enable WebGPU compiler builds and tests. All deps get fetched as needed, | ||
| # but some of the deps are too large to enable by default for all developers. | ||
| "-DIREE_TARGET_BACKEND_WEBGPU=ON" |
There was a problem hiding this comment.
@GMNGeoffrey / @pzread FYI - if you want to review this part of the PR (covered by CODEOWNERS :P)
There was a problem hiding this comment.
I also mention this a bit in my RFC: Promoting IREE web platform / Emscripten builds to "stable"
Enabling this option fetches Tint on-demand for the WebGPU compiler target to use to compile SPIR-V to WGSL.
There was a problem hiding this comment.
Just synced this PR and I'm looking to land it. @GMNGeoffrey does this satisfy your point on the RFC?
Regarding on-demand dependencies. Can we make these as not-magic as possible?
Lines 702 to 709 in fe40a3d
There was a problem hiding this comment.
Oh dear... maybe these are filling up the runner's disk space? https://github.com/iree-org/iree/actions/runs/3137979962
build_all
Unhandled exception. System.IO.IOException: No space left on device : '/runner-root/actions-runner/_diag/Worker_20220927-182608-utc.log'
at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
System.IO.IOException: No space left on device : '/runner-root/actions-runner/_diag/Worker_20220927-182608-utc.log'
at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
at System.IO.Strategies.BufferedFileStreamStrategy.FlushWrite()
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.Diagnostics.TextWriterTraceListener.Flush()
at GitHub.Runner.Common.HostTraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id)
at GitHub.Runner.Common.HostTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message)
at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message)
at GitHub.Runner.Worker.Worker.RunAsync(String pipeIn, String pipeOut)
at GitHub.Runner.Worker.Program.MainAsync(IHostContext context, String[] args)
System.IO.IOException: No space left on device : '/runner-root/actions-runner/_diag/Worker_20220927-182608-utc.log'
at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
at System.IO.Strategies.BufferedFileStreamStrategy.FlushWrite()
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.Diagnostics.TextWriterTraceListener.Flush()
at GitHub.Runner.Common.HostTraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id)
at System.IO.Strategies.BufferedFileStreamStrategy.FlushWrite()
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.Diagnostics.TextWriterTraceListener.Flush()
at System.Diagnostics.TraceSource.Flush()
at GitHub.Runner.Common.TraceManager.Dispose(Boolean disposing)
at GitHub.Runner.Common.TraceManager.Dispose()
at GitHub.Runner.Common.HostContext.Dispose(Boolean disposing)
at GitHub.Runner.Common.HostTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message)
at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message)
at GitHub.Runner.Common.Tracing.Error(Exception exception)
at GitHub.Runner.Worker.Program.MainAsync(IHostContext context, String[] args)
at GitHub.Runner.Common.HostContext.Dispose()
at GitHub.Runner.Worker.Program.Main(String[] args)
There was a problem hiding this comment.
Maybe we should increase the CPU runner size? #10518
iree/build_tools/github_actions/runner/gcp/create_templates.sh
Lines 26 to 28 in 5bf7ae9
Can we view a breakdown of how disk space is being used?
There was a problem hiding this comment.
Are we actually building on GPU machines, or just running already built tests/benchmarks/etc.? (The new deps here should only affect the compiler build on CPU/host machines)
There was a problem hiding this comment.
We're not building, but the setup step for the ramdisk is the same for both. We could add a conditional. But I actually think using 50/85 GB on the ramdisk is probably a bad idea anyway. We could see about lowering the also
There was a problem hiding this comment.
Hmmmm... I'd still like to land this soon, so I can rebase the benvanik-webgpu-skeleton branch on the compiler changes here. I think I'll split this into two PRs: one updating the code, and one turning on the CI. The CI change will need to either change how the deps are installed or wait for infrastructure changes (more disk space, or more efficient use of the current disk space).
| # Enable WebGPU compiler builds and tests. All deps get fetched as needed, | ||
| # but some of the deps are too large to enable by default for all developers. | ||
| "-DIREE_TARGET_BACKEND_WEBGPU=ON" |
There was a problem hiding this comment.
Sorry, I missed the original mention here. I may need to adjust my email filters to differentiate "assigned as reviewer because someone touched a build config" and "someone explicitly mentioned me"...
So the runner is actually doing its work in a 50G ramdisk (you reviewed that PR 😛): https://github.com/iree-org/iree/blob/5c1ce206c2/build_tools/github_actions/runner/config/setup.sh#L19. Until now that was plenty of space for building IREE. How big is this dependency exactly?? I don't love fetching on-demand on CI. For CUDA we build the necessary parts of the dep into the docker image. Can we do that instead?
Separately: turning this on here puts building the Web GPU backend in everyone's presubmits. Is it sufficiently stable for that?
Tested on a few programs, seems to still work: simple programs (no push
constants) compile to WGSL that looks reasonable and complex programs
(push constants) fail with errors like this:
```
Tint reported 1 error(s) for a SPIR-V program, see diagnostics:
error: unknown SPIR-V storage class: 9SPIR-V pointer type with ID 7 has invalid storage class 9
D:\dev\projects\iree/../iree-tmp/webgpu/unidirectional_lstm_webgpu_2022_08_18/\module__main_dispatch_0.mlir:2:2: error: failed to compile SPIR-V to WGSL. Consider inspecting the shader program using -iree-hal-dump-executable-intermediates.
hal.executable.variant public @webgpu_wgsl_fb, target = <"webgpu", "webgpu-wgsl-fb", {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>}> {
^
D:\dev\projects\iree/../iree-tmp/webgpu/unidirectional_lstm_webgpu_2022_08_18/\module__main_dispatch_0.mlir:2:2: note: see current operation: "hal.executable.variant"() ({
...
```
I want to route those diagnostics to MLIR and add line breaks at some
point (that will really help output legibility when the compiler runs
multithreaded)
---
This also adds a few compiler lit tests ~and enables building and
running those tests on our CI (`build_all` and `test_all`)~. As
compatibility issues are fixed, some of those lit tests will be removed
or adjusted. At that point I plan to enable the rest of our test suite,
similar to how Wasm is tested:
https://github.com/iree-org/iree/blob/2b226445bec8c8e28e863a467fc9e9db70a53296/tests/e2e/xla_ops/BUILD#L393-L402
…ree-org#10627) Split from iree-org#10134 - this starts building the WebGPU compiler target backend and runs the tests added in that PR.
Tested on a few programs, seems to still work: simple programs (no push constants) compile to WGSL that looks reasonable and complex programs (push constants) fail with errors like this:
I want to route those diagnostics to MLIR and add line breaks at some point (that will really help output legibility when the compiler runs multithreaded)
This also adds a few compiler lit tests
and enables building and running those tests on our CI (. As compatibility issues are fixed, some of those lit tests will be removed or adjusted. At that point I plan to enable the rest of our test suite, similar to how Wasm is tested:build_allandtest_all)iree/tests/e2e/xla_ops/BUILD
Lines 393 to 402 in 2b22644