@@ -9636,8 +9636,6 @@ struct llm_build_gemma3n_iswa : public llm_graph_context {
9636
9636
const int n_layer_sparsity = 10; // number of layers using activation sparsity
9637
9637
const float f_sparsity_std_mul = 1.6448533535003662f; // std_multiplier = normal_dist.icdf(0.95)
9638
9638
9639
- ggml_tensor * one; // containing single element 1.0f
9640
-
9641
9639
llm_build_gemma3n_iswa(const llama_model & model, const llm_graph_params & params, ggml_cgraph * gf)
9642
9640
: llm_graph_context(params),
9643
9641
model(model),
@@ -9649,14 +9647,6 @@ struct llm_build_gemma3n_iswa : public llm_graph_context {
9649
9647
ggml_tensor * cur;
9650
9648
ggml_tensor * inpL;
9651
9649
9652
- // TODO: remove this when ggml_scale_add is implemented
9653
- one = ggml_new_tensor_1d(ctx0, GGML_TYPE_F32, 1);
9654
- {
9655
- auto inp = std::make_unique<llm_graph_input_one>();
9656
- inp->one = one;
9657
- res->add_input(std::move(inp));
9658
- }
9659
-
9660
9650
inpL = build_inp_embd(model.tok_embd);
9661
9651
9662
9652
// important: do not normalize weights for raw embeddings input (i.e. encoded image emdeddings)
@@ -10046,7 +10036,7 @@ struct llm_build_gemma3n_iswa : public llm_graph_context {
10046
10036
cb(innovation, "innovation", il);
10047
10037
10048
10038
ggml_tensor * all_coefs = build_lora_mm(model.layers[il].altup_correct_coef, modalities); // [n_altup, n_tokens]
10049
- all_coefs = ggml_add (ctx0, all_coefs, one);
10039
+ all_coefs = ggml_scale_bias (ctx0, all_coefs, 1.0f, 1.0f); // + 1.0
10050
10040
cb(all_coefs, "all_coefs", il);
10051
10041
all_coefs = ggml_cont(ctx0, ggml_transpose(ctx0, all_coefs)); // [n_tokens, n_altup]
10052
10042
all_coefs = ggml_reshape_3d(ctx0, all_coefs, 1, n_tokens, n_altup); // [1, n_tokens, n_altup]
0 commit comments