From 7e9c8bfb154b7c94a3bbda52e88da4d226251b84 Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Fri, 1 Jul 2022 01:56:24 +0000 Subject: [PATCH 01/13] adding tf pin --- third_party/tensorflow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/tensorflow b/third_party/tensorflow index fc1c08fabd81..8ee190ea43bd 160000 --- a/third_party/tensorflow +++ b/third_party/tensorflow @@ -1 +1 @@ -Subproject commit fc1c08fabd81cde16dd60d105c576dd4ee974046 +Subproject commit 8ee190ea43bde9f5c5588f0a78f69fe7dd4192ac From 04a217d130b409b179f3cf4b0805881228113f1f Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Fri, 1 Jul 2022 02:03:26 +0000 Subject: [PATCH 02/13] moving tf pin to a week back when tf had a successful pin - jun 22 --- third_party/tensorflow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/tensorflow b/third_party/tensorflow index 8ee190ea43bd..57d35fb585de 160000 --- a/third_party/tensorflow +++ b/third_party/tensorflow @@ -1 +1 @@ -Subproject commit 8ee190ea43bde9f5c5588f0a78f69fe7dd4192ac +Subproject commit 57d35fb585de65a34cd6871b8ca3a6501183f98a From c1fffb98bfae6c7f3654b0ca96d77d8843d638bd Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Thu, 21 Jul 2022 18:48:40 +0000 Subject: [PATCH 03/13] pin update, some debug prints - to remove later --- build_torch_xla_libs.sh | 4 ++-- setup.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build_torch_xla_libs.sh b/build_torch_xla_libs.sh index 9bece927bd82..afb1b7fa0865 100755 --- a/build_torch_xla_libs.sh +++ b/build_torch_xla_libs.sh @@ -54,9 +54,9 @@ if [[ ! -z "$BAZEL_JOBS" ]]; then MAX_JOBS="--jobs=$BAZEL_JOBS" fi -OPTS+=(--cxxopt="-std=c++14") +OPTS+=(--action_env=BAZEL_CXXOPTS="-std=c++17") #(--cxxopt="-std=c++17") if [[ $(basename -- $CC) =~ ^clang ]]; then - OPTS+=(--cxxopt="-Wno-c++11-narrowing") + OPTS+=(--cxxopt="-Wno-c++14-narrowing") fi if [[ "$XLA_CUDA" == "1" ]]; then diff --git a/setup.py b/setup.py index 5dd28fe2a2e8..96c87315d309 100644 --- a/setup.py +++ b/setup.py @@ -128,10 +128,12 @@ def generate_xla_lazy_code(base_dir): def build_extra_libraries(base_dir, build_mode=None): build_libs_cmd = [os.path.join(base_dir, 'build_torch_xla_libs.sh')] cxx_abi = getattr(torch._C, '_GLIBCXX_USE_CXX11_ABI', None) + print("milad: ", cxx_abi, dir(torch._C)) if cxx_abi is not None: build_libs_cmd += ['-O', '-D_GLIBCXX_USE_CXX11_ABI={}'.format(int(cxx_abi))] if build_mode is not None: build_libs_cmd += [build_mode] + print("Milad: build command: ", build_libs_cmd) if subprocess.call(build_libs_cmd) != 0: print( 'Failed to build external libraries: {}'.format(build_libs_cmd), @@ -321,6 +323,10 @@ def make_relative_rpath(path): else: extra_compile_args += ['-DNDEBUG'] +print("milad2: ", extra_compile_args) +print("milad2: ", extra_link_args) +print("milad2: ", make_relative_rpath('torch_xla/lib')) + extra_link_args += ['-lxla_computation_client'] setup( From 0836d1df0ed96511b03a8d65dac7d8aa6735a855 Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Mon, 25 Jul 2022 21:25:52 +0000 Subject: [PATCH 04/13] moved pytorch/xla to c++17 --- build_torch_xla_libs.sh | 2 +- setup.py | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/build_torch_xla_libs.sh b/build_torch_xla_libs.sh index afb1b7fa0865..279136edb5de 100755 --- a/build_torch_xla_libs.sh +++ b/build_torch_xla_libs.sh @@ -54,7 +54,7 @@ if [[ ! -z "$BAZEL_JOBS" ]]; then MAX_JOBS="--jobs=$BAZEL_JOBS" fi -OPTS+=(--action_env=BAZEL_CXXOPTS="-std=c++17") #(--cxxopt="-std=c++17") +OPTS+=(--action_env=BAZEL_CXXOPTS="-std=c++17") if [[ $(basename -- $CC) =~ ^clang ]]; then OPTS+=(--cxxopt="-Wno-c++14-narrowing") fi diff --git a/setup.py b/setup.py index 96c87315d309..315ef5e1a4bc 100644 --- a/setup.py +++ b/setup.py @@ -128,12 +128,10 @@ def generate_xla_lazy_code(base_dir): def build_extra_libraries(base_dir, build_mode=None): build_libs_cmd = [os.path.join(base_dir, 'build_torch_xla_libs.sh')] cxx_abi = getattr(torch._C, '_GLIBCXX_USE_CXX11_ABI', None) - print("milad: ", cxx_abi, dir(torch._C)) if cxx_abi is not None: build_libs_cmd += ['-O', '-D_GLIBCXX_USE_CXX11_ABI={}'.format(int(cxx_abi))] if build_mode is not None: build_libs_cmd += [build_mode] - print("Milad: build command: ", build_libs_cmd) if subprocess.call(build_libs_cmd) != 0: print( 'Failed to build external libraries: {}'.format(build_libs_cmd), @@ -305,7 +303,7 @@ def make_relative_rpath(path): extra_compile_args = [ - '-std=c++14', + '-std=c++17', '-Wno-sign-compare', '-Wno-deprecated-declarations', '-Wno-return-type', @@ -323,10 +321,6 @@ def make_relative_rpath(path): else: extra_compile_args += ['-DNDEBUG'] -print("milad2: ", extra_compile_args) -print("milad2: ", extra_link_args) -print("milad2: ", make_relative_rpath('torch_xla/lib')) - extra_link_args += ['-lxla_computation_client'] setup( From 5e559562a134a5bd66ad20062681d67b0015a2f0 Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Mon, 25 Jul 2022 21:38:45 +0000 Subject: [PATCH 05/13] adding torch pin for testing --- torch_path/.torch_pin | 1 + 1 file changed, 1 insertion(+) create mode 100644 torch_path/.torch_pin diff --git a/torch_path/.torch_pin b/torch_path/.torch_pin new file mode 100644 index 000000000000..df16a0c45ca0 --- /dev/null +++ b/torch_path/.torch_pin @@ -0,0 +1 @@ +wconstab/more_checks From 6d1239c8c4acf42bb69a1d95ec54e9f623042e9e Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Mon, 25 Jul 2022 21:41:32 +0000 Subject: [PATCH 06/13] adding torch pin for testing --- torch_path/.torch_pin | 1 - 1 file changed, 1 deletion(-) delete mode 100644 torch_path/.torch_pin diff --git a/torch_path/.torch_pin b/torch_path/.torch_pin deleted file mode 100644 index df16a0c45ca0..000000000000 --- a/torch_path/.torch_pin +++ /dev/null @@ -1 +0,0 @@ -wconstab/more_checks From 38ad6e81344afdffd7b20ee2c4e1a4518f5f5447 Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Mon, 25 Jul 2022 21:41:43 +0000 Subject: [PATCH 07/13] adding torch pin for testing --- torch_patches/.torch_pin | 1 + 1 file changed, 1 insertion(+) create mode 100644 torch_patches/.torch_pin diff --git a/torch_patches/.torch_pin b/torch_patches/.torch_pin new file mode 100644 index 000000000000..664ca3917780 --- /dev/null +++ b/torch_patches/.torch_pin @@ -0,0 +1 @@ +#82032 From ead345449e5ec8e29775d931a970e27c37c5e6bd Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Tue, 26 Jul 2022 02:00:18 +0000 Subject: [PATCH 08/13] adding c++17 to CMakeLists.txt --- test/cpp/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt index f9e974847289..eed0565ba89a 100644 --- a/test/cpp/CMakeLists.txt +++ b/test/cpp/CMakeLists.txt @@ -43,6 +43,8 @@ ExternalProject_Add( CMAKE_ARGS "-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=${PT_CXX_ABI}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + ExternalProject_Get_Property(googletest SOURCE_DIR) set(TORCH_XLA_TEST_SOURCES From 7a6686b55208c4146c732734e8a9d177106c5f1e Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Tue, 26 Jul 2022 06:24:02 +0000 Subject: [PATCH 09/13] removed torch pin --- torch_patches/.torch_pin | 1 - 1 file changed, 1 deletion(-) delete mode 100644 torch_patches/.torch_pin diff --git a/torch_patches/.torch_pin b/torch_patches/.torch_pin deleted file mode 100644 index 664ca3917780..000000000000 --- a/torch_patches/.torch_pin +++ /dev/null @@ -1 +0,0 @@ -#82032 From 9c264f6b07918b8707c038865c31a50eaa2d5f51 Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Fri, 29 Jul 2022 01:33:27 +0000 Subject: [PATCH 10/13] removing the environment variable --- build_torch_xla_libs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_torch_xla_libs.sh b/build_torch_xla_libs.sh index 279136edb5de..d938d5a68b83 100755 --- a/build_torch_xla_libs.sh +++ b/build_torch_xla_libs.sh @@ -54,7 +54,7 @@ if [[ ! -z "$BAZEL_JOBS" ]]; then MAX_JOBS="--jobs=$BAZEL_JOBS" fi -OPTS+=(--action_env=BAZEL_CXXOPTS="-std=c++17") +OPTS+=(--cxxopt=-"std=c++17") if [[ $(basename -- $CC) =~ ^clang ]]; then OPTS+=(--cxxopt="-Wno-c++14-narrowing") fi From b8520c27eaa6dc8fd29059f792f5031449f54166 Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Fri, 29 Jul 2022 01:35:38 +0000 Subject: [PATCH 11/13] type --- build_torch_xla_libs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_torch_xla_libs.sh b/build_torch_xla_libs.sh index d938d5a68b83..b043fc069a0e 100755 --- a/build_torch_xla_libs.sh +++ b/build_torch_xla_libs.sh @@ -54,7 +54,7 @@ if [[ ! -z "$BAZEL_JOBS" ]]; then MAX_JOBS="--jobs=$BAZEL_JOBS" fi -OPTS+=(--cxxopt=-"std=c++17") +OPTS+=(--cxxopt="-std=c++17") if [[ $(basename -- $CC) =~ ^clang ]]; then OPTS+=(--cxxopt="-Wno-c++14-narrowing") fi From 04a46c5e081f2d5a458def6eb82be486b30be7a2 Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Fri, 12 Aug 2022 15:31:21 +0000 Subject: [PATCH 12/13] moving back to -Wno-c++11-narrowing --- build_torch_xla_libs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_torch_xla_libs.sh b/build_torch_xla_libs.sh index b043fc069a0e..80b872a8fdca 100755 --- a/build_torch_xla_libs.sh +++ b/build_torch_xla_libs.sh @@ -56,7 +56,7 @@ fi OPTS+=(--cxxopt="-std=c++17") if [[ $(basename -- $CC) =~ ^clang ]]; then - OPTS+=(--cxxopt="-Wno-c++14-narrowing") + OPTS+=(--cxxopt="-Wno-c++11-narrowing") fi if [[ "$XLA_CUDA" == "1" ]]; then From 9122ce4a45950c3c1601963b95d00f5851162a1f Mon Sep 17 00:00:00 2001 From: Milad Mohammadi Date: Sat, 13 Aug 2022 00:20:10 +0000 Subject: [PATCH 13/13] trying both c++11 and c++14 narrowing --- build_torch_xla_libs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build_torch_xla_libs.sh b/build_torch_xla_libs.sh index 80b872a8fdca..39f27974414f 100755 --- a/build_torch_xla_libs.sh +++ b/build_torch_xla_libs.sh @@ -57,6 +57,7 @@ fi OPTS+=(--cxxopt="-std=c++17") if [[ $(basename -- $CC) =~ ^clang ]]; then OPTS+=(--cxxopt="-Wno-c++11-narrowing") + OPTS+=(--cxxopt="-Wno-c++14-narrowing") fi if [[ "$XLA_CUDA" == "1" ]]; then