aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/ci_build/windows/gpu/pip/build_tf_windows.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/tools/ci_build/windows/gpu/pip/build_tf_windows.sh')
-rw-r--r--tensorflow/tools/ci_build/windows/gpu/pip/build_tf_windows.sh56
1 files changed, 34 insertions, 22 deletions
diff --git a/tensorflow/tools/ci_build/windows/gpu/pip/build_tf_windows.sh b/tensorflow/tools/ci_build/windows/gpu/pip/build_tf_windows.sh
index fe3bce428f..e3eee11080 100644
--- a/tensorflow/tools/ci_build/windows/gpu/pip/build_tf_windows.sh
+++ b/tensorflow/tools/ci_build/windows/gpu/pip/build_tf_windows.sh
@@ -53,30 +53,39 @@ function cleanup {
}
trap cleanup EXIT
-skip_test=0
-release_build=0
+PY_TEST_DIR="py_test_dir"
+SKIP_TEST=0
+RELEASE_BUILD=0
+TEST_TARGET="//${PY_TEST_DIR}/tensorflow/python/... \
+ //${PY_TEST_DIR}/tensorflow/contrib/... "
+
+# --skip_test Skip running tests
+# --enable_remote_cache Add options to enable remote cache for build and test
+# --release_build Build for release, compilation time will be longer to
+# ensure performance
+# --test_core_only Use tensorflow/python/... as test target
+# --test_contrib_only Use tensorflow/contrib/... as test target
for ARG in "$@"; do
- if [[ "$ARG" == --skip_test ]]; then
- skip_test=1
- elif [[ "$ARG" == --enable_remote_cache ]]; then
- set_remote_cache_options
- elif [[ "$ARG" == --release_build ]]; then
- release_build=1
- fi
+ case "$ARG" in
+ --skip_test) SKIP_TEST=1 ;;
+ --enable_remote_cache) set_remote_cache_options ;;
+ --release_build) RELEASE_BUILD=1 ;;
+ --test_core_only) TEST_TARGET="//${PY_TEST_DIR}/tensorflow/python/..." ;;
+ --test_contrib_only) TEST_TARGET="//${PY_TEST_DIR}/tensorflow/contrib/..." ;;
+ *)
+ esac
done
-if [[ "$release_build" != 1 ]]; then
- # --define=override_eigen_strong_inline=true speeds up the compiling of conv_grad_ops_3d.cc and conv_ops_3d.cc
+if [[ "$RELEASE_BUILD" == 1 ]]; then
+ # Overriding eigen strong inline speeds up the compiling of conv_grad_ops_3d.cc and conv_ops_3d.cc
# by 20 minutes. See https://github.com/tensorflow/tensorflow/issues/10521
- # Because this hurts the performance of TF, we don't enable it in release build.
- echo "build --define=override_eigen_strong_inline=true" >> "${TMP_BAZELRC}"
+ # Because this hurts the performance of TF, we don't override it in release build.
+ export TF_OVERRIDE_EIGEN_STRONG_INLINE=0
+else
+ export TF_OVERRIDE_EIGEN_STRONG_INLINE=1
fi
-# The host and target platforms are the same in Windows build. So we don't have
-# to distinct them. This helps avoid building the same targets twice.
-echo "build --distinct_host_configuration=false" >> "${TMP_BAZELRC}"
-
# Enable short object file path to avoid long path issue on Windows.
echo "startup --output_user_root=${TMPDIR}" >> "${TMP_BAZELRC}"
@@ -91,12 +100,11 @@ run_configure_for_gpu_build
bazel build --announce_rc --config=opt tensorflow/tools/pip_package:build_pip_package || exit $?
-if [[ "$skip_test" == 1 ]]; then
+if [[ "$SKIP_TEST" == 1 ]]; then
exit 0
fi
# Create a python test directory to avoid package name conflict
-PY_TEST_DIR="py_test_dir"
create_python_test_dir "${PY_TEST_DIR}"
./bazel-bin/tensorflow/tools/pip_package/build_pip_package "$PWD/${PY_TEST_DIR}"
@@ -105,14 +113,18 @@ create_python_test_dir "${PY_TEST_DIR}"
PIP_NAME=$(ls ${PY_TEST_DIR}/tensorflow-*.whl)
reinstall_tensorflow_pip ${PIP_NAME}
+TF_GPU_COUNT=${TF_GPU_COUNT:-8}
+
# Define no_tensorflow_py_deps=true so that every py_test has no deps anymore,
# which will result testing system installed tensorflow
# GPU tests are very flaky when running concurrently, so set local_test_jobs=1
bazel test --announce_rc --config=opt -k --test_output=errors \
+ --test_env=TF_GPU_COUNT \
+ --run_under=//tensorflow/tools/ci_build/gpu_build:parallel_gpu_execute \
--define=no_tensorflow_py_deps=true --test_lang_filters=py \
--test_tag_filters=-no_pip,-no_windows,-no_windows_gpu,-no_gpu,-no_pip_gpu,-no_oss \
--build_tag_filters=-no_pip,-no_windows,-no_windows_gpu,-no_gpu,-no_pip_gpu,-no_oss --build_tests_only \
- --local_test_jobs=1 --test_timeout="300,450,1200,3600" \
+ --test_size_filters=small,medium \
+ --local_test_jobs=$TF_GPU_COUNT --test_timeout="300,450,1200,3600" \
--flaky_test_attempts=3 \
- //${PY_TEST_DIR}/tensorflow/python/... \
- //${PY_TEST_DIR}/tensorflow/contrib/...
+ ${TEST_TARGET}