[Core] DSpark brick 2: mtp.safetensors manifest + layout-check + fused loader

- SafetensorsArchive::open_file (single shard; mtp is not in the trunk index);
  header/bounds parsing refactored into load_shard shared with open().
- dspark.rs: expected_tensors() manifest (54 BF16 tensors, exact shapes),
  layout_check() CPU-only (missing/mismatched => drafter disabled, mirrors
  reference ink_dspark_layout_check), DsparkWeights::load() GPU resident
  (unpooled) with qkv [5120,2304] and gate_up [18432,2304] fused at load.
- Tests: CPU layout_check on the real file + wrong-shape rejection; GPU
  dspark_load_real_weights verifies fused/resident buffer sizes.
CPU -D warnings green; ld GPU 30/30; gw 15/15.
This commit is contained in:
adm committed 2026-12-02 20:08:11 +01:00
1 parent afce5cbbfe
commit 3a9533afd0
3 files changed
+372 -92

No files matched your search

+1 -1
View File
@@ -703,7 +703,7 @@ pub fn final_logits(cache: &WeightCache, cur: &DeviceBuf, blocks: &[DeviceBuf],
/// final residual stream + the accumulated depth-block snapshots. (Prelude /
/// single-pass; full-attn layers + loop controllers + bank rollback come next.)
pub fn forward_swa_layers(
cache: &WeightCache, schedule: &[usize], d: &Dims, token: i32, max_seq: usize, pos: i32,
cache: &WeightCache, schedule: &[usize], d: &Dims, token: i32, _max_seq: usize, pos: i32,
) -> Result<(DeviceBuf, Vec<DeviceBuf>), String> {
let cur = embed_token(cache, token, d.hidden, /*vocab*/ 201024)?;
let mut blocks: Vec<DeviceBuf> = Vec::new();