Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,14 @@ cc_test(
srcs = ["gemma/tensor_info_test.cc"],
deps = [
":configs",
":gemma_args",
":mat",
":tensor_info",
":threading_context",
":weights",
"@googletest//:gtest_main", # buildcleaner: keep
"//compression:compress",
"//compression:types",
"@highway//:hwy", # aligned_allocator.h
],
)
Expand Down
2 changes: 1 addition & 1 deletion gemma/gemma-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ HWY_NOINLINE void ActivationBatched(
ActivationType activation, Mat1& c1, const Mat2* c2, ThreadingContext& ctx,
size_t cluster_idx = 0,
Parallelism parallelism = Parallelism::kFlat) {
HWY_DASSERT(c1.SameShape(*c2));
if (c2 && c2->HasPtr()) {
HWY_DASSERT(c1.SameShape(*c2));
ParallelFor(parallelism, c1.Rows(), ctx, cluster_idx,
Callers::kActivationBatched, [&](uint64_t task, size_t worker) {
Activation(activation, c1.Row(task), c2->Row(task), c1.Cols(),
Expand Down
2 changes: 1 addition & 1 deletion gemma/gemma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static HWY_INLINE void EmbedTokenFromWeights(int token, size_t x_row,
MatStorageT<float>& x) {
const size_t model_dim = model_config.model_dim;
// Qwen3/DeepSeekV4 does not scale embeddings by sqrt(model_dim).
const float emb_scaling =
float emb_scaling =
HasEmbeddingScaling(model_config) ? EmbeddingScaling(model_dim) : 1.0f;
HWY_DASSERT(token >= 0);
HWY_DASSERT(token < static_cast<int>(model_config.vocab_size));
Expand Down
5 changes: 5 additions & 0 deletions gemma/tensor_info_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

#include <stdio.h>

#include <vector>

#include "gtest/gtest.h"
#include "compression/compress-inl.h"
#include "compression/types.h" // SfpStream
#include "gemma/configs.h"
#include "gemma/gemma_args.h"
#include "gemma/weights.h"
#include "util/mat.h"
#include "util/threading_context.h"
#include "hwy/base.h" // HWY_ASSERT_M

namespace gcpp {
Expand Down
Loading