Repository navigation
Conversation
|
Reviewed head I checked the nine-document proposal for consistency around serial versus concurrent component execution, source/candidate provenance, downstream calibration routing and exact role overrides, scoped writes/defaults, physical resource accounting, continuation/publication, and save/evaluation separation. The DeepSeek example preserves vision-first order, explicit decoded FP4 source lineage, and global expert selection before placement. Independent document checks passed: all 41 Python examples and 4 YAML examples parse; all 116 relative links resolve; all 90 reference-link uses have definitions; This is a review of the proposed contracts, not runtime qualification or approval to implement them. No quantization, accelerator, concurrency, or performance tests were run; external architecture citations were not comprehensively re-audited. |
|
Reviewed head One low-priority consistency finding:
No other actionable correctness findings identified in this pass. I checked the ten-document proposal's ordering, overrides, data roles/routing, source lineage, ownership, physical resource accounting, continuation/publication, and save/evaluation contracts. Independent document checks passed: all 46 Python examples, four YAML examples, and the JSON example parse; all 128 relative links/anchors resolve; all 90 reference-link uses have definitions; This reviews proposed contracts, not runtime qualification. No quantization, accelerator, concurrency, or performance tests were run. Mermaid rendering/parsing and the external architecture citations were not independently revalidated in this pass. |
# Conflicts: # README.md
|
Merge conflict resolved — merged Only
Diff against |
Summary
GPT-QModel's flat quantization config overloads bits, group size and format across increasingly different methods. Its global lifecycle also cannot express independently selected sub-models with different quantization programs, data roles, source histories and hardware placement. This proposal combines typed method/weight/scale-solver configs with the existing component composer and method-owned lifecycles, retaining explicit numerical dependencies, serial/concurrent composition and bounded execution.
Planning only, revision 0.14. Keep this PR in draft for iterative discussion. No runtime implementation or quantization experiments are included. Backward compatibility is explicitly discouraged.
Related to #2928; this proposal does not resolve that issue.
What Changed
BaseQuantizeConfig, shallow concrete method configs, typed weight partitions/formats, and optionalScaledWeight.scale_solver. Numeric width, scale groups, storage blocks, vectors, codec geometry and solver tiles have separate meanings.Quantize,Language,Vision,QDataSet, scopedRules, existing placement andModelArtifact. There is one compiler and override model.method,type,formatandConfignaming consistently.Parallel, calibration lineage, and independent evaluation after saving.Authoring model
Quantize(a, b)is serial in argument order. In this example language completes before vision:textDataandvisionDataare caller-providedQDataSetobjects. Bindingmodel=permits.Run(); an unbound job can use.Run(model).Usedispatches datasets, explicitDataBindings, and registered recipe extensions without exposing lifecycle stages.Concurrent component quantization requires an explicit group:
Parallel(...)requests an admitted concurrent schedule and joins all branch results. Unsupported methods, producer dependencies, write conflicts, or resources that permit only wholly serial execution cause a concrete error. The compiler does not silently reorder or serialize the whole group, switch teacher/context policies, or refit another component.DataParalleldistributes samples within the applicable lifecycle;TensorParallelpartitions a logical model computation. Neither makes components concurrent. Device lists infer worker counts; optionalLocal(...)contexts carry budgets, custom maps, and NUMA policies. Advanced combined layouts retain explicit data/tensor axes. The method resolves its own execution profile; common authoring needs no stage IDs, repeated counts, or enforcement flags.Typed recipe configuration
For symmetric GPTQ INT4, groups of 128, natural column order and weight-MSE scale search:
These signatures are proposed.
LpScaleSolverConfigis a new design name for weight-error scale search, not an existing class; the audited implementation usesMSEConfig(norm=2.0).MinMaxScaleSolverConfig()disables clipping search while retaining scales. Natural order leaves GPTQ's calibration-derived Hessian error feedback active. Output-MSE is a separate potential capability requiring an implementation.Concrete configs own
weights, optionalactivationsand method procedure. Data, targets and devices retain their existing composer/action owners.ExportConfigdeclares layout/container constraints before fitting;weights.formatis the sole numerical representation selector. The final manifest containsQuantizedModelSpec/EncodedModuleSpecwith realized scales, group assignments, codebooks and auxiliary payloads; loaders do not rerun recipe solvers.Defaults, data, and numerical semantics
Defaults belong to the composed action. Resolution is method defaults → composer defaults → component defaults → composer MoE settings → component MoE settings, with explicit nested scope inheritance. Omitted fields inherit; an execution configuration replaces its mode and device pool atomically. MoE overrides apply to mapped routed-expert work without expanding selected writes. Shared experts, dense vision, and draft owners retain their own contracts.
MoERouting.nativeis the default. Explicitbypasssupplies the declared calibration stream to selected experts without normal top-k filtering for coverage. This changes observation provenance and requires method/adapter support. Data-parallel bypass merges each expert's contributions through the proper reducer; assigning different experts to different GPUs is separate task/expert placement. Bypass cannot widen a last-ten write query, reuse native routed statistics, or persist in normal saved inference. Temporary state is restored on failure/cancellation as well as success.Component data attachment does not isolate modality pipelines. Compatible calibration routes reach downstream consumers, so language observes image-conditioned inputs alongside its text corpus. Named role bindings intentionally replace inference for those roles; training, validation, selection, and adapter sources are not copied into arbitrary roles. Final evaluation data stays outside quantization.
Serial order preserves each method's source/candidate/teacher policy. A supported local text-first fit can use the existing vision revision, then report its calibration context changed after vision is updated. A policy requiring newly quantized vision before language instead rejects that order.
Parallelcannot silently choose an independent frozen-source experiment to avoid a dependency. Explicit refinement remains a separate declared policy.Targets default to
Target.AUTO.Language,Vision, and registered scopes use versioned model mappings; names and dataset types cannot widen selected writes.DynamicModuleTargeting().experts(type="routed").last(10, per="moe_layer", order_by="expert_id")resolves global IDs before sharding. Packed selections require an explicit source descriptor and are recorded as requantization; decoded released values are never mislabeled original dense weights.Documents
35987dfb, typed partitions/formats/scale solvers, GPTQ INT4 example, canonical schema, recipe/result/artifact separation, alternatives and 16 acceptance cases. This supplements the older lifecycle audit, including NF12 and load-only TT contracts.Quantize, scopedLanguage/Visionrecipes, typedUse, serial argument order, explicitParallel,Default/MoEprecedence, model binding, andRun.METHODentries and ten concrete configurations at536b7f9b, including native/data-free paths, GSQ, GPTAQ/FOEM, EoRA, auxiliary operations, and MLX.QDataSet, automatic routes and downstream consumers, lifecycle roles, preparation, streaming, splits, and committed cursor provenance. Audit at6d90aa19includes 32 preparation overrides.DeepSeek acceptance target
The pinned
deepseek-ai/DeepSeek-V4.1-Flash-1017mock now usesQuantize(Vision(...), Language(...)), preserving vision-first serial order. Its main language query selects expert IDs 374–383 in each of 40 layers: 400 groups and 1,200 logical gate/up/down projections. The explicit fitting source remains bounded decoding of released FP4 values.Component defaults retain the requested hardware maps: vision on GPU 0; dense language groups by layer on GPUs 0/1; full routed forward banks by expert ID on GPUs 2/3; selected fits distributed five per GPU per layer; Engram table backing and lookup workers assigned independently to NUMA nodes/cores. These are conditional adapter/backend acceptance targets, not evidence of current support or a claim that four unspecified GPUs suffice. The mock retains native routing; a bypass variant is a distinct numerical experiment.
All scopes share one physical resource ledger. Live outputs retain storage reservations after worker completion; transfers reserve destinations before releasing sources. Hard maps, aliases, coupled numerical groups, and CPU allocation requirements remain constraints after defaults resolve.
Saving and independent evaluation
Compilation resolves metadata without consuming data or executing the model. Quantization requires no final evaluation suite. Successful saving returns a pinned
ModelArtifact; optional evaluation then loads the committed representation with fresh state and independent resources:Evaluation reports are separate artifacts. Failure/retry cannot alter quantization/save success or trigger fitting. Intrinsic optimization validation and selection remain inside their method programs.
Tests
git diff --check origin/main...HEAD bash format/check.sh # ruff 0.14.2: All checks passed!Unit tests are not applicable to this documentation-only design proposal. No runtime conformance tests, quantization-quality experiments or performance benchmarks accompany it. Syntax and contract checks do not establish executable support.
Review Requirements
docs/location.Kernel Accuracy Requirements
Not applicable: no quantization math, packer, or inference kernel changes.
Open Decisions
Before implementation, agree on initial method/architecture/backend profiles, admission of concurrent component groups, enforcement of NUMA placement, bypass semantics for coupled methods, continuation guarantees, and budgeted quality/cost experiments. The decision register also tracks scope defaults, data conveniences, recipe extension compatibility, independent evaluation conventions, native scale-policy admission, per-format decode/payload schemas, and the initial typed-config defaults/capability matrix.
Link to Devin session: https://app.devin.ai/sessions/82f18f3ae8544e468f280b6aa44fe583
Open in Devin Desktop: https://app.devin.ai/desktop/session/82f18f3ae8544e468f280b6aa44fe583?variant=devin
Requested by: @Qubitium