Unverified Commit 6e4852ce authored by Tyler Michael Smith's avatar Tyler Michael Smith Committed by GitHub
Browse files

[CI/Build] Suppress divide-by-zero and missing return statement warnings (#7001)

parent 8571ac46
...@@ -94,6 +94,7 @@ inline __device__ float2 bf1622float2(const __nv_bfloat162 val) { ...@@ -94,6 +94,7 @@ inline __device__ float2 bf1622float2(const __nv_bfloat162 val) {
#else #else
return __bfloat1622float2(val); return __bfloat1622float2(val);
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
inline __device__ __nv_bfloat162 bf162bf162(const __nv_bfloat16 val) { inline __device__ __nv_bfloat162 bf162bf162(const __nv_bfloat16 val) {
...@@ -102,6 +103,7 @@ inline __device__ __nv_bfloat162 bf162bf162(const __nv_bfloat16 val) { ...@@ -102,6 +103,7 @@ inline __device__ __nv_bfloat162 bf162bf162(const __nv_bfloat16 val) {
#else #else
return __bfloat162bfloat162(val); return __bfloat162bfloat162(val);
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
// Vector addition. // Vector addition.
...@@ -115,6 +117,7 @@ inline __device__ __nv_bfloat16 add(__nv_bfloat16 a, __nv_bfloat16 b) { ...@@ -115,6 +117,7 @@ inline __device__ __nv_bfloat16 add(__nv_bfloat16 a, __nv_bfloat16 b) {
return __hadd(a, b); return __hadd(a, b);
#endif #endif
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
inline __device__ __nv_bfloat162 add(__nv_bfloat162 a, __nv_bfloat162 b) { inline __device__ __nv_bfloat162 add(__nv_bfloat162 a, __nv_bfloat162 b) {
...@@ -123,6 +126,7 @@ inline __device__ __nv_bfloat162 add(__nv_bfloat162 a, __nv_bfloat162 b) { ...@@ -123,6 +126,7 @@ inline __device__ __nv_bfloat162 add(__nv_bfloat162 a, __nv_bfloat162 b) {
#else #else
return __hadd2(a, b); return __hadd2(a, b);
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
inline __device__ bf16_4_t add(bf16_4_t a, bf16_4_t b) { inline __device__ bf16_4_t add(bf16_4_t a, bf16_4_t b) {
...@@ -170,6 +174,7 @@ inline __device__ __nv_bfloat16 mul(__nv_bfloat16 a, __nv_bfloat16 b) { ...@@ -170,6 +174,7 @@ inline __device__ __nv_bfloat16 mul(__nv_bfloat16 a, __nv_bfloat16 b) {
#else #else
return __hmul(a, b); return __hmul(a, b);
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
template <> template <>
...@@ -179,6 +184,7 @@ inline __device__ __nv_bfloat162 mul(__nv_bfloat162 a, __nv_bfloat162 b) { ...@@ -179,6 +184,7 @@ inline __device__ __nv_bfloat162 mul(__nv_bfloat162 a, __nv_bfloat162 b) {
#else #else
return __hmul2(a, b); return __hmul2(a, b);
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
template <> template <>
...@@ -289,6 +295,7 @@ inline __device__ __nv_bfloat162 fma(__nv_bfloat162 a, __nv_bfloat162 b, ...@@ -289,6 +295,7 @@ inline __device__ __nv_bfloat162 fma(__nv_bfloat162 a, __nv_bfloat162 b,
#else #else
return __hfma2(a, b, c); return __hfma2(a, b, c);
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
inline __device__ __nv_bfloat162 fma(__nv_bfloat16 a, __nv_bfloat162 b, inline __device__ __nv_bfloat162 fma(__nv_bfloat16 a, __nv_bfloat162 b,
...@@ -298,6 +305,7 @@ inline __device__ __nv_bfloat162 fma(__nv_bfloat16 a, __nv_bfloat162 b, ...@@ -298,6 +305,7 @@ inline __device__ __nv_bfloat162 fma(__nv_bfloat16 a, __nv_bfloat162 b,
#else #else
return __hfma2(bf162bf162(a), b, c); return __hfma2(bf162bf162(a), b, c);
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
inline __device__ bf16_4_t fma(bf16_4_t a, bf16_4_t b, bf16_4_t c) { inline __device__ bf16_4_t fma(bf16_4_t a, bf16_4_t b, bf16_4_t c) {
......
...@@ -95,6 +95,7 @@ __device__ uint4 dequantize_s4_to_fp16x2(uint32_t const& source) { ...@@ -95,6 +95,7 @@ __device__ uint4 dequantize_s4_to_fp16x2(uint32_t const& source) {
return result; return result;
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
} // namespace awq } // namespace awq
......
...@@ -475,6 +475,7 @@ __inline__ __device__ uint8_t scaled_vec_conversion<uint8_t, __nv_bfloat16>( ...@@ -475,6 +475,7 @@ __inline__ __device__ uint8_t scaled_vec_conversion<uint8_t, __nv_bfloat16>(
__NV_SATFINITE, fp8_type); __NV_SATFINITE, fp8_type);
return (uint8_t)res; return (uint8_t)res;
#endif #endif
__builtin_unreachable(); // Suppress missing return statement warning
} }
// float -> fp8 // float -> fp8
...@@ -508,7 +509,7 @@ __inline__ __device__ Tout convert(const Tin& x) { ...@@ -508,7 +509,7 @@ __inline__ __device__ Tout convert(const Tin& x) {
} }
#endif #endif
assert(false); assert(false);
return {}; // Squash missing return statement warning __builtin_unreachable(); // Suppress missing return statement warning
} }
template <typename Tout, typename Tin, Fp8KVCacheDataType kv_dt> template <typename Tout, typename Tin, Fp8KVCacheDataType kv_dt>
...@@ -521,7 +522,7 @@ __inline__ __device__ Tout scaled_convert(const Tin& x, const float scale) { ...@@ -521,7 +522,7 @@ __inline__ __device__ Tout scaled_convert(const Tin& x, const float scale) {
} }
#endif #endif
assert(false); assert(false);
return {}; // Squash missing return statement warning __builtin_unreachable(); // Suppress missing return statement warning
} }
// The following macro is used to dispatch the conversion function based on // The following macro is used to dispatch the conversion function based on
......
...@@ -1130,12 +1130,12 @@ __global__ void Marlin( ...@@ -1130,12 +1130,12 @@ __global__ void Marlin(
}; };
auto fetch_zp_to_registers = [&](int k, int full_pipe) { auto fetch_zp_to_registers = [&](int k, int full_pipe) {
if constexpr (has_zp) { // This code does not handle group_blocks == 0,
// This code does not handle group_blocks == 0, // which signifies act_order.
// which signifies act_order. // has_zp implies AWQ, which doesn't have act_order,
// has_zp implies AWQ, which doesn't have act_order, static_assert(!has_zp || group_blocks != 0);
static_assert(group_blocks != 0);
if constexpr (has_zp) {
int pipe = full_pipe % stages; int pipe = full_pipe % stages;
if constexpr (group_blocks == -1) { if constexpr (group_blocks == -1) {
...@@ -1161,7 +1161,13 @@ __global__ void Marlin( ...@@ -1161,7 +1161,13 @@ __global__ void Marlin(
cur_k += k_iter_size * (k % b_sh_wr_iters); cur_k += k_iter_size * (k % b_sh_wr_iters);
int k_blocks = cur_k / 16; int k_blocks = cur_k / 16;
int cur_group_id = k_blocks / group_blocks; int cur_group_id = 0;
// Suppress bogus and persistent divide-by-zero warning
#pragma nv_diagnostic push
#pragma nv_diag_suppress divide_by_zero
cur_group_id = k_blocks / group_blocks;
#pragma nv_diagnostic pop
int4* sh_zp_stage = sh_zp + zp_sh_stage * pipe; int4* sh_zp_stage = sh_zp + zp_sh_stage * pipe;
......
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