-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[vulkan] glsl shaders relaxed precision mode to cmake option #43076
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
Conversation
[ghstack-poisoned]
Differential Revision: [D23143354](https://our.internmc.facebook.com/intern/diff/D23143354) Introducing cmake option USE_VULKAN_RELAXED_PRECISION that controls which precision will be used in Vullkan shaders. Default: `highp`: 32-bit two’s complement for integers, 32-bit IEEE 754 floating-point for float if USE_VULKAN_RELAXED_PRECISION=ON: `mediump`: RelaxedPrecision, on storage variable and operation All shaders starts from `#define PRECISION $precision` where `$precision` will be substituted on codegen step (build). To be able to use CodeTemplate from `aten/src/ATen/code_template.py` for substitution processing: moving `aten/src/ATen/native/vulkan/gen_glsl.py` to `aten/src/ATen/gen_vulkan_glsl.py` as without it can not import python code from parent directories. `aten/src/ATen/gen_vulkan_glsl.py`, `aten/src/ATen/gen_vulkan_glsl.py` added `env` argument that specifies list of key-value pairs for substitution, by default env is `{"precision": "highp"}` and can be overriden adding `--env precision=mediump` Some fixes in cpp to fix build for `USE_VULKAN_SHADERC_RUNTIME=ON` [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit c7009c5 (more details on the Dr. CI page):
1 job timed out:
❄️ 2 failures tentatively classified as flakybut reruns have not yet been triggered to confirm:
|
Differential Revision: [D23143354](https://our.internmc.facebook.com/intern/diff/D23143354) Introducing cmake option USE_VULKAN_RELAXED_PRECISION that controls which precision will be used in Vullkan shaders. Default: `highp`: 32-bit two’s complement for integers, 32-bit IEEE 754 floating-point for float if USE_VULKAN_RELAXED_PRECISION=ON: `mediump`: RelaxedPrecision, on storage variable and operation All shaders starts from `#define PRECISION $precision` where `$precision` will be substituted on codegen step (build). To be able to use CodeTemplate from `aten/src/ATen/code_template.py` for substitution processing: moving `aten/src/ATen/native/vulkan/gen_glsl.py` to `aten/src/ATen/gen_vulkan_glsl.py` as without it can not import python code from parent directories. `aten/src/ATen/gen_vulkan_glsl.py`, `aten/src/ATen/gen_vulkan_glsl.py` added `env` argument that specifies list of key-value pairs for substitution, by default env is `{"precision": "highp"}` and can be overriden adding `--env precision=mediump` Some fixes in cpp to fix build for `USE_VULKAN_SHADERC_RUNTIME=ON` [ghstack-poisoned]
Differential Revision: [D23143354](https://our.internmc.facebook.com/intern/diff/D23143354) Introducing cmake option USE_VULKAN_RELAXED_PRECISION that controls which precision will be used in Vullkan shaders. Default: `highp`: 32-bit two’s complement for integers, 32-bit IEEE 754 floating-point for float if USE_VULKAN_RELAXED_PRECISION=ON: `mediump`: RelaxedPrecision, on storage variable and operation All shaders starts from `#define PRECISION $precision` where `$precision` will be substituted on codegen step (build). To be able to use CodeTemplate from `aten/src/ATen/code_template.py` for substitution processing: moving `aten/src/ATen/native/vulkan/gen_glsl.py` to `aten/src/ATen/gen_vulkan_glsl.py` as without it can not import python code from parent directories. `aten/src/ATen/gen_vulkan_glsl.py`, `aten/src/ATen/gen_vulkan_glsl.py` added `env` argument that specifies list of key-value pairs for substitution, by default env is `{"precision": "highp"}` and can be overriden adding `--env precision=mediump` Some fixes in cpp to fix build for `USE_VULKAN_SHADERC_RUNTIME=ON` [ghstack-poisoned]
Differential Revision: [D23143354](https://our.internmc.facebook.com/intern/diff/D23143354) Introducing cmake option USE_VULKAN_RELAXED_PRECISION that controls which precision will be used in Vullkan shaders. Default: `highp`: 32-bit two’s complement for integers, 32-bit IEEE 754 floating-point for float if USE_VULKAN_RELAXED_PRECISION=ON: `mediump`: RelaxedPrecision, on storage variable and operation All shaders starts from `#define PRECISION $precision` where `$precision` will be substituted on codegen step (build). To be able to use CodeTemplate from `aten/src/ATen/code_template.py` for substitution processing: moving `aten/src/ATen/native/vulkan/gen_glsl.py` to `aten/src/ATen/gen_vulkan_glsl.py` as without it can not import python code from parent directories. `aten/src/ATen/gen_vulkan_glsl.py`, `aten/src/ATen/gen_vulkan_glsl.py` added `env` argument that specifies list of key-value pairs for substitution, by default env is `{"precision": "highp"}` and can be overriden adding `--env precision=mediump` Some fixes in cpp to fix build for `USE_VULKAN_SHADERC_RUNTIME=ON` [ghstack-poisoned]
Differential Revision: [D23143354](https://our.internmc.facebook.com/intern/diff/D23143354) Introducing cmake option USE_VULKAN_RELAXED_PRECISION that controls which precision will be used in Vullkan shaders. Default: `highp`: 32-bit two’s complement for integers, 32-bit IEEE 754 floating-point for float if USE_VULKAN_RELAXED_PRECISION=ON: `mediump`: RelaxedPrecision, on storage variable and operation All shaders starts from `#define PRECISION $precision` where `$precision` will be substituted on codegen step (build). To be able to use CodeTemplate from `aten/src/ATen/code_template.py` for substitution processing: moving `aten/src/ATen/native/vulkan/gen_glsl.py` to `aten/src/ATen/gen_vulkan_glsl.py` as without it can not import python code from parent directories. `aten/src/ATen/gen_vulkan_glsl.py`, `aten/src/ATen/gen_vulkan_glsl.py` added `env` argument that specifies list of key-value pairs for substitution, by default env is `{"precision": "highp"}` and can be overriden adding `--env precision=mediump` Some fixes in cpp to fix build for `USE_VULKAN_SHADERC_RUNTIME=ON` [ghstack-poisoned]
Differential Revision: [D23143354](https://our.internmc.facebook.com/intern/diff/D23143354) Introducing cmake option USE_VULKAN_RELAXED_PRECISION that controls which precision will be used in Vullkan shaders. Default: `highp`: 32-bit two’s complement for integers, 32-bit IEEE 754 floating-point for float if USE_VULKAN_RELAXED_PRECISION=ON: `mediump`: RelaxedPrecision, on storage variable and operation All shaders starts from `#define PRECISION $precision` where `$precision` will be substituted on codegen step (build). To be able to use CodeTemplate from `aten/src/ATen/code_template.py` for substitution processing: moving `aten/src/ATen/native/vulkan/gen_glsl.py` to `aten/src/ATen/gen_vulkan_glsl.py` as without it can not import python code from parent directories. `aten/src/ATen/gen_vulkan_glsl.py`, `aten/src/ATen/gen_vulkan_glsl.py` added `env` argument that specifies list of key-value pairs for substitution, by default env is `{"precision": "highp"}` and can be overriden adding `--env precision=mediump` Some fixes in cpp to fix build for `USE_VULKAN_SHADERC_RUNTIME=ON` [ghstack-poisoned]
|
@IvanKobzarev merged this pull request in 6debe82. |
Summary: Pull Request resolved: #43076 Test Plan: Imported from OSS Reviewed By: AshkanAliabadi Differential Revision: D23143354 Pulled By: IvanKobzarev fbshipit-source-id: 7b3ead1e63cf8acf6e8e547080a8ead7a2db994b
Stack from ghstack:
Differential Revision: D23143354
Introducing cmake option USE_VULKAN_RELAXED_PRECISION that controls which precision will be used in Vullkan shaders.
Default:
highp: 32-bit two’s complement for integers, 32-bit IEEE754 floating-point for float
if USE_VULKAN_RELAXED_PRECISION=ON:
mediump: RelaxedPrecision, on storage variable and operationAll shaders starts from
#define PRECISION $precisionwhere$precisionwill be substituted on codegen step (build).To be able to use CodeTemplate from
aten/src/ATen/code_template.pyfor substitution processing:moving
aten/src/ATen/native/vulkan/gen_glsl.pytoaten/src/ATen/gen_vulkan_glsl.pyas without it can not import python code from parent directories.aten/src/ATen/gen_vulkan_glsl.py,aten/src/ATen/gen_vulkan_glsl.pyaddedenvargument that specifies list of key-value pairs for substitution, by default env is{"precision": "highp"}and can be overriden adding--env precision=mediumpSome fixes in cpp to fix build for
USE_VULKAN_SHADERC_RUNTIME=ON