Add GLM 5.2 Metal execution

This commit is contained in:
Georg Bauer
2026-07-26 12:16:30 +02:00
parent 1de954b579
commit 65c9cbfc45
6 changed files with 1819 additions and 20 deletions

View File

@@ -372,21 +372,27 @@ pub(crate) struct CompactionOutput {
#[cfg(target_os = "macos")]
impl Generator {
pub(crate) fn open(settings: &EngineSettings, metrics: Arc<Metrics>) -> Result<Self, String> {
if settings.model == ModelChoice::Glm52 {
return Err("GLM 5.2 generation is not initialized by the DeepSeek executor".into());
if settings.speculative.glm_mtp {
return Err(
"GLM MTP requires the shared speculative verifier, which is not enabled".into(),
);
}
if settings.speculative.dspark || settings.ssd.enabled || settings.steering.file.is_some() {
if settings.speculative.dspark
|| (settings.ssd.enabled && settings.model != ModelChoice::Glm52)
|| settings.steering.file.is_some()
{
return Err(
"DSpark, SSD streaming, and steering are not yet available in the Rust executor"
.into(),
);
}
let model = Model::open(settings)?;
let executor = metal::Executor::open(
let executor = metal::Executor::open_configured(
model,
settings.context_tokens.max(1) as u32,
settings.execution.quality,
settings.execution.prefill_chunk,
settings.ssd,
)?;
Ok(Self {
executor,