Repository navigation
feat(core)!: count the served model's numerics in the inference identity - #259
Merged
Merged
Conversation
The inference identity now keeps `numerics`: the effective dtype, runtime quantization, kv_cache_dtype and model overrides (json_model_override_args / hf_overrides) the served model computes with. They sit beside the digest as values, so a key unknown on either side (an endpoint that does not state it) is no difference, while a known one that differs refuses a resume. Every other engine parameter stays serving. - NUMERICS_PARAMS is the one list of which engine params count. - Unset values resolve to the effective ones: dtype to the checkpoint's torch_dtype, quantization to its quant_method, kv_cache_dtype to auto; aliases (bf16, fp8) are normalized. - Endpoints state numerics under the root model's serving.numerics. - IDENTITY_SCHEMA 4 -> 5. A schema-4 directory's numerics are read from the plan of its latest run in runs[].serving, resolved against this run's checkpoint, so recorded results keep resuming. Closes #258 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runtime `quantization: fp8` on a bf16 checkpoint resumed into the bf16 run: an unquantized checkpoint left `quantization` unknown, and an unknown key never differs. A readable checkpoint now records `None`; only an unreadable one stays unknown. - `dtype: auto` on a float32 checkpoint is unknown: engines downcast it. - A schema-4 directory whose latest own run recorded no serving has unknown numerics, instead of falling back to an older run's plan. - Trim the numerics docs and docstrings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
Summary
inferenceidentity now recordsnumerics, the values the served model computes with: effectivedtype, runtimequantization,kv_cache_dtype, and model overrides (json_model_override_args/hf_overrides). A resume refuses when one of these differs. tp/dp/ep/pp, replicas, disaggregation, memory fraction, chunked prefill, CUDA graph, scheduler and ports stay inruns[].servingand are never compared.weightsserved in fp8, at anotherdtypeor withkv_cache_dtype: fp8_e5m2gives different logits. Until now such a run resumed into a bf16 run of the same checkpoint and compared equal to it.sieval.core.tasks.run_meta.NUMERICS_PARAMSmaps eachnumericskey to the engine params that set it.numerics_key(param)tells an orchestrator whether one of its overrides changes the identity.autodtyperesolves to the checkpoint'storch_dtype(unknown for float32, which engines downcast by version), an unsetquantizationto itsquantization_config.quant_method(Nonefor a readable unquantized checkpoint, so runtimequantization: fp8on a bf16 checkpoint is a change; unknown only whenconfig.jsonis unreadable), and an unsetkv_cache_dtypetoauto. Aliases (bf16,half,fp8for KV) are normalized, and override JSON is compared as an object. Stating a default is therefore no change. The checkpoint is read in the infer layer (checkpoint_numerics) and passed down as plain data, socore/stays free of upper-layer imports.api_basemodel, the root model may stateserving.numerics(validated against the same keys). A key it does not state is unknown. Numerics are stored next to the digest rather than inside it, and a key unknown on either side never counts as a mismatch.IDENTITY_SCHEMAgoes from 4 to 5. A schema-4 directory's numerics are read from the plan of its latest own run inruns[].serving, with unset values resolved against this run's checkpoint. A recorded bf16 run therefore resumes against a new bf16 run and refuses an fp16 one. Schema-4 endpoint runs have no plan, and a latest own run that recorded no serving is not backfilled from an older run, so in both cases the numerics are unknown and never block. Schemas 1–3 still compare the whole recipe, as before.the served model's numerics: kv_cache_dtype: 'auto' -> 'fp8_e5m2'.Breaking / migration:
RESULT_SCHEMA_VERSIONbump: the change is additive, and older directories still read and resume.Related Issues
Closes #258. Refs #232, #252.
Test Plan
Automated
ruff check && ruff format --check, pre-commit hooks pass)ty check --python <venv>, which coverstests/too): All checks passedpytest tests/unit tests/integration -n 16 -m "not stress"→ 10091 passed, 1 skippedscripts/sync_package_stubs.py --checkcleanNew tests:
test_run_meta.py: which params count, effective defaults and aliases, checkpoint-derived quantization (an unquantized checkpoint isNone, not unknown), float32 underautois unknown, unknown keys, override JSON, roles that disagree, endpoint-stated numerics, reading a schema-4 directory's numerics from its plan (skipping another model's run; unknown when the latest own run recorded no serving), andread_identityon schema 4.test_runner_run_meta.py(end to end throughTaskRunner): anotherkv_cache_dtyperefuses and leavesmeta.jsonunchanged; runtimequantization: fp8on an unquantized checkpoint refuses; a stated default plus another tp resumes; a schema-4 directory resumes on matching effective values and refuses fp16; an endpoint that states nothing resumes; an endpoint stating another dtype or quantization refuses.test_stage_resume.py:plan_resume/ dry-run verdicts.test_introspect.py,test_validation.py,test_session.py: the checkpoint reader,serving.numericsvalidation, and session wiring.Checklist
Required (all PRs)
type(scope): description)AI-Generated Code - <model> (<provider>)in module docstring (existing modules, already marked)core/If: Breaking Change
🤖 Generated with Claude Code