@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / f13cf9ad50
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 05:45 UTC

[Build] Fix for the Wswitch-bool clang warning (#10060)

Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>

Gregory Shtrasberg committed Dec 7, 2024 at 04:03 UTC f13cf9ad5049e386f766014877dee78d2f438799
2 files changed +8 -14
csrc/attention/paged_attention_v1.cu
+4 -7
@@ -140,13 +140,10 @@ void paged_attention_v1_launcher(
140 blocksparse_block_size, blocksparse_head_sliding_step);
141
142 #define CALL_V1_LAUNCHER_SPARSITY(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE) \
143 - switch (is_block_sparse) { \
144 - case true: \
145 - CALL_V1_LAUNCHER(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE, true); \
146 - break; \
147 - case false: \
148 - CALL_V1_LAUNCHER(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE, false); \
149 - break; \
143 + if (is_block_sparse) { \
144 + CALL_V1_LAUNCHER(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE, true); \
145 + } else { \
146 + CALL_V1_LAUNCHER(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE, false); \
147 }
148
149 // NOTE(woosuk): To reduce the compilation time, we omitted block sizes
csrc/attention/paged_attention_v2.cu
+4 -7
@@ -147,13 +147,10 @@ void paged_attention_v2_launcher(
147 blocksparse_head_sliding_step);
148
149 #define CALL_V2_LAUNCHER_SPARSITY(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE) \
150 - switch (is_block_sparse) { \
151 - case true: \
152 - CALL_V2_LAUNCHER(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE, true); \
153 - break; \
154 - case false: \
155 - CALL_V2_LAUNCHER(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE, false); \
156 - break; \
150 + if (is_block_sparse) { \
151 + CALL_V2_LAUNCHER(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE, true); \
152 + } else { \
153 + CALL_V2_LAUNCHER(T, CACHE_T, BLOCK_SIZE, IS_FP8_KV_CACHE, false); \
154 }
155
156 // NOTE(woosuk): To reduce the compilation time, we omitted block sizes