From 6b96295f549741e3fffed9606ca81028d08779e4 Mon Sep 17 00:00:00 2001 From: DokterSmol Date: Wed, 11 Nov 2026 21:54:45 +1100 Subject: [PATCH] tests: lfm3's config.json through the checkpoint reader The rotary per attention class with the full layers' partial factor, the window, the layer list and the booleans arrive as the keys the plugin reads; the typed rope_theta is the default, which the plugin does not read. --- tests/checkpoint_test.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/checkpoint_test.cpp b/tests/checkpoint_test.cpp index 139b2965..bcd249ee 100644 --- a/tests/checkpoint_test.cpp +++ b/tests/checkpoint_test.cpp @@ -2002,6 +2002,26 @@ TEST(config_json_fills_the_model_meta_as_each_family_spells_it) { "lfm2", 0, 1024, 16, 8, 64, 0, 0, 0, 0, 0, 0, 1e-5, 1e4, { { "layer_types", "conv full_attention conv" }, { "hidden_size", "7" }, { "vision_config.hidden_size", "768" } } }, + { "LFM3: the rotary per attention class with its partial factor, the window, booleans; the " + "typed theta is the default, which the plugin does not read", + R"({"model_type":"lfm3","hidden_size":2048,"num_attention_heads":16, + "num_key_value_heads":4,"head_dim":128,"num_hidden_layers":4, + "intermediate_size":7680,"norm_eps":1e-05,"vocab_size":128000, + "max_position_embeddings":262144,"conv_L_cache":7,"conv_bias":false, + "use_sandwich_norm":true,"tie_word_embeddings":true,"sliding_window":256, + "layer_types":["conv","full_attention","sliding_attention","conv"], + "rope_parameters":{"full_attention":{"partial_rotary_factor":0.5, + "rope_theta":1000000.0,"rope_type":"default"}, + "sliding_attention":{"rope_theta":10000,"rope_type":"default"}}})", + "lfm3", 4, 2048, 16, 4, 128, 7680, 128000, 262144, 0, 0, 0, 1e-5, 1e4, + { { "layer_types", "conv full_attention sliding_attention conv" }, + { "rope_parameters.full_attention.rope_theta", "1000000" }, + { "rope_parameters.full_attention.partial_rotary_factor", "0.5" }, + { "rope_parameters.full_attention.rope_type", "default" }, + { "rope_parameters.sliding_attention.rope_theta", "10000" }, + { "rope_parameters.sliding_attention.partial_rotary_factor", nullptr }, + { "sliding_window", "256" }, { "conv_L_cache", "7" }, { "conv_bias", "0" }, + { "use_sandwich_norm", "1" }, { "tie_word_embeddings", "1" } } }, { "Gemma 4 12B: the unified wrapper maps to gemma4, its model_type stays, null experts", R"({"model_type":"gemma4_unified","eos_token_id":[1,106], "text_config":{"model_type":"gemma4_unified_text","hidden_size":3840,