Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def kda_mixer_config(kda_config):
"heads": num_heads,
"head_dim": head_dim,
"convolution_layer": {"kernel_size": 4},
"normalization": {"epsilon": 1e-5},
"normalization": {"epsilon": 1e-5, "activation": "sigmoid"},
}


Expand Down Expand Up @@ -1088,9 +1088,8 @@ def test_vs_fla(
fla_cache = FLACache()
apriel_cache = Apriel2Cache(make_apriel2_config(kda_hidden_size, kda_mixer_config))

# Force chunk mode for prefill
fla_kda.mode = "chunk"
apriel_kda.mode = "chunk"
# Match Apriel2's mode selection: fused_recurrent for seq_len<=64 in eval
fla_kda.mode = "fused_recurrent"

# ========== PHASE 1: Initial Prefill ==========
prefill_input = hidden_states[:, :prefill_len, :]
Expand Down Expand Up @@ -1125,7 +1124,6 @@ def test_vs_fla(

# ========== PHASE 2: Decode (single tokens) ==========
fla_kda.mode = "fused_recurrent"
apriel_kda.mode = "fused_recurrent"

for i in range(decode_steps):
pos = prefill_len + i
Expand Down Expand Up @@ -1160,9 +1158,7 @@ def test_vs_fla(
)

# ========== PHASE 3: Prefill again (decode→prefill transition) ==========
# FLA KDA correctly uses initial_state in chunk mode, so this should match
fla_kda.mode = "chunk"
apriel_kda.mode = "chunk"
fla_kda.mode = "fused_recurrent"

prefill2_start = prefill_len + decode_steps
prefill2_input = hidden_states[:, prefill2_start : prefill2_start + prefill2_len, :]
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ OPTIONAL =
# Huggingface tools
HUGGINGFACE =
transformers>=4.57.3,<5.0.0
accelerate>=1.4.0
hf-transfer>=0.1.9
datasets>=4.4.1
huggingface-hub>=0.36.0
Expand Down
Loading