getitune-optimizing-a-model
Original:🇺🇸 English
Translated
Optimize an exported getitune model (the Geti training library) with post-training quantization. Use when a user wants to run `OVEngine.optimize()` / `engine.optimize()` to produce an INT8 model via NNCF, understands calibration-set requirements, or needs to re-validate and run inference with a quantized model versus the original FP32/FP16 model. Covers OpenVINO NNCF post-training quantization and the accuracy/size trade-off.
5installs
Sourceopen-edge-platform/geti
Added on
NPX Install
npx skill4agent add open-edge-platform/geti getitune-optimizing-a-modelTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Optimizing (quantizing) a model with getitune
getitune.xmlRun everything from .
library/Workflow
python
from getitune.engine import create_engine
# Load an exported OpenVINO model, then quantize it
ov_engine = create_engine(
model="/path/to/exported_model.xml",
data="/path/to/dataset",
)
ov_engine.optimize() # INT8 post-training quantization via NNCF
int8_metrics = ov_engine.test() # validate the quantized model
predictions = ov_engine.predict() # run inference with the quantized model- Start from an exported OpenVINO model (). If you only have a checkpoint, export it first with the
.xmlskill.getitune-exporting-a-model- Done when: builds an
create_engine(model="....xml", data=...).OVEngine
- Done when:
- Provide a calibration dataset. Calibration images are taken automatically
from the training subset; 200-500 images is the recommended calibration size.
- Done when: runs without a "not enough calibration data" issue.
optimize()
- Done when:
- Run . This replaces the engine's model in place with the INT8 version.
optimize()- Done when: the call completes and subsequent /
test()use INT8.predict()
- Done when: the call completes and subsequent
- Re-validate accuracy with and compare against the FP32/FP16 baseline; a small accuracy drop is expected in exchange for size/latency.
test()- Done when: the INT8 metric is within your acceptable tolerance of baseline.
Comparing against the original model
After the engine holds the INT8 model. To re-check the original
FP32/FP16 model, either pass the original path directly to /
, or create the engine again from the original .
optimize().xml.test().predict().xmlNotes
- Quantization is OpenVINO/NNCF-based and applies to exported IR models — it is not a training-time step.
- Only OpenVINO IR () is supported. An ONNX model must be converted to OpenVINO IR first before it can be optimized.
.xml - In the Geti application this is exposed as the job (
quantize); libraryapplication/backend/app/execution/quantization/is the same capability without the job/queue wrapper.optimize()
Verify
bash
# from library/
just lint
just test-unit -- -k optimize # when you touched optimization codeRelated skills
- — produce the OpenVINO
getitune-exporting-a-modelto quantize..xml - — run inference with the quantized model.
getitune-running-inference