Repository navigation
[quantization] Add Gemma4 encoder_with_post vision export - #1151
Merged
Merged
Conversation
Keep patch embedding separate and export the complete encoder stack, pooler and full post-projection together with external mask and RoPE inputs. Reuse the prepared components and frozen quantization contracts, and emit a two-stage manifest with one artifact boundary. Preserve the existing vision layouts, spatial pooling policy, PLE export, compact KV-cache behavior and configuration defaults. Document the new artifacts, input/output contract and CLI override. Add checkpoint-free float and frozen INT16 eager, torch.export, Circle conversion/reference, boundary-qparam and observer-state tests, plus routing and manifest coverage. Validation on Samsung/TICO main 60342ce: - Export, encoder, config and pooler regressions: 37 tests passed - Vision routing regressions: 9 tests passed - Real encoder_with_post export suite: 4 tests passed - Changed Python files: UFMT, Pylint and mypy passed - git diff --check: passed The full Gemma4 selection was not rerun after rebase. Quantized Circle reference execution uses FAKE_QUANTIZE; full-size checkpoint and native NPU validation were not performed. TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com> Signed-off-by: seongwoo <mhs4670go@naver.com>
The tiny vision profile falls back to matrix pooling even when spatial pooling is requested. Add focused float and frozen INT16 tests using the registered default geometry and a small one-layer, one-head encoder. Reuse the existing vision owner with matching patch size and positional capacity while preserving its default tiny fixture. Require the selected spatial profile, active scalar INT16 observers and exact preservation of quantized pooling coefficients. Inspect the real composite Circle for AVERAGE_POOL_2D and compare final embeddings against the separately converted encoder, spatial pooler and full post-projection on the same reference runtime at rtol=atol=1e-5. Eager composite, split and monolithic outputs also agree exactly. Keep the existing tiny-profile tests and production code unchanged. Quantized reference execution uses FAKE_QUANTIZE; native integer and NPU execution are not covered. Validation: - Focused float and INT16 spatial-composite tests: 2 passed - Composite, encoder and spatial-pooler regressions: 17 passed, no skips - UFMT, Pylint and mypy on both changed files: passed - git diff --check: passed TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com> Signed-off-by: seongwoo <mhs4670go@naver.com>
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.
Keep patch embedding separate and export the complete encoder stack, pooler and full post-projection together with external mask and RoPE inputs. Reuse the prepared components and frozen quantization contracts, and emit a two-stage manifest with one artifact boundary.
Preserve the existing vision layouts, spatial pooling policy, PLE export, compact KV-cache behavior and configuration defaults. Document the new artifacts, input/output contract and CLI override.
Add checkpoint-free float and frozen INT16 eager, torch.export, Circle conversion/reference, boundary-qparam and observer-state tests, plus routing and manifest coverage.
Validation on Samsung/TICO main 60342ce:
The full Gemma4 selection was not rerun after rebase. Quantized Circle reference execution uses FAKE_QUANTIZE; full-size checkpoint and native NPU validation were not performed.
TICO-DCO-1.0-Signed-off-by: seongwoo mhs4670go@naver.com