Commit 1fb40bd3 authored by xiabo's avatar xiabo
Browse files

Q支持fp8

parent 1a3ed91b
......@@ -54,9 +54,13 @@ __device__ __forceinline__ fp8_type scaled_fp8_conversion(float const val,
// Currently only support fp8_type = c10::Float8_e4m3fn
return fp8::vec_conversion<fp8_type, float>(r);
#else
fp8_type *test;
uint8_t test_uint8 = fp8::float_to_fp8_e4m3(x);
test = (fp8_type*)(&test_uint8);
return *test;
// Use hardware cvt instruction for fp8 on rocm
// return fp8::cvt_c10<fp8_type>(r);
return fp8::float_to_fp8_e4m3(x);
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment