Skip to content
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

Option to perform systematic SPIR-V module validation ? #2263

Open
Naghasan opened this issue Dec 12, 2023 · 2 comments
Open

Option to perform systematic SPIR-V module validation ? #2263

Naghasan opened this issue Dec 12, 2023 · 2 comments

Comments

@Naghasan
Copy link
Member

Hello,

I have been wondering if there is an option is to run the validator on the generated module as I can't find any. The only integration of SPIRV-Tools I'm aware of is the disassemble option and the use of the tools in tests.

If there is no such option, is there a reason behind or just lack of engineering resource ?

@MrSidims
Copy link
Contributor

MrSidims commented Jan 3, 2024

When SPIR-V tools are installed and the translator is build on top of them - one may also add ; spirv-val in a test (see test/CMakeLists.txt and the appropriate usages in test/ ).

llvm-spirv has some internal validations (see overloaded for each instruction validate() method), but optionally enabling spirv-val by the end of the translation seem to be a good idea. At this point of time we (as translator team in general) are lacking of engineering resource to clean up all known validator issues, but we are doing it from time to time. I believe once it is done we can add the appropriate infrastructure for optional validation.

In addition to that we (now as Intel translator team) do want to upstream every implemented extension to SPIR-V Registry and Headers (unfortunately that is not done yet), so validator can also validate our extensions as well. Once it's done we would have one less blocker for a proper implicit validation.

@Naghasan
Copy link
Member Author

thanks for the answer.

When SPIR-V tools are installed and the translator is build on top of them - one may also add ; spirv-val in a test (see test/CMakeLists.txt and the appropriate usages in test/ ).

Yes, I mentioned that in message. But it is quite different to run the validator in reproduction tests that it is to make the tool validate what it outputs. I'm not saying one better that the other, just 2 different use cases.

Once it's done we would have one less blocker for a proper implicit validation.

I'm well aware of current limitations. If added it has to be an opt-in switch.

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

No branches or pull requests

2 participants