Skip to content
Open

Dl test #1443

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ http_archive(

http_archive(
name = "org_tensorflow",
strip_prefix = "tensorflow-40998f44c0c500ce0f6e3b1658dfbc54f838a82a",
sha256 = "5a5bc4599964c71277dcac0d687435291e5810d2ac2f6283cc96736febf73aaf",
strip_prefix = "tensorflow-72fbba3d20f4616d7312b5e2b7f79daf6e82f2fa",

urls = [
"https://github.com/tensorflow/tensorflow/archive/40998f44c0c500ce0f6e3b1658dfbc54f838a82a.zip"
"https://github.com/tensorflow/tensorflow/archive/72fbba3d20f4616d7312b5e2b7f79daf6e82f2fa.zip"
],
)

Expand Down Expand Up @@ -95,7 +95,7 @@ load("@org_tensorflow//third_party/py:python_init_rules.bzl", "python_init_rules

python_init_rules()

load("//tensorflow_text:tftext.bzl", "py_deps_profile")
load("//tensorflow_text:py_deps_profile.bzl", "py_deps_profile")

py_deps_profile(
name = "release_or_nightly",
Expand Down Expand Up @@ -158,7 +158,22 @@ load(
python_wheel_version_suffix_repository(name = "tf_wheel_version_suffix")

load(
"@local_xla//third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl",
"@rules_ml_toolchain//cc/deps:cc_toolchain_deps.bzl",
"cc_toolchain_deps",
)

cc_toolchain_deps()

register_toolchains("@rules_ml_toolchain//cc:linux_x86_64_linux_x86_64")

register_toolchains("@rules_ml_toolchain//cc:linux_x86_64_linux_x86_64_cuda")

register_toolchains("@rules_ml_toolchain//cc:linux_aarch64_linux_aarch64")

register_toolchains("@rules_ml_toolchain//cc:linux_aarch64_linux_aarch64_cuda")

load(
"@rules_ml_toolchain//third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl",
"cuda_json_init_repository",
)

Expand All @@ -170,7 +185,7 @@ load(
"CUDNN_REDISTRIBUTIONS",
)
load(
"@local_xla//third_party/gpus/cuda/hermetic:cuda_redist_init_repositories.bzl",
"@rules_ml_toolchain//third_party/gpus/cuda/hermetic:cuda_redist_init_repositories.bzl",
"cuda_redist_init_repositories",
"cudnn_redist_init_repository",
)
Expand All @@ -184,21 +199,21 @@ cudnn_redist_init_repository(
)

load(
"@local_xla//third_party/gpus/cuda/hermetic:cuda_configure.bzl",
"@rules_ml_toolchain//third_party/gpus/cuda/hermetic:cuda_configure.bzl",
"cuda_configure",
)

cuda_configure(name = "local_config_cuda")

load(
"@local_xla//third_party/nccl/hermetic:nccl_redist_init_repository.bzl",
"@rules_ml_toolchain//third_party/nccl/hermetic:nccl_redist_init_repository.bzl",
"nccl_redist_init_repository",
)

nccl_redist_init_repository()

load(
"@local_xla//third_party/nccl/hermetic:nccl_configure.bzl",
"@rules_ml_toolchain//third_party/nccl/hermetic:nccl_configure.bzl",
"nccl_configure",
)

Expand Down
25 changes: 20 additions & 5 deletions oss_scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ if [[ $(pip show tensorflow) == *tensorflow* ]] ||
echo 'Using installed tensorflow.'
else
echo 'Installing tensorflow.'
if [[ "$IS_NIGHTLY" == "nightly" ]]; then
pip install tf-nightly
else
pip install tensorflow==2.18.0
fi
pip install tf-nightly
fi

# Copy the current bazelversion of TF.
Expand All @@ -54,6 +50,17 @@ curl https://raw.githubusercontent.com/tensorflow/tensorflow/master/.bazelrc -o
sed -i -e 's/build --noincompatible_remove_legacy_whole_archive//' .bazelrc

write_to_bazelrc "build:manylinux2014 --config=release_cpu_linux"
DIR="org_tensorflow"
# Check if the directory exists
if [ ! -d "$DIR" ]; then
git clone https://github.com/tensorflow/tensorflow.git org_tensorflow
cd org_tensorflow
git checkout 735467e89ccfd7ace190363412bb5698164628b5
cd ..
else
echo "Directory $DIR already exists."
fi
write_to_bazelrc "common:linux --override_repository=org_tensorflow=./org_tensorflow"

if (which python3) | grep -q "python3"; then
installed_python="python3"
Expand All @@ -76,8 +83,16 @@ if [[ "$TF_VERSION" == *"rc"* ]]; then
REQUIREMENTS_EXTRA_FLAGS="$REQUIREMENTS_EXTRA_FLAGS --pre"
fi

# JUST FOR TESTING
wget https://storage.googleapis.com/ml-sysroot-testing/tensorflow_metadata-1.18.0.dev0-py3-none-any.whl
mv tensorflow_metadata-1.18.0.dev0-py3-none-any.whl /github/tensorflow_metadata-1.18.0.dev0-py3-none-any.whl
echo "tensorflow-metadata @ file:///github/tensorflow_metadata-1.18.0.dev0-py3-none-any.whl" >> oss_scripts/pip_package/requirements.in

bazel run //oss_scripts/pip_package:requirements.update -- $REQUIREMENTS_EXTRA_FLAGS

# JUST FOR TESTING
sed -i 's#file://tensorflow_metadata-1.18.0.dev0-py3-none-any.whl#file:///github/tensorflow_metadata-1.18.0.dev0-py3-none-any.whl#g' oss_scripts/pip_package/requirements_lock_3_9.txt

TF_ABIFLAG=$(bazel run //oss_scripts/pip_package:tensorflow_build_info -- abi)
SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
if is_macos; then
Expand Down
3 changes: 2 additions & 1 deletion oss_scripts/pip_package/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Tools for building the TF.Text pip package.
load("@python//:defs.bzl", "compile_pip_requirements")

load("@python_version_repo//:py_version.bzl", "REQUIREMENTS")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

package(default_visibility = ["//visibility:private"])

Expand Down
6 changes: 1 addition & 5 deletions oss_scripts/pip_package/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ main() {
fi

# Build pip package
if is_nightly; then
$installed_python setup.nightly.py bdist_wheel --universal $plat_name
else
$installed_python setup.py bdist_wheel --universal $plat_name
fi
$installed_python setup.nightly.py bdist_wheel --universal $plat_name
cp dist/*.whl "${output_dir}"
}

Expand Down
3 changes: 1 addition & 2 deletions oss_scripts/pip_package/requirements.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
setuptools==70.0.0
dm-tree==0.1.8 # Limit for macos support.
numpy
protobuf==4.25.3 # b/397977335 - Fix crash on python 3.9, 3.10.
tensorflow
tf-keras
tensorflow-datasets
tensorflow-metadata
#tensorflow-metadata
Loading