[Migrated] Is support for 16bit Floating point planned/in scope?
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Rust
- Estrellas
- 3.4k
- Forks
- 126
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/1003
Old labels: t: enhancement
Originally creatd by duplexsystem on 2023-03-15T16:50:07Z 👍: 2
16bit Floating point support has been a feature of GPUs since Nvidia's Pascal, AMD's RDNA2, and Adreno GPUs starting at some point (couldn't find out when). Copied from this WebGPU suggestion (because it's a good summary) fp16 provide the following, quite large benefits over fp32:
- It uses half the memory size (of course). This is particularly important on mobile devices where available memory is limited. Specifically, one of the most common / strongest request the Metal team gets from 3rd parties is for features which can help decrease their memory use.
- Because it uses half the size, memory bandwidth is more effectively used.
- Even without the bandwidth increase, devices often have increased ALU performance for half-precision operations.
- Power consumption is decreased on some devices, leading to better battery life.
In addition fp16 support has been a, optional, core feature since Vulkan 1.2, see VK_KHR_shader_float16_int8.
Sadly rust currently does not have an fp16 type, however there are crates such as half which emulate fp16 and optionally compile down to native types/intrinsics when possible. However possibly other than directly writing inline SPIR-V, and even that may cause unintended side effects as to my knowledge rust-gpu was not written with fp16 support in mind, rust-gpu does not support fp16. Given glam also does not support fp16 ecosystem integration would not be trivial. However the performance gain and flexibility of allowing fp16 are quite large and fp16 would expand the amount of shaders that could be ported to rust in a performant way (see FSR 1.0, FSR 2.0, and NIS among others).
All that to preface: Is support for 16bit Floating point planned/in scope for rust-gpu, be that directly support or just exposing intrinsics and supporting 16bit storage?
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
El issue no menciona archivos del repositorio, pruebas ni puntos de entrada; comienza localizando la compatibilidad existente con tipos y SPIR-V en rust-gpu y revisando la extensión de Vulkan y half crate enlazados. Para darlo por terminado haría falta un alcance aprobado por un maintainer para la compatibilidad nativa con fp16, intrinsics o almacenamiento de 16 bits, junto con el trabajo correspondiente de implementación y validación.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust
- Área
- compilers, computer-graphics
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100