From 37a25c9ffe078287093812d80f85fd7c7de3d1a7 Mon Sep 17 00:00:00 2001 From: Jan Wassenberg Date: Mon, 24 Nov 2025 00:50:40 -0800 Subject: [PATCH] Fix warning (signed vs unsigned) PiperOrigin-RevId: 836106478 --- gemma/flash_attention.cc | 8 ++++---- io/blob_store.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gemma/flash_attention.cc b/gemma/flash_attention.cc index 55d0522..a463dfe 100644 --- a/gemma/flash_attention.cc +++ b/gemma/flash_attention.cc @@ -218,7 +218,7 @@ void QDotKTile(DF df, const BF16* HWY_RESTRICT q, const size_t q_stride, sum6 = hn::Zero(df); sum7 = hn::Zero(df); const float* HWY_RESTRICT k_row[kHTileSize]; - for (int i = 0; i < kHTileSize; ++i) { + for (size_t i = 0; i < kHTileSize; ++i) { k_row[i] = k.Row(k_pos[i]); } @@ -288,15 +288,15 @@ void TileFlashAttention( const uint32_t* HWY_RESTRICT out_offsets, ThreadingContext& ctx, const size_t worker) { GCPP_ZONE(ctx, worker, Zones::kFlashAttentionTileFlashAttention); - constexpr int kHTileSize = kNFx8HTileSize; + constexpr size_t kHTileSize = kNFx8HTileSize; using DF = hn::ScalableTag; const DF df; using VF = hn::Vec; using DI = hn::ScalableTag; const DI di; using VI = hn::Vec; - const int kVTileSize = hn::Lanes(df); - for (int i = 0; i < kVTileSize; ++i) { + const size_t kVTileSize = hn::Lanes(df); + for (size_t i = 0; i < kVTileSize; ++i) { hwy::ZeroBytes(att_out.Row(0) + out_offsets[i], v.Cols() * sizeof(att_out.Row(0)[0])); } diff --git a/io/blob_store.h b/io/blob_store.h index e5f2221..82c2357 100644 --- a/io/blob_store.h +++ b/io/blob_store.h @@ -131,7 +131,7 @@ class BlobWriter { std::vector blob_sizes_; ThreadingContext& ctx_; // Current offset in the file used for writing. - int64_t curr_offset_ = 0; + uint64_t curr_offset_ = 0; }; } // namespace gcpp