preflight

Function preflight 

Source
pub fn preflight(
    store: &WeightStore,
    config: &ModelConfig,
    use_speculative: bool,
    kv_cache_dtype: Option<&str>,
) -> Result<()>
Expand description

Run all model-agnostic + model-type-specific pre-flight checks.

Called by spark-server/src/main.rs immediately after the WeightStore is populated and before spark_comm::NcclBackend::new runs, so a bad checkpoint aborts rank 0 before rank 1 even connects.

use_speculative is the final resolved flag (user --speculative OR model default). It gates MiniMax-specific MTP-presence diagnostics: if the user didn’t ask for speculative decoding, MTP tensors in the checkpoint are harmless dead weight and do not warrant a bail.