@@ -9485,8 +9485,6 @@ struct llm_build_gemma3n_iswa : public llm_graph_context {
9485
9485
const int n_layer_sparsity = 10; // number of layers using activation sparsity
9486
9486
const float f_sparsity_std_mul = 1.6448533535003662f; // std_multiplier = normal_dist.icdf(0.95)
9487
9487
9488
- ggml_tensor * one; // containing single element 1.0f
9489
-
9490
9488
llm_build_gemma3n_iswa(const llama_model & model, const llm_graph_params & params, ggml_cgraph * gf)
9491
9489
: llm_graph_context(params),
9492
9490
model(model),
@@ -9498,14 +9496,6 @@ struct llm_build_gemma3n_iswa : public llm_graph_context {
9498
9496
ggml_tensor * cur;
9499
9497
ggml_tensor * inpL;
9500
9498
9501
- // TODO: remove this when ggml_scale_add is implemented
9502
- one = ggml_new_tensor_1d(ctx0, GGML_TYPE_F32, 1);
9503
- {
9504
- auto inp = std::make_unique<llm_graph_input_one>();
9505
- inp->one = one;
9506
- res->add_input(std::move(inp));
9507
- }
9508
-
9509
9499
inpL = build_inp_embd(model.tok_embd);
9510
9500
9511
9501
// important: do not normalize weights for raw embeddings input (i.e. encoded image emdeddings)
@@ -9895,7 +9885,7 @@ struct llm_build_gemma3n_iswa : public llm_graph_context {
9895
9885
cb(innovation, "innovation", il);
9896
9886
9897
9887
ggml_tensor * all_coefs = build_lora_mm(model.layers[il].altup_correct_coef, modalities); // [n_altup, n_tokens]
9898
- all_coefs = ggml_add (ctx0, all_coefs, one);
9888
+ all_coefs = ggml_scale_bias (ctx0, all_coefs, 1.0f, 1.0f); // + 1.0
9899
9889
cb(all_coefs, "all_coefs", il);
9900
9890
all_coefs = ggml_cont(ctx0, ggml_transpose(ctx0, all_coefs)); // [n_tokens, n_altup]
9901
9891
all_coefs = ggml_reshape_3d(ctx0, all_coefs, 1, n_tokens, n_altup); // [1, n_tokens, n_altup]
0 commit comments