Dev4: ONNX export pipeline for Option A deployment - #32
Merged
sp25-bai-047-wq merged 1 commit intoAug 12, 2026
Merged
Conversation
|
@sp25-bai-047-wq is attempting to deploy a commit to the seno-quantum-coder's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Implements the ONNX export path (Option A) for solving the Vercel serverless size limit (~250MB) that currently prevents the neural model from running in production.
What's included
inference/grammar.py— torch-free grammar/vocab helpers (is_valid_prefix, NodeValidityPool, vocab loading), split out of beam_search.py so the ONNX deployment path never needs to import torch.inference/beam_search.py— updated to import grammar helpers from the new grammar.py (no logic changes).deployment/export_onnx.py— exports the trained SimpleCalculusModel checkpoint (model/simple_transformer.py) to ONNX format.deployment/onnx_beam_search.py— numpy/onnxruntime-only mirror of inference/beam_search.py's beam search.deployment/onnx_solve.py— torch-free mirror of inference/solve.py's solve() interface, for use in production.deployment/verify_export.py— runs eval/benchmarks/*.json through both the PyTorch and ONNX paths, checks exact-match output parity, measures real deployment bundle size against Vercel's 250MB limit, and writes docs/EXPORT_DECISION.md from the actual measured results.requirements-onnx.txt— lightweight production dependencies (onnxruntime + numpy), deliberately excludes torch.api/_shared.py— added a new priority step in get_solver(): local ONNX model is now tried before the heavier local torch load, falling back to Groq/FallbackSolver as before if unavailable.Status
Export and verification scripts are ready and tested against the current architecture (model/simple_transformer.py's SimpleCalculusModel). Final numbers in docs/EXPORT_DECISION.md should be regenerated once run against the latest signed-off checkpoint from Developer 3, per the re-validation rule in the task assignment doc.
Testing