feat: DeepSeek V4 Flash 0731 added

This commit is contained in:
Georg Bauer
2026-08-01 08:40:06 +02:00
parent 4175706533
commit d1c380f79d
7 changed files with 85 additions and 21 deletions

View File

@@ -1985,7 +1985,7 @@ impl SsdPlan {
let mut by_layer = vec![Vec::<(i32, u32)>::new(); model.shape.layers as usize];
let mut loaded = 0_u32;
let hotlist = match model.shape.model {
ModelChoice::DeepSeekV4Flash => hotlist::FLASH,
ModelChoice::DeepSeekV4Flash | ModelChoice::DeepSeekV4Flash0731 => hotlist::FLASH,
ModelChoice::DeepSeekV4Pro => hotlist::PRO,
ModelChoice::Glm52 => unreachable!("GLM uses its dedicated executor"),
};
@@ -3437,12 +3437,14 @@ impl DeepSeekExecutor {
if self.session.position == 0 && self.ssd.is_some() {
unsafe { ds4_gpu_stream_expert_cache_reset_route_hotness() };
}
let streaming_decode_cap = if self.model.shape.model == ModelChoice::DeepSeekV4Flash
&& self.weights.layers.first().is_some_and(|layer| {
layer.expert_gate.kind == Q4_K
&& layer.expert_up.kind == Q4_K
&& layer.expert_down.kind == Q4_K
}) {
let streaming_decode_cap = if matches!(
self.model.shape.model,
ModelChoice::DeepSeekV4Flash | ModelChoice::DeepSeekV4Flash0731
) && self.weights.layers.first().is_some_and(|layer| {
layer.expert_gate.kind == Q4_K
&& layer.expert_up.kind == Q4_K
&& layer.expert_down.kind == Q4_K
}) {
64
} else {
18
@@ -6469,16 +6471,23 @@ fn update_compressor_stage(
fn compression_ratio(shape: super::Shape, layer: u32) -> u32 {
match shape.model {
crate::model::ModelChoice::DeepSeekV4Flash if layer < 2 => 0,
crate::model::ModelChoice::DeepSeekV4Flash
| crate::model::ModelChoice::DeepSeekV4Flash0731
if layer < 2 =>
{
0
}
crate::model::ModelChoice::DeepSeekV4Pro if layer < 2 => 128,
crate::model::ModelChoice::DeepSeekV4Flash | crate::model::ModelChoice::DeepSeekV4Pro
crate::model::ModelChoice::DeepSeekV4Flash
| crate::model::ModelChoice::DeepSeekV4Flash0731
| crate::model::ModelChoice::DeepSeekV4Pro
if layer.is_multiple_of(2) =>
{
4
}
crate::model::ModelChoice::DeepSeekV4Flash | crate::model::ModelChoice::DeepSeekV4Pro => {
128
}
crate::model::ModelChoice::DeepSeekV4Flash
| crate::model::ModelChoice::DeepSeekV4Flash0731
| crate::model::ModelChoice::DeepSeekV4Pro => 128,
crate::model::ModelChoice::Glm52 => 0,
}
}