Validation Pipeline
Validation Checks
NaN/Inf Scan
Iterate over every parameter in the merged state_dict. Detect NaN or Inf values. This is a hard fail: any NaN or Inf produces FAIL immediately.Dtype Invariants
Verify that every parameter has the dtype declared in the merge config. Mixed dtypes are permitted only if the strategy explicitly declares them.Norm Envelopes
Compare the L2 norm of each merged layer to the L2 norms of the source models. Flag outliers.
Margin is configurable, default 20%.
Layer-wise Sanity
Verify that layer shapes match the expected architecture. Check that attention Q/K/V/O projections, MLP up/gate/down projections, and layernorm parameters all have the expected dimensions.Tokenizer Round-trip
Encode and decode a fixed set of test strings. Verify that the output matches the input.Small-batch Forward Pass
Run a small batch of synthetic input IDs through the merged model. Verify that the forward pass completes and produces finite logits.Outcome Definitions
Cross-Links
- Merge Engine for the pipeline that feeds into validation.
- Merge Strategies for what strategies produce candidates.
- Tensor Operations for the ops that may introduce instability.
- Numerical Testing for extended numerical validation.