quark-onnx-model-intake
Purpose
Validate the target .onnx model and extract the structural facts that an ONNX quant plan needs
to make correct quantization decisions. This step exists because different ONNX models have very
different quantization requirements — a CNN destined for AMD NPU CNN needs NHWC layout and PoF2
scales, an LLM exported to ONNX needs MatMulNBits or SmoothQuant + GPTQ, a >2 GB model needs
external-data handling, and a model that already contains QDQ nodes (or Quark's custom-op domains)
must not be silently re-quantized.
Inputs
- Model path — a single
.onnxfile, or a directory containingmodel.onnxplus its
model.onnx_data / external-weight blobs
env_context.jsonfor Python and accelerator constraints (CUDA major / ROCm major / NPU
presence)
workspace_context.jsonfor the validated model pathonnx_install_result.json(optional) — the installedonnxruntime*variant determines which
execution providers are realistic deployment targets
Outputs: model_analysis.json
Captures the model's graph metadata, op-type coverage, quantizable-op count, deployment-target
compatibility, and risks. Schema is shared with the Torch intake; ONNX-specific fields live under
model.onnx_specific and quantization_targets.onnx_specific.