Save and Load Checkpoints
Use an AITune checkpoint when Python code will construct your model and load its tuned modules. The same save/load APIs apply to an AITune Dynamo worker and to a Triton Python backend.
A checkpoint contains tuned module state and backend artifacts. Keep the application’s model construction code and dependencies available in the serving environment.
Save after tuning
Save the model or pipeline after tuning completes:
The default storage directory is checkpoints/, so this writes checkpoints/model.ait. Pass the filename without
adding that directory again.
By default, saving also retains the unpacked checkpoints/model/ directory and writes checksum information.
When deploying to another machine or container, make the checkpoint available there with the model code and the
dependencies required by its tuned backends.
Load before serving
Construct the same model and load its tuned state. Replace YourModel with the constructor used by your application:
In a Dynamo worker, do this before calling dynamo_worker() or in its setup callback. In Triton’s Python backend,
do it in TritonPythonModel.initialize().
Loading extracts the checkpoint if a valid unpacked copy is unavailable, verifies checksums, and loads the saved module state and backend artifacts. Later loads can reuse the unpacked files. Allow write access to the storage directory when extraction is needed.
Use another storage directory
Pass the same storage directory when saving and loading:
Both calls resolve the filename to production/models/model.ait. Relative storage directories are resolved from
the process’s working directory. In a container, use the directory where the checkpoint is mounted.