ZenML Integration¶
Config generation, model promotion lifecycle, and reusable pipeline steps.
Config Generation¶
fair.zenml.config
¶
generate_training_config(base_model_item, dataset_item, model_name, overrides=None, *, labels_href, experiment_tracker=None)
¶
ZenML training config; labels_href points at labels already adapted to the model's class values.
Source code in fair/zenml/config.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
generate_inference_config(model_item, input_images, overrides=None, *, resources_item=None)
¶
input_images maps input names to chips paths; resources_item declares the pod resources.
Source code in fair/zenml/config.py
Promotion¶
fair.zenml.promotion
¶
Steps¶
fair.zenml.steps
¶
Reusable ZenML steps for model developers.
load_model resolves a model from the ZenML artifact store using either a direct artifact version ID or a URI fallback. The materializer registered at training time handles deserialization — PyTorch, Keras, TensorFlow, or any custom materializer works transparently.
load_model(model_uri, zenml_artifact_version_id='')
¶
Resolve model from ZenML artifact store. Framework-agnostic via materializer.
Source code in fair/zenml/steps.py
Instrumentation¶
fair.zenml.instrumentation
¶
mlflow_training_context(hyperparameters, model_name=None, base_model_id=None, dataset_id=None)
¶
Context manager that instruments a training step with MLflow.
Handles autolog, param logging, tag setting, and wall-clock timing. Contributors use this instead of manual MLflow calls.
Source code in fair/zenml/instrumentation.py
log_evaluation_results(metrics)
¶
Log evaluation metrics to both MLflow and ZenML fair-prefixed metadata.