Tiny-model pipeline tests were dominated by fixed per-step costs, not
arithmetic: the pipeline's gc.collect() after each verify prompt rescans
every long-lived object the session imported (~0.2 s per call), and
intra-op thread fan-out makes each 16-dim forward slower on loaded runners.
- conftest: add an opt-in tiny_model_runtime fixture (one intra-op thread,
gc.freeze() of pre-test objects, both restored afterwards). Objects the
test creates remain collectable, so pipeline behaviour is unchanged.
Applied to test_offline_integration and the concept_* integration modules.
- test_disk_offloaded_fused_moe_surgery_matches_live_surgery: bound verify
free-form completions to 4 tokens; every diagnostic still runs through
the disk-offload hooks and no assertion depends on generated text.
- test_disk_offloaded_subprocess_rss_bound: measure native and legacy export
in one subprocess on the same offloaded model, resetting VmHWM (after GC
and malloc_trim) before each mode; native is measured first. Same three
assertions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With accelerate cpu_offload, tied parameters become separate meta
placeholders that hide their shared backing storage, so tie removal on
metadata kept lm_head.weight and the native export diverged from the
legacy checkpoint. Decline the native plan whenever a declared tie
(transformers' expanded tied-weight keys, or the embedding tie contract
as a fallback) involves a meta tensor, and document that partial offload
follows model order rather than the legacy resident-first gather order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan native Hugging Face export from state_dict metadata without
materializing offloaded weights, then stage, verify and promote one
safetensors shard at a time inside the existing atomic checkpoint
directory, checking cancellation and the host budget before each shard.
Unsupported models (quantized, PEFT, TP/FSDP, remote code, custom
state_dict hooks, shared meta aliases) keep the legacy full-gather path.
native_export_host_demand() reports the per-shard peak host demand so a
REBIRTH-boundary admission can consume it.
Closes#247
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>