| name | quark-onnx-autosearch-pro |
| description | L3 recipe that runs `quark.onnx.AutoSearchPro` end-to-end on a user `.onnx` model: intake → preset selection (or custom search space) → calibration / eval data reader → standalone autosearch script generation → confirmed execution → best_params reporting. Wraps the Optuna-driven hyperparameter search exposed in `quark/onnx/quantization/auto_search/auto_search_pro.py`. Use when the user wants to "auto search", "tune quantization", "find best quant config", "sweep AdaRound/AdaQuant", "two-stage search", or pick `ADVANCED_SEARCH` / `XINT8_SEARCH` / `A8W8_SEARCH` / `A16W8_SEARCH` for an ONNX model. Not for single-shot PTQ (use `quark-onnx-ptq`). Not for safetensors models (use `quark-torch-ptq`).
|
| layer | l3-recipes |
| backend | onnx |
| primary_artifact | run_manifest.yaml |
| source_knowledge | ["quark/onnx/quantization/auto_search/auto_search_pro.py","quark/onnx/quantization/auto_search/qconfig_mapping.py","quark/onnx/quantization/auto_search/config_generator.py","quark/onnx/quantization/auto_search/utils.py","examples/onnx/auto_search/auto_search_pro_model.py","docs/source/onnx/user_guide_auto_search_pro.rst","tutorials/onnx/auto_search/onnx_auto_search_tutorial.ipynb","tutorials/onnx/ryzen_ai/auto_search_for_ryzen_ai/auto_search_yolov8/onnx_ryzen_ai_auto_search_yolov8_tutorial.ipynb"] |
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
.onnx model (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: