Repository navigation
[SKEEP-008]: Precision and encoding conversion #1433
Copy link
Copy link
Open
Labels
skeepSKEEP proposal tracking issue (durable design record)SKEEP proposal tracking issue (durable design record)trackingParent/tracking issue with sub-issuesParent/tracking issue with sub-issues
Description
Proposal document: docs/modules/skeep/pages/008-precision-and-encoding-conversion.adoc (#1434)
Status: Draft
Branch: feature/skeep-008-precision-and-encoding-conversion
Trigger
Public Kotlin API (NeuralNetworkDsl members, TensorStorage) · DSL syntax/semantics (what a layer's dtype means, where a cast happens) · compatibility/migration policy (removing members that always threw, rules for precision loss).
Summary
Two public entry points promise to change a tensor's numeric form and do not work:
- Mixed precision in the DSL.
dense<TLayer>(…)×2 andstage<TStage>(…)areTODO()in bothNeuralNetworkDslImplandStageImpl. That's the six stubs allowlisted inconfig/stub-allowlist.txt. They can't be implemented as declared, because a type parameter on an interface method can't bereified, so the implementation never gets the layer'sKClass. - Encoding change after load.
TensorStorage.repackTothrows for every encoding change.
The proposal:
- takes the dtype as a value (
dense(64, dtype = FP16),stage("head", dtype = BF16)) behind onePrecisionBoundarymodule, using the existingTensorOps.convert, which is traced and lowers tostablehlo.convert; - keeps
repackTolossless and adds an explicit, lossyrequantizeToon top of the existingRequantizersregistry, so it accepts the same encodings as loader quantize-at-load; - retires the unused
MixedPrecisionModule/InternalMixedPrecisionModule/MixedPrecisionTensorOpsscaffold.
Related DARC features
- [Feature]: Close the remaining NotImplemented stubs outside the operator surface #1414 (remaining non-op stubs umbrella). The mixed-precision stubs were deliberately not filed there and wait on this proposal.
- [Feature]: TransposedConv2d — convTranspose2d op, CPU kernel, backward and StableHLO lowering #1371 / [Feature]: GroupNormalization forward pass (groupNorm {} DSL currently crashes) #1379 (layer gaps found by the same inventory).
Sub-issues
Filed once the proposal is Accepted, one per rollout phase:
- B1 lossless
repackTo+requantizeTo - A1 DSL
PrecisionBoundary, inference only - A2 export test (
stablehlo.convertat boundaries) - A3
convertbecomes@Diff - A4 removal of the deprecated overloads and scaffold
Status upkeep
- Proposal registered in
docs/modules/skeep/nav.adocand the "Current Proposals" table - Maintainer moved status to
Accepted - Implementation PR(s) linked here and flipped the proposal's
Status:toImplemented
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
skeepSKEEP proposal tracking issue (durable design record)SKEEP proposal tracking issue (durable design record)trackingParent/tracking issue with sub-issuesParent/tracking issue with sub-issues
Activity