[Migrated] Is support for 16bit Floating point planned/in scope?
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Rust
- Star
- 3.4k
- Fork
- 126
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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?
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Issue không nêu tên các tệp trong repository, các bài kiểm thử hoặc các entry point; hãy bắt đầu bằng cách xác định phần hỗ trợ hiện có cho kiểu và SPIR-V trong rust-gpu, đồng thời xem xét extension Vulkan và half crate được liên kết. Để được coi là hoàn tất, cần có phạm vi được maintainer phê duyệt cho việc hỗ trợ fp16 native, intrinsics hoặc lưu trữ 16-bit, cùng với công việc triển khai và xác thực tương ứng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- rust
- Lĩnh vực
- compilers, computer-graphics
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100