-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimally integrate SPIR-T (opt-in via RUSTGPU_CODEGEN_ARGS=--spirt
).
#940
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This was referenced Nov 24, 2022
This was referenced Dec 2, 2022
Merged
eddyb
added a commit
to EmbarkStudios/spirt
that referenced
this pull request
Dec 9, 2022
…meter`. (#12) Looks like an accidental omission originally - found while trying to align `rustc_codegen_spirv::linker::test` unit tests so SPIR-T doesn't affect them (for EmbarkStudios/rust-gpu#940 (comment)).
RUSTGPU_CODEGEN_ARGS=--spirt
).
Ooops, had to draft again because I forgot to update the CHANGELOG. |
oisyn
approved these changes
Dec 12, 2022
This was referenced Apr 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please see the SPIR-T repository for more information, but to quote the top of its
README
:This PR integrates it into Rust-GPU in a very limited capacity, in the middle of a sequence of passes operating on SPIR-V, as a
... -> SPIR-V -> SPIR-T -> SPIR-V -> ...
conversion, with the only SPIR-T -> SPIR-T pass being the CFG structurizer (substituting our own structurizer, which we may want to delete?).That alone is enough to show some compile-time speedups of over 30% in some workloads, while adding only marginal overhead (~0.1%), and it's still being limited by our existing passes (see EmbarkStudios/spirt#6).
To enable, you can use
RUSTGPU_CODEGEN_ARGS=--spirt
- to quote the (more detailed)codegen-args.md
docs:Opening this PR as a draft because there are some discussions that need to be had, i.e.:(click to open outdated bullet points)
the debuginfo we don't guarantee so it's maybe fine? we can also improve it over time#[spirv(unroll_loops)]
is effectively broken and would need to be rewritten to operate on SPIR-Tthir_body
to inject loop merge points for structurization. #944should we just delete code this supersedes? (our old structurizer)should we wait for0.4
to release, so that the SPIR-T dependency can be only0.5
onward?this would allow more time to refine it before we need to releasespirt 0.1
on crates.io0.4
, and by default only later (0.5
or so)