Skip to content

Commit

Permalink
Merge pull request #1181 from cliveverghese:wheel
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 706862429
  • Loading branch information
copybara-github committed Dec 16, 2024
2 parents 5be7c4f + 183ecd5 commit 0d49684
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build --host_cxxopt=-std=c++17
build --copt=-Wno-gnu-offsetof-extensions
build --copt=-Wno-error=array-parameter
build --copt=-Wno-error=unused-command-line-argument
build --copt=-w
21 changes: 4 additions & 17 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ python_register_toolchains(
ignore_root_user_error = True,
# Available versions are listed in @rules_python//python:versions.bzl.
# We recommend using the same version your team is already standardized on.
python_version = "3.10",
python_version = "3.11",
)

load("@python//:defs.bzl", "interpreter")
Expand Down Expand Up @@ -160,29 +160,16 @@ load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")

sass_repositories()

http_archive(
name = "com_google_protobuf",
sha256 = "f66073dee0bc159157b0bd7f502d7d1ee0bc76b3c1eac9836927511bdc4b3fc1",
strip_prefix = "protobuf-3.21.9",
urls = [
"https://github.com/protocolbuffers/protobuf/archive/v3.21.9.zip",
],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

http_archive(
name = "org_tensorflow",
patch_args = ["-p1"],
patches = ["//third_party:tensorflow.patch"],
# NOTE: when updating this, MAKE SURE to also update the protobuf_js runtime version
# in third_party/workspace.bzl to >= the protobuf/protoc version provided by TF.
sha256 = "288f840d70639d54a087b9ba5310ffae3dbc45ede90ada168a0943cb6e43dabe",
strip_prefix = "tensorflow-a568daa404774cc90c3729ad7af2c9f7a0a558d2",
sha256 = "fe5261186952ec13652e48f219048d1f5e7825d6b83c91ebee71bbc41060baba",
strip_prefix = "tensorflow-0c1df46af2b5010ebdeac51f9391649753d3f1d2",
urls = [
"https://github.com/tensorflow/tensorflow/archive/a568daa404774cc90c3729ad7af2c9f7a0a558d2.zip",
"https://github.com/tensorflow/tensorflow/archive/0c1df46af2b5010ebdeac51f9391649753d3f1d2.zip",
],
)

Expand Down
2 changes: 2 additions & 0 deletions plugin/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ find tensorboard_plugin_profile/protobuf -name \*.py -exec $sedi -e '
s/^from plugin.tensorboard_plugin_profile/from tensorboard_plugin_profile/
' {} +

cp ${BUILD_WORKSPACE_DIRECTORY}/bazel-bin/external/org_tensorflow/tensorflow/python/profiler/internal/_pywrap_profiler_plugin.so tensorboard_plugin_profile/convert/

# Copy static files.
cd tensorboard_plugin_profile
mkdir -p static
Expand Down
1 change: 1 addition & 0 deletions plugin/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def get_readme():
),
package_data={
'tensorboard_plugin_profile': ['static/**'],
'': ['_pywrap_profiler_plugin.so'],
},
entry_points={
'tensorboard_plugins': [
Expand Down
1 change: 1 addition & 0 deletions plugin/tensorboard_plugin_profile/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ py_library(
"//:expect_tensorflow_installed",
"@org_pocoo_werkzeug",
"@org_pythonhosted_six",
"@org_tensorflow//tensorflow/python/profiler/internal:_pywrap_profiler_plugin",
"@org_tensorflow_tensorboard//tensorboard/backend/event_processing:plugin_asset_util",
"@org_tensorflow_tensorboard//tensorboard/plugins:base_plugin",
"@org_xprof//plugin/tensorboard_plugin_profile/convert:all_libs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import logging

from tensorflow.python.profiler.internal import _pywrap_profiler_plugin # pylint: disable=g-direct-tensorflow-import
from tensorboard_plugin_profile.convert import dcn_collective_stats_proto_to_gviz
from tensorboard_plugin_profile.convert import hlo_stats_proto_to_gviz
from tensorboard_plugin_profile.convert import inference_stats_proto_to_gviz
Expand All @@ -38,6 +37,12 @@
from tensorboard_plugin_profile.convert import trace_events_json
from tensorboard_plugin_profile.protobuf import trace_events_pb2

try:
from tensorboard_plugin_profile.convert import _pywrap_profiler_plugin # pylint: disable=g-import-not-at-top
except ImportError:
from tensorflow.python.profiler.internal import _pywrap_profiler_plugin # pylint: disable=g-direct-tensorflow-import, g-import-not-at-top


logger = logging.getLogger('tensorboard')


Expand Down

0 comments on commit 0d49684

Please sign in to comment.