metal: fp8 conversion modes, the round-to-nearest float helpers, and an mma.h placeholder
ds4_numerics.cuh names __NV_E4M3/__NV_SATFINITE and __half_raw, ds4_q6k.cuh names __fmul_rn/__ushort_as_half, and both kernel files include mma.h: cuda_bf16.h now carries the fp8 enums and includes cuda_fp16.h (for __half_raw), cuda_fp16.h carries the five rn helpers and __ushort_as_half, and mma.h says what it is (the wmma surface does not exist on Metal; the token path does not use it, and an instantiation fails loudly). State after this: ds4_model.cu 0 errors; the four kernel files are at the compiler's 20-error limit with a shorter list each - the remaining class is the device code itself (block decoders, shuffles, shared memory), which is the MSL work.
This commit is contained in:
1 parent
18c6075562
commit
e46b149ae5
1 file changed
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
// the round-to-nearest float helpers: on Apple Silicon the FP ops are already IEEE and un-fused here
|
||||
static inline float __fmul_rn(float a, float b) { return a * b; }
|
||||
static inline float __fadd_rn(float a, float b) { return a + b; }
|
||||
static inline float __fmaf_rn(float a, float b, float c) { return a * b + c; }
|
||||
static inline float __frcp_rn(float a) { return 1.0f / a; }
|
||||
static inline float __fsqrt_rn(float a) { return __builtin_sqrtf(a); }
|
||||
Reference in new issue
Block a user