Skip to content

Commit

Permalink
Add tensorflow/profiler as a dependency for tensorflow
Browse files Browse the repository at this point in the history
As part of an ongoing effort to decouple our ml profiler code from tensorflow, this PR lays the foundation for moving code into tensorflow/profiler.

This PR touches code within tensorflow/tensorflow, tensorflow/profiler, and openxla/xla. Here is an outline of the changes for each repo.
tensorflow/tensorflow:
* Grant Visibility to //@org_xprof/xprof/(pywrap)

openxla/xla:
* Functionally a no-op in OSS. Grants visibility to xprof, however all uses are wrapped in `internal_visibility`.

tensorflow/profiler:
* Create xprof subdirectory

PiperOrigin-RevId: 728773582
  • Loading branch information
Matt-Hurd authored and copybara-github committed Mar 7, 2025
1 parent 8e1277e commit 321c39b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ http_archive(
patches = [
"//third_party:tensorflow.patch",
"//third_party:tensorflow_add_grpc_cares_darwin_arm64_support.patch",
"//third_party:tensorflow_public_visibility.patch", # TODO(matthurd): Remove after tf migration.
"//third_party:tensorflow_public_visibility_2.patch", # TODO(matthurd): Remove after tf migration.
],
strip_prefix = "tensorflow-master",
urls = [
Expand Down
11 changes: 11 additions & 0 deletions third_party/tensorflow_public_visibility.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/tensorflow/core/profiler/convert/BUILD
+++ b/tensorflow/core/profiler/convert/BUILD
@@ -4,7 +4,7 @@

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
- default_visibility = ["//tensorflow/core/profiler:internal"],
+ default_visibility = ["//visibility:public"],
licenses = ["notice"],
)

11 changes: 11 additions & 0 deletions third_party/tensorflow_public_visibility_2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/tensorflow/core/profiler/protobuf/BUILD
+++ b/tensorflow/core/profiler/protobuf/BUILD
@@ -33,7 +33,7 @@
protodeps = [
"@local_tsl//tsl/profiler/protobuf:xplane_proto",
],
- visibility = [":friends"],
+ visibility = ["//visibility:public"],
exports = [
"@local_tsl//tsl/profiler/protobuf:xplane_proto",
],
Empty file added xprof/BUILD
Empty file.
Empty file added xprof/__init__.py
Empty file.

0 comments on commit 321c39b

Please sign in to comment.