Principle:Tensorflow Serving Session Bundle Migration
| Knowledge Sources | |
|---|---|
| Domains | Model Serving, Migration, Backward Compatibility |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
Session Bundle Migration defines the backward-compatible bridge between the deprecated SessionBundle format and the current SavedModel format, enabling seamless migration of legacy models.
Description
The Session Bundle Migration principle ensures that models exported in the legacy SessionBundle format can still be served through the modern SavedModel-based infrastructure. This is achieved through format detection, automatic conversion, and dual-path loading.
Key patterns:
- Format detection: LoadSessionBundleOrSavedModelBundle automatically detects whether the export directory contains a SessionBundle or a SavedModel and loads accordingly.
- Signature conversion: ConvertSignaturesToSignatureDefs translates legacy Signature protobufs into the modern SignatureDef format.
- Bundle conversion: ConvertSessionBundleToSavedModelBundle wraps a SessionBundle in a SavedModelBundle interface.
- Transparent loading: Callers use a single loading function regardless of the underlying format, with an optional output flag indicating which format was loaded.
- Legacy operation support: RunClassification and RunRegression support the legacy signature-based execution model.
Usage
Apply this principle when the serving infrastructure must support models from both the legacy SessionBundle era and the current SavedModel format. Use LoadSessionBundleOrSavedModelBundle for loading and check the is_session_bundle flag if format-specific handling is needed.
Theoretical Basis
Session Bundle Migration implements the Strangler Pattern for system migration: the legacy format is progressively replaced by the new format, with a compatibility layer that transparently handles both. This allows gradual migration without requiring all models to be re-exported simultaneously. The dual-path loading function acts as an Anti-Corruption Layer that isolates the modern codebase from legacy format details.