Skip to content

[quantization] Preserve explicit CPU embedding domains - #1108

Merged
mhs4670go merged 11 commits into
Samsung:mainfrom
mhs4670go:cpu-explicit-embedding
Nov 6, 2026
Merged

mhs4670go merged 11 commits into
Samsung:mainfrom
mhs4670go:cpu-explicit-embedding

Conversation

@mhs4670go

Copy link
Copy Markdown
Contributor

Keep row-wise UINT8 embedding DQ/GATHER/Q and scaled activation boundaries
explicit in Circle. Prepare selected-row reference CPU plans without restoring
the full table, preserving shared integer weights and the output contract.

Add native round-trip, arithmetic, memory, sharing and regression coverage,
plus a reproducible CPU benchmark and documentation of runtime limitations.

TICO-DCO-1.0-Signed-off-by: seongwoo mhs4670go@naver.com

Keep row-wise UINT8 embedding DQ/GATHER/Q and scaled activation boundaries
explicit in Circle. Prepare selected-row reference CPU plans without restoring
the full table, preserving shared integer weights and the output contract.

Add native round-trip, arithmetic, memory, sharing and regression coverage,
plus a reproducible CPU benchmark and documentation of runtime limitations.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
Record the successful full CPU suite at implementation commit 934c059:
4,849 tests run, 4,691 passed, 158 skipped and exit code 0.
Replace the prior incomplete-validation statement while retaining the history
of interrupted attempts and the existing target-runtime limitations.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
…ard propagation

Keep the calibrated arguments and metadata of an explicitly preserved CPU
embedding Quantize. Let downstream Concat legalization insert a separate
conversion rather than erase the original rounding boundary by retargeting it.
Cover direct and layout paths with native Circle file round trips and retain
unprotected private-quantizer retargeting.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
…nge clamps

Finish reduced-range clamp insertion before classifying DQ consumers. Include
new and previously owned range clamps in the CPU island so traversal order and
repeat execution cannot remove the DQ feeding a float clamp.

Test the real export, legalization, Circle file round trip and native execution
for consecutive boundaries, saturation, unclipped values and MUL. Exercise an
adverse iteration order without replacing production passes or kernels.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
Normalize reduced-range test imports and record the current full CPU run:
4,858 tests, 4,700 passed, 158 skipped, no failures/errors and exit code 0.
Keep the pre-fix counterexamples and production-runtime limitations explicit.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
Replace implementation history and experiment reports with the rationale for
explicit Circle conversions, selected-row execution and preserved numerical
boundaries. Describe storage/ABI invariants and supported runtime contracts,
and update the referring documentation labels.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
Keep explicit Q/DQ boundaries through float insertion layouts and independent
constant square transforms. Respect float tensors during qparam propagation,
and add explicit conversions when those tensors enter integer concat domains.
Reject unsupported mixed side branches and keep shared-table projections under
the existing FC policy.

Add real tiny Llama and Qwen3-VL export/file-reload/native integration tests,
including nonidentity SpinQuant rotation, multimodal insertion, frozen-grid
oracles, selected-row allocation checks and explicit decoder stage handoffs.
Generalize the CPU embedding design documentation and its support matrix.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
Replay layout-only paths on the original activation codes for ordinary
quantized FC input edges, keeping shared float consumers and the FC's weight
and output domains intact. Require existing weight/output quantization so
genuine float projections retain their native float contract.

Complete shared float side-input layout closure before protecting terminal
quantizers, preventing their Q/DQ boundaries from folding into float layouts.
Add real Circle save/reload, native/fake arithmetic, shared-consumer, range,
creation-order and pass-lifecycle regressions, and document the boundaries.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
Recognize per-tensor output quantization through reshape and permute before
restoring an ordinary quantized FC's input layouts on the original A codes.
Follow only layout data edges and retain the existing weight-domain gate;
stop at arithmetic, concat, DQ and unsupported output layouts.

Extend real Circle file round-trip coverage with a nonidentity output
permute, layout chains, shared float consumers, native input-code extraction,
reduced-range clipping and independent fake-quant arithmetic. Document the
supported output-contract search without changing pass order or input grids.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
Add preserve_embedding_quantization=False to CompileConfigV1 and select the
existing preservation pass only for an explicit True, before quant folding.
Forward the compile policy through recipe exporters and the export CLI.

Cover legacy and opt-in serialized contracts across public conversion APIs,
YAML and real recipe exports; retain explicit embedding numerical regressions.
Document the opt-in policy and its separation from runtime execution settings.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
@mhs4670go
mhs4670go force-pushed the cpu-explicit-embedding branch from 9f2e595 to b6c3c1d Compare November 5, 2026 08:01
Document the embedding Quantize retarget exception in the system design.
Separate the canonical lookup graph from optional scaled post-processing,
and distinguish stage-conversion semantics from the DQ/Q test implementation.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
@mhs4670go
mhs4670go marked this pull request as ready for review November 6, 2026 02:46
@mhs4670go
mhs4670go merged commit 55f76b6 into Samsung:main Nov 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant