Speed program: split the profile kernel test under the 30-line limit; limits baseline lowered

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-08 14:34:16 +01:00
co-authored by Claude Sonnet 5.5
parent de51a07f91
commit 04287257f2
2 changed files with 20 additions and 16 deletions
@@ -163,17 +163,6 @@ fn only_the_server_profile_enables_the_mtp_draft_attention_switch() {
.engine_env .engine_env
.contains_key("LELEKA_SM120_ATTN_DAILY_MTP") .contains_key("LELEKA_SM120_ATTN_DAILY_MTP")
); );
// lever 1 of the speed program: the main attention and the gate/up SwiGLU kernels of the same card, bitwise
// identical on the teacher-forced gate (docs/experiments/codex-compare-speed-gap.md), decode +1.85 % paired
for name in ["rtx5090-32g", "rtx5090-32g-file", "rtx5090-32g-gguf-ple"] {
let profile = Profile::builtin(name).unwrap();
for key in ["LELEKA_SM120_ATTN_DAILY", "LELEKA_SM120_GU_SWIGLU"] {
assert_eq!(profile.engine_env.get(key).map(String::as_str), Some("1"), "{name} {key}");
}
}
for key in ["LELEKA_SM120_ATTN_DAILY", "LELEKA_SM120_GU_SWIGLU"] {
assert!(!laptop.engine_env.contains_key(key), "{key}");
}
// the key space of engine_env still refuses everything else // the key space of engine_env still refuses everything else
let mut bad = server.clone(); let mut bad = server.clone();
bad.engine_env.insert("LELEKA_SM86_X".into(), "1".into()); bad.engine_env.insert("LELEKA_SM86_X".into(), "1".into());
@@ -184,6 +173,25 @@ fn only_the_server_profile_enables_the_mtp_draft_attention_switch() {
ok.validate().unwrap(); ok.validate().unwrap();
} }
#[test]
fn only_the_5090_profiles_enable_the_sm120_main_attention_and_swiglu_kernels() {
// lever 1 of the speed program: the main attention and the gate/up SwiGLU kernels of the same card, bitwise
// identical on the teacher-forced gate (docs/experiments/codex-compare-speed-gap.md), decode +1.85 % paired
let laptop = Profile::builtin("rtx3080-16g").unwrap();
for name in ["rtx5090-32g", "rtx5090-32g-file", "rtx5090-32g-gguf-ple"] {
let profile = Profile::builtin(name).unwrap();
for key in SM120_MAIN_KERNEL_KEYS {
assert_eq!(profile.engine_env.get(key).map(String::as_str), Some("1"), "{name} {key}");
}
}
for key in SM120_MAIN_KERNEL_KEYS {
assert!(!laptop.engine_env.contains_key(key), "{key}");
}
}
/// Engine switches of the compute capability 12 kernels that replace the main attention and the gate/up SwiGLU.
const SM120_MAIN_KERNEL_KEYS: [&str; 2] = ["LELEKA_SM120_ATTN_DAILY", "LELEKA_SM120_GU_SWIGLU"];
#[test] #[test]
fn validation_rejects_unsafe_values() { fn validation_rejects_unsafe_values() {
let mut profile = Profile::builtin("rtx5090-32g").unwrap(); let mut profile = Profile::builtin("rtx5090-32g").unwrap();
+1 -5
View File
@@ -13,10 +13,6 @@
"params": 1 "params": 1
} }
}, },
"test": { "test": {}
"leleka-deploy": {
"fn_lines": 1
}
}
} }
} }