ML Metadata is a lightweight library for recording and retrieving metadata from machine-learning workflows. Instrumenting pipeline steps preserves datasets, model files, algorithms, hyperparameters, metrics, versions, and relationships needed for experiment comparison, troubleshooting, lineage, and reproducibility. section 8.0 section 8.4.1
Each workflow step uses the MLMD client API against either a relational SQL backend or an MLMD gRPC server backed by SQL. Direct SQL access is simpler; the gRPC arrangement is recommended because it avoids exposing the database. section 8.4.1
Model the workflow with four core record types:
- Artifact: an input or output object, such as a dataset or model file. section 8.4.1
- Execution: a component or step in a workflow, such as a training run. section 8.4.1
- Event: a relationship connecting artifacts with executions. section 8.4.1
- Context: a logical group correlating artifacts and executions within one workflow. section 8.4.1
Register and query a training run
Create an Artifact with a dataset URI and properties such as day and split, create a RUNNING Execution, and register a model Artifact with its URI, version, and name. Query all artifacts, retrieve one by ID or URI, or filter properties with a condition such as a positive training day. section 8.4.1
Figure 8.6 Two different setups for instrumenting metadata with MLMD: (A) directly report metadata to the backend database and (B) report metadata to the gRPC server DB, database.
Compare direct client-to-database instrumentation with the recommended client-to-gRPC-server arrangement. section 8.4.1
MLMD fits systems that already provide artifact registries or metric visualization and need lightweight metadata integration. It can run independently, originated in TensorFlow Extended, and is used by Kubeflow for pipeline and notebook metadata. section 8.4.3 section 8.5
