[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade bazel version 5.3.0 and fix some typo in tf version #755

Merged
merged 1 commit into from
Mar 28, 2023
Merged
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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.0
5.3.0
14 changes: 7 additions & 7 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ done
while [[ "$TF_CUDA_VERSION" == "" ]]; do
read -p "Are you building against TensorFlow 2.1(including RCs) or newer?[Y/n] " INPUT
case $INPUT in
[Yy]* ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=10.1;;
[Yy]* ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=11;;
[Nn]* ) echo "Build against TensorFlow <2.1."; TF_CUDA_VERSION=10.0;;
"" ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=10.1;;
"" ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=11;;
* ) echo "Invalid selection: " $INPUT;;
esac
done
Expand Down Expand Up @@ -94,10 +94,6 @@ fi
TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
TF_LFLAGS="$(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))')"

write_to_bazelrc "build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true"
if [[ "$PIP_MANYLINUX2010" == "0" ]]; then
write_to_bazelrc "build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain"
fi

write_to_bazelrc "build --experimental_repo_remote_exec"
write_to_bazelrc "build --spawn_strategy=standalone"
Expand Down Expand Up @@ -142,8 +138,12 @@ fi

# TODO(yifeif): do not hardcode path
if [[ "$TF_NEED_CUDA" == "1" ]]; then
write_to_bazelrc "build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true"
write_to_bazelrc "build:cuda --@local_config_cuda//:enable_cuda"
write_to_bazelrc "build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain"

write_action_env_to_bazelrc "TF_CUDA_VERSION" ${TF_CUDA_VERSION}
write_action_env_to_bazelrc "TF_CUDNN_VERSION" "7"
write_action_env_to_bazelrc "TF_CUDNN_VERSION" "8"
if is_windows; then
write_action_env_to_bazelrc "CUDNN_INSTALL_PATH" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${TF_CUDA_VERSION}"
write_action_env_to_bazelrc "CUDA_TOOLKIT_PATH" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${TF_CUDA_VERSION}"
Expand Down
12 changes: 6 additions & 6 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TensorFlow Quantum is supported on Python 3.7, 3.8, and 3.9 and depends directly
### Requirements

* pip 19.0 or later (requires `manylinux2010` support)
* [TensorFlow == 2.7.0](https://www.tensorflow.org/install/pip)
* [TensorFlow == 2.11.0](https://www.tensorflow.org/install/pip)

See the [TensorFlow install guide](https://www.tensorflow.org/install/pip) to
set up your Python development environment and an (optional) virtual environment.
Expand All @@ -27,7 +27,7 @@ Upgrade `pip` and install TensorFlow
<!-- common_typos_disable -->
<pre class="devsite-click-to-copy">
<code class="devsite-terminal">pip3 install --upgrade pip</code>
<code class="devsite-terminal">pip3 install tensorflow==2.7.0</code>
<code class="devsite-terminal">pip3 install tensorflow==2.11.0</code>
</pre>
<!-- common_typos_enable -->

Expand Down Expand Up @@ -84,21 +84,21 @@ As noted in the TensorFlow
guide, the <a href="https://bazel.build/" class="external">Bazel</a>
build system will be required.

Our latest source builds use TensorFlow 2.11.0. To ensure compatibility we use `bazel` version 5.1.0. To remove any existing version of Bazel:
Our latest source builds use TensorFlow 2.11.0. To ensure compatibility we use `bazel` version 5.3.0. To remove any existing version of Bazel:

<!-- common_typos_disable -->
<pre class="devsite-click-to-copy">
<code class="devsite-terminal">sudo apt-get remove bazel</code>
</pre>
<!-- common_typos_enable -->

Download and install `bazel` version 5.1.0:
Download and install `bazel` version 5.3.0:

<!-- common_typos_disable -->
<pre class="devsite-click-to-copy">
<code class="devsite-terminal">wget https://github.com/bazelbuild/bazel/releases/download/5.1.0/bazel_5.1.0-linux-x86_64.deb
<code class="devsite-terminal">wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
</code>
<code class="devsite-terminal">sudo dpkg -i bazel_5.1.0-linux-x86_64.deb</code>
<code class="devsite-terminal">sudo dpkg -i bazel_5.3.0-linux-x86_64.deb</code>
</pre>
<!-- common_typos_enable -->

Expand Down
4 changes: 2 additions & 2 deletions scripts/ci_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
wget https://github.com/bazelbuild/bazel/releases/download/5.1.0/bazel_5.1.0-linux-x86_64.deb
sudo dpkg -i bazel_5.1.0-linux-x86_64.deb
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt