[Bugfix] Fix SM100 fp8_ds_mla cache scales (#49435)
Signed-off-by: Ariel Bereslavsky <arielb@getimpala.ai> Signed-off-by: Ariel Bereslavsky <ariel@getimpala.ai> Signed-off-by: Yongye Zhu <zyy1102000@gmail.com> Co-authored-by: Ariel Bereslavsky <arielb@getimpala.ai> Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Misha Goin <mgoin64@gmail.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Ariel Bereslavsky
Codex
Misha Goin
Yongye Zhu
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
674b6d95d6
commit
a7fda4c88b
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
#include <cstdlib>
|
||||
|
||||
#ifdef USE_ROCM
|
||||
@@ -589,8 +588,9 @@ __global__ void concat_and_cache_ds_mla_kernel(
|
||||
max_abs = fmaxf(max_abs, VLLM_SHFL_XOR_SYNC_WIDTH(max_abs, offset, 16));
|
||||
}
|
||||
|
||||
// Compute the scale for the tile
|
||||
float tile_scale = fmaxf(max_abs / kFp8ScaleDivisor, FLT_MIN);
|
||||
// Both SM90 and SM100 readers preserve power-of-two fp32 scales exactly.
|
||||
float tile_scale = fmaxf(max_abs / kFp8ScaleDivisor, 1e-4f);
|
||||
tile_scale = exp2f(ceilf(log2f(tile_scale)));
|
||||
|
||||
// The first lane of each half-warp writes the scale to kv_cache
|
||||
if ((lane_idx == 0) || (lane_idx == 16)) {
|
||||
|
||||
Reference in New Issue
Block a user