Commit fa39754
[vulkan] Disable shader optimization to avoid Validation Errors (pytorch#69331)
Summary:
Pull Request resolved: pytorch#69331
---
## Context
When the optimization flag is turned on, some SPIR-V modules produced from the Vulkan compute shaders were invalid. The Vulkan Validation layer raises the following error for these modules:
```
[ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object: VK_NULL_HANDLE (Type = 0) | SPIR-V module not valid: Header block 52[%52] is contained in the loop construct headed by 44[%44], but it's merge block 47[%47] is not
%52 = OpLabel
```
Turning off the optimization flag, the SPIR-V modules produced no longer reports these errors in the Validation layer.
## Changes
Turns off optimization when generating SPIR-V modules to ensure correctness of the modules.
**Note that disabling SPIR-V optimization did not regress inference latency for the several models I tested**.
Test Plan: Imported from OSS
Reviewed By: beback4u
Differential Revision: D32840910
Pulled By: SS-JIA
fbshipit-source-id: 7ccb5691fd0e2d11b9c8c28ad7b83906e81636991 parent bede33e commit fa39754
2 files changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 80 | | |
| 81 | + | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
| |||
0 commit comments