quark-onnx-autosearch-pro
Purpose
Drive Quark ONNX AutoSearchPro (Optuna-driven) on a .onnx model to discover
the best quantization configuration — activation / weight specs, calibration
method, CLE, AdaRound / AdaQuant hyperparameters — without hand-tuning. The
recipe orchestrates intake, preset (or custom) search-space selection, reader
construction, generation of a standalone autosearch script in the user's
workspace, confirmed execution, and reporting of best_params.json plus
Optuna study artifacts. Unlike single-shot PTQ this produces many candidate
models, so preset and trial budget are explicit and the search is bounded.
Inputs
- Input
.onnxmodel (with optional sibling.onnx_data). - Calibration data: folder of representative samples or a Python
CalibrationDataReader class. Optional separate evaluation reader.
- User goal: preset choice (
ADVANCED_SEARCH/XINT8_SEARCH/
A8W8_SEARCH / A16W8_SEARCH / custom dict), deployment target, search
budget (n_trials, n_jobs, two_stage_search), and metric (built-in or
custom callable).
session_context.json(constraints.backend = "onnx"),env_context.json,
workspace_context.json, plus onnx_install_result.json and
quark_install_result.json. Optuna must be importable
(pip install optuna).
Outputs: run_manifest.yaml
Records the generated autosearch script path, the exact python3 invocation,
the preset name (or custom search-space hash), trial budget, Optuna study DB
path, and the final best_params.json location.
Side artifacts written by AutoSearchPro into output_dir:
auto_search.log, best_params.json, auto_search.db (resumable Optuna
study), quantized_model_<trial>.onnx per trial, and opt_history.html /
param_importance.html when plot_results=True.
Built in Step 4. Schema: