Heuristic:Tensorflow Serving Warning Deprecated CreateTfrtSavedModel Raw
| Knowledge Sources | |
|---|---|
| Domains | Model_Loading, Deprecation |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
Deprecation warning for the raw tfrt_stub::SavedModel creation path in TfrtSavedModelFactory. Use the Servable overload instead.
Description
The method TfrtSavedModelFactory::CreateTfrtSavedModelWithMetadata() has two overloads. The overload that returns a raw std::unique_ptr<tfrt_stub::SavedModel> is marked with ABSL_DEPRECATED in the source code at tfrt_saved_model_factory.h:104. The deprecation message reads: "Use the overload that creates Servable instead."
The preferred overload returns std::unique_ptr<Servable>, which wraps the TFRT SavedModel in a TfrtSavedModelServable that provides thread pool factory support and request recording capabilities.
Usage
Apply this warning when encountering code that calls CreateTfrtSavedModelWithMetadata with a tfrt_stub::SavedModel output parameter. Migrate to the Servable overload to ensure compatibility with future versions.
The Insight (Rule of Thumb)
- Action: Replace calls to the deprecated CreateTfrtSavedModelWithMetadata(metadata, path, &saved_model) overload with the Servable overload.
- Value: Use std::unique_ptr<Servable> instead of std::unique_ptr<tfrt_stub::SavedModel>.
- Trade-off: The Servable wrapper adds thread pool factory support and request recording, which is generally beneficial.
Reasoning
The deprecation is driven by the Tensorflow Serving team's migration toward a unified Servable interface. The raw tfrt_stub::SavedModel path bypasses features like thread pool management and request recording that are integrated into the TfrtSavedModelServable wrapper.