Repository: tensorflow/tensorflow (language: cpp)

Issue:
Support SavedModel in WarmStartSettings initialization
Any reason not to support SavedModel in WarmStartSettings initialization? Currently only checkpoints are supported.

Estimator's `warm_start_from` argument accepts a SavedModel, so it would be great to have parity with that for cases where a user needs finer-grained control via WarmStartSettings (e.g., only initializing a subset of variables for transfer learning/fine tuning).


Discussion / hints:
Sounds reasonable to me. Although it should already be possible to point warm start to the `variables/` directory of the SavedModel, no? That's just a regular training checkpoint.
Digging in, Estimators support SavedModels using the logic @allenlavoie mentions, so it is possible to just point WarmStartSettings at `[saved_model_dir]/variables/variables` (note the extra `variables`) (https://github.com/tensorflow/estimator/blob/master/tensorflow_estimator/python/estimator/estimator.py#L2285).

WarmStartSettings makes an explicit call to checkpoint_utils.init_from_checkpoint (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/training/warm_starting_util.py#L475), so it seems like the above logic could replace that.
I opened a small PR https://github.com/tensorflow/estimator/pull/53/files fixing the issue where WarmStartSettings needed to be initialized from `[saved_model_dir]/variables/variables` instead of `[saved_model_dir]/variables` like @allenlavoie suggested. I suspect this may be for v1 compatibility only at this point, but wanted to put it out there in the interest of closing this issue.
Hi, Estimator will be deprecated from Tensorflow 2.12 since it uses Tensorflow V1 behavior.
Could you please migrate from Estimator to Keras API which will enable you to perform the aforementioned tasks, such as [model building](https://www.tensorflow.org/guide/keras/custom_layers_and_models), gradient application, [training](https://www.tensorflow.org/guide/keras/customizing_what_happens_in_fit), evaluation, and prediction.
Refer Migration guide here https://www.tensorflow.org/guide/migrate/migrating_estimator for more details. Thanks!
Agree, we can close this issue due to the deprecation. Thanks for the reminder!

Fix patch:
diff --git a/third_party/xla/xla/service/gpu/model/BUILD b/third_party/xla/xla/service/gpu/model/BUILD
index 0ed134483688b6..6df579801f0746 100644
--- a/third_party/xla/xla/service/gpu/model/BUILD
+++ b/third_party/xla/xla/service/gpu/model/BUILD
@@ -971,56 +971,47 @@ cc_library(
     ],
 )
 
-[
-    xla_test(
-        name = "hlo_op_profiler_run_" + sm,
-        timeout = "eternal",
-        srcs = ["hlo_op_profiler_run.cc"],
-        # Disable backend optimizations (in particular reassociate and instcombine) which would optimize
-        # expressions like integer add and multiply.
-        args = ["--xla_backend_optimization_level=0"],
-        backends = ["gpu"],
-        # This is a development tool, not a normal test, and thus should only be run
-        # manually with --config=cuda.
-        tags = [
-            "gpu",
-            "manual",
-            "notap",
-            "requires-gpu-" + sm + "-only",
-        ],
-        deps = [
-            ":hlo_op_profile_proto_cc",
-            ":hlo_op_profiler_lib",
-            ":hlo_op_profiles",
-            "//xla:debug_options_flags",
-            "//xla:xla_data_proto_cc",
-            "//xla/hlo/ir:hlo",
-            "//xla/service:hlo_runner",
-            "//xla/service:platform_util",
-            "//xla/stream_executor:device_description",
-            "//xla/tsl/util:command_line_flags",
-            "@com_google_absl//absl/log",
-            "@com_google_absl//absl/strings",
-            "@com_google_absl//absl/strings:str_format",
-            "@local_tsl//tsl/platform:env",
-            "@local_tsl//tsl/platform:path",
-            "@local_tsl//tsl/platform:platform_port",
-            "@local_tsl//tsl/platform:protobuf",
-            "@local_tsl//tsl/platform:status",
-        ],
-    )
-    for sm in [
-        "sm60",
-        "sm70",
-        "sm80",
-        "sm90",
-    ]
-]
+xla_test(
+    name = "hlo_op_profiler_run",
+    timeout = "eternal",
+    srcs = ["hlo_op_profiler_run.cc"],
+    # Disable backend optimizations (in particular reassociate and instcombine) which would optimize
+    # expressions like integer add and multiply.
+    args = ["--xla_backend_optimization_level=0"],
+    backends = ["gpu"],
+    # This is a development tool, not a normal test, and thus should only be run
+    # manually with --config=cuda.
+    tags = [
+        "gpu",
+        "manual",
+        "notap",
+    ],
+    deps = [
+        ":hlo_op_profile_proto_cc",
+        ":hlo_op_profiler_lib",
+        ":hlo_op_profiles",
+        "//xla:debug_options_flags",
+        "//xla:xla_data_proto_cc",
+        "//xla/hlo/ir:hlo",
+        "//xla/service:hlo_runner",
+        "//xla/service:platform_util",
+        "//xla/stream_executor:device_description",
+        "//xla/tsl/util:command_line_flags",
+        "@com_google_absl//absl/log",
+        "@com_google_absl//absl/strings",
+        "@com_google_absl//absl/strings:str_format",
+        "@local_tsl//tsl/platform:env",
+        "@local_tsl//tsl/platform:path",
+        "@local_tsl//tsl/platform:platform_port",
+        "@local_tsl//tsl/platform:protobuf",
+        "@local_tsl//tsl/platform:status",
+    ],
+)
 
 build_test(
     name = "hlo_op_profiler_build_test",
     targets = [
-        ":hlo_op_profiler_run_sm80",
+        ":hlo_op_profiler_run",
     ],
 )
 


Test patch: