ROCm / triton

Development repository for the Triton language and compiler
MIT License
83 stars 27 forks source link

support type conversion between fp8 formats and bf16/fp32 with HW instructions on MI300 #414

Closed scxiao closed 7 months ago

scxiao commented 9 months ago

Upstream Triton provides type conversion between fp8 and fp32 without using intermediate fp16 types. MI300 provides HW instructions exactly for such conversion. Also provided are the conversion between fp8 and bf16, so this PR provides data type conversions between the following types on MI300.

1) fp8/bf8 <--> fp32 without using fp16 as the intermediate data types, which can improve type conversion performance in some scenarios. 2) fp8/bf8 <--> bf16. This is implemented as fp8/bf8 <--> fp32 <--> bf16.

Again, the test script test_fp8_vecadd.py will be removed before merging this PR.

scxiao commented 7 months ago

Hi Shucai, could you revise those related to conversion between bf16 and fp32?

Hi Wen, thanks for the comments, please check the update.