Skip to content

[ET-VK][ez] Retry with no optimization during shader compilation #9096

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

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Mar 10, 2025

Stack from ghstack (oldest at bottom):

Context

In some cases, a shader can be compiled successfully with glslc, but if an optimization flag such as -O or -Os is used, the compilation will fail with a message similar to

internal error: compilation succeeded but failed to optimize: Invalid use of 8- or 16-bit result\n  %133 = OpExtInst %half %1 Pow %125 %132

Which will cause the shader compilation script to fail.

This diff introduces a check that if glslc complains about not being able to optimize the SPIR-V, then retry compilation without optimization arguments.

Differential Revision: D70906097

## Context

In some cases, a shader can be compiled successfully with `glslc`, but if an optimization flag such as `-O` or `-Os` is used, the compilation will fail with a message similar to

```
internal error: compilation succeeded but failed to optimize: Invalid use of 8- or 16-bit result\n  %133 = OpExtInst %half %1 Pow %125 %132
```

Which will cause the shader compilation script to fail.

This diff introduces a check that if `glslc` complains about not being able to optimize the SPIR-V, then retry compilation without optimization arguments.

Differential Revision: [D70906097](https://our.internmc.facebook.com/intern/diff/D70906097/)

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Mar 10, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9096

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit f7d5a87 with merge base ddf0d9e (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 10, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70906097

…lation"

## Context

In some cases, a shader can be compiled successfully with `glslc`, but if an optimization flag such as `-O` or `-Os` is used, the compilation will fail with a message similar to

```
internal error: compilation succeeded but failed to optimize: Invalid use of 8- or 16-bit result\n  %133 = OpExtInst %half %1 Pow %125 %132
```

Which will cause the shader compilation script to fail.

This diff introduces a check that if `glslc` complains about not being able to optimize the SPIR-V, then retry compilation without optimization arguments.

Differential Revision: [D70906097](https://our.internmc.facebook.com/intern/diff/D70906097/)

[ghstack-poisoned]
@facebook-github-bot facebook-github-bot merged commit ebd14ad into gh/SS-JIA/194/base Mar 11, 2025
49 of 50 checks passed
@facebook-github-bot facebook-github-bot deleted the gh/SS-JIA/194/head branch March 11, 2025 21:24
SS-JIA added a commit that referenced this pull request Mar 11, 2025
This PR was created by the merge bot to help merge the original PR into
the main branch.
ghstack PR number: #9096 by
@SS-JIA
^ Please use this as the source of truth for the PR details, comments,
and reviews
ghstack PR base:
https://github.com/pytorch/executorch/tree/gh/SS-JIA/194/base
ghstack PR head:
https://github.com/pytorch/executorch/tree/gh/SS-JIA/194/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head:
https://github.com/pytorch/executorch/tree/gh/SS-JIA/194/orig
@diff-train-skip-merge

Co-authored-by: Stephen Jia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants