Skip to content

Commit b06ff2c

Browse files
authored
Revert "Support IPEX ABI=0 build (#4910)" (#5008)
* Revert "Support IPEX ABI=0 build (#4910)" This reverts commit 1d2371c. * update
1 parent 35a7ec5 commit b06ff2c

File tree

7 files changed

+9
-36
lines changed

7 files changed

+9
-36
lines changed

cmake/BuildFlags.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
1616
if(NOT WINDOWS)
1717
string(REGEX MATCH "-D_GLIBCXX_USE_CXX11_ABI=([0-9]+)" torch_cxx11 ${TORCH_CXX_FLAGS})
1818
set(GLIBCXX_USE_CXX11_ABI ${CMAKE_MATCH_1})
19+
if(BUILD_WITH_XPU AND NOT GLIBCXX_USE_CXX11_ABI)
20+
message(WARNING "IPEX is building with ABI=${GLIBCXX_USE_CXX11_ABI}!")
21+
endif()
1922
endif()
2023

2124
# Since 2016 Debian start using RUNPATH instead of normally RPATH, which gave the annoy effect that

cmake/Modules/FindoneDNN.cmake

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,7 @@ ELSE()
106106
SET(DNNL_ENABLE_CONCURRENT_EXEC TRUE CACHE BOOL "multi-thread primitive execution" FORCE)
107107
SET(DNNL_EXPERIMENTAL TRUE CACHE BOOL "use one pass for oneDNN BatchNorm" FORCE)
108108

109-
IF(LINUX)
110-
set(_original_cmake_cxx_flags "${CMAKE_CXX_FLAGS}")
111-
# Workaround: when use icpx to build oneDNN, -fpreview-breaking-changes has to be explicitly passed.
112-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpreview-breaking-changes")
113-
ENDIF()
114109
ADD_SUBDIRECTORY(${ONEDNN_ROOT} oneDNN EXCLUDE_FROM_ALL)
115-
IF(LINUX)
116-
set(CMAKE_CXX_FLAGS "${_original_cmake_cxx_flags}")
117-
ENDIF()
118110
SET(ONEDNN_LIBRARY ${DNNL_LIBRARY_NAME})
119111
IF(NOT TARGET ${ONEDNN_LIBRARY})
120112
MESSAGE(FATAL_ERROR "Failed to include oneDNN target")

cmake/gpu/SYCL.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ set(IPEX_SYCL_KERNEL_FLAGS ${IPEX_SYCL_KERNEL_FLAGS} -fhonor-nans)
101101
set(IPEX_SYCL_KERNEL_FLAGS ${IPEX_SYCL_KERNEL_FLAGS} -fhonor-infinities)
102102
set(IPEX_SYCL_KERNEL_FLAGS ${IPEX_SYCL_KERNEL_FLAGS} -fno-associative-math)
103103
set(IPEX_SYCL_KERNEL_FLAGS ${IPEX_SYCL_KERNEL_FLAGS} -fno-approx-func)
104-
# It informs compiler to link the ABI-neutral library.
105-
if(LINUX)
106-
set(IPEX_SYCL_KERNEL_FLAGS ${IPEX_SYCL_KERNEL_FLAGS} -fpreview-breaking-changes)
107-
set(IPEX_SYCL_LINK_FLAGS ${IPEX_SYCL_LINK_FLAGS} -fpreview-breaking-changes)
108-
endif()
109104

110105
# Explicitly limit the index range (< Max int32) in kernel
111106
# set(IPEX_SYCL_KERNEL_FLAGS ${IPEX_SYCL_KERNEL_FLAGS} -fsycl-id-queries-fit-in-int)

csrc/gpu/aten/operators/xetla/kernels/compile_library.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ function(add_library_with_options TARGET USE_DOUBLE_GRF AOT_DEVLIST)
66
-fsycl-device-code-split=per_kernel
77
-fsycl-max-parallel-link-jobs=${SYCL_MAX_PARALLEL_LINK_JOBS}
88
)
9-
if(LINUX)
10-
set(XETLA_KERNEL_FLAGS ${XETLA_KERNEL_FLAGS} -fpreview-breaking-changes)
11-
endif()
129

1310
if (AOT_DEVLIST)
1411
set(XETLA_KERNEL_FLAGS ${XETLA_KERNEL_FLAGS} -fsycl-targets=spir64_gen)
@@ -70,9 +67,6 @@ function(add_library_with_options TARGET USE_DOUBLE_GRF AOT_DEVLIST)
7067

7168
target_link_options(${TARGET} PRIVATE ${XETLA_KERNEL_FLAGS})
7269
target_compile_options(${TARGET} PRIVATE -fsycl)
73-
if(LINUX)
74-
target_compile_options(${TARGET} PRIVATE -fpreview-breaking-changes)
75-
endif()
7670
if (AOT_DEVLIST)
7771
target_compile_options(${TARGET} PRIVATE -fsycl-targets=spir64_gen)
7872
endif()

docs/tutorials/known_issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Troubleshooting
2121
- **Cause**: DPC++ does not support `_GLIBCXX_USE_CXX11_ABI=0`, Intel® Extension for PyTorch\* is always compiled with `_GLIBCXX_USE_CXX11_ABI=1`. This symbol undefined issue appears when PyTorch\* is
2222
compiled with `_GLIBCXX_USE_CXX11_ABI=0`.
2323
- **Solution**: Pass `export GLIBCXX_USE_CXX11_ABI=1` and compile PyTorch\* with particular compiler which supports `_GLIBCXX_USE_CXX11_ABI=1`. We recommend using prebuilt wheels
24-
in [download server](https:// developer.intel.com/ipex-whl-stable-xpu) to avoid this issue. Please **note** that starting from Intel® Extension for PyTorch\* 2.5, it supports both new and old C++ ABIs. Previously, it only supported the new C++ ABI.
24+
in [download server](https:// developer.intel.com/ipex-whl-stable-xpu) to avoid this issue.
2525
- **Problem**: `-997 runtime error` when running some AI models on Intel® Arc™ A-Series GPUs.
2626
- **Cause**: Some of the `-997 runtime error` are actually out-of-memory errors. As Intel® Arc™ A-Series GPUs have less device memory than Intel® Data Center GPU Flex Series 170 and Intel® Data Center GPU
2727
Max Series, running some AI models on them may trigger out-of-memory errors and cause them to report failure such as `-997 runtime error` most likely. This is expected. Memory usage optimization is a work in progress to allow Intel® Arc™ A-Series GPUs to support more AI models.

examples/gpu/inference/cpp/example-usm/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@ set(target example-usm)
77
add_executable(${target} example-usm.cpp)
88
target_link_libraries(${target} ${TORCH_IPEX_LIBRARIES})
99
list(APPEND CMAKE_CXX_FLAGS "-fsycl")
10-
if(LINUX)
11-
list(APPEND CMAKE_CXX_FLAGS " -fpreview-breaking-changes")
12-
endif()
1310

1411
set_property(TARGET ${target} PROPERTY CXX_STANDARD 17)

intel_extension_for_pytorch/xpu/cpp_extension.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
CLIB_EXT = ".dll" if IS_WINDOWS else ".so"
3434
SHARED_FLAG = "/DLL" if IS_WINDOWS else "-shared"
3535
SYCL_FLAG = "-fsycl"
36-
ABI_FLAG = "-fpreview-breaking-changes" if IS_LINUX else ""
3736

3837
MINIMUM_GCC_VERSION = (5, 0, 0)
3938
MINIMUM_MSVC_VERSION = (19, 0, 24215)
@@ -322,7 +321,7 @@ def _gen_link_lib_cmd_line(
322321

323322
libraries_args = []
324323
libraries_args += [f"-l{x}" for x in libraries]
325-
common_args = [SHARED_FLAG] + [SYCL_FLAG] + [ABI_FLAG]
324+
common_args = [SHARED_FLAG] + [SYCL_FLAG]
326325

327326
"""
328327
link command formats:
@@ -453,7 +452,7 @@ def unix_wrap_ninja_link_shared_object(
453452
# create output directories avoid linker error.
454453
create_parent_dirs_by_path(output_libname)
455454

456-
ldflags = [SHARED_FLAG] + [SYCL_FLAG] + [ABI_FLAG]
455+
ldflags = [SHARED_FLAG] + [SYCL_FLAG]
457456
ldflags += [f"-L{x}" for x in library_dirs]
458457
ldflags += [f"-L{x}" for x in runtime_library_dirs]
459458
ldflags += extra_postargs
@@ -511,7 +510,7 @@ def spawn(cmd):
511510

512511
if "-fPIC" in cflags: # Windows does not support this argument
513512
cflags.remove("-fPIC")
514-
cflags = cflags + ["-std=c++17", SYCL_FLAG, ABI_FLAG]
513+
cflags = cflags + ["-std=c++17", SYCL_FLAG]
515514

516515
cmd = [_bin, "-c", src, "-o", obj] + include_list + cflags
517516
elif isinstance(self.cflags, dict):
@@ -1005,11 +1004,9 @@ def library_paths() -> List[str]:
10051004
def _prepare_compile_flags(extra_compile_args):
10061005
if isinstance(extra_compile_args, List):
10071006
extra_compile_args.append(SYCL_FLAG)
1008-
extra_compile_args.append(ABI_FLAG)
10091007
elif isinstance(extra_compile_args, dict):
10101008
cl_flags = extra_compile_args.get("cxx", [])
10111009
cl_flags.append(SYCL_FLAG)
1012-
cl_flags.append(ABI_FLAG)
10131010
extra_compile_args["cxx"] = cl_flags
10141011

10151012
return extra_compile_args
@@ -1051,7 +1048,7 @@ def _prepare_ldflags(extra_ldflags, verbose, is_standalone):
10511048
oneapi_link_args += ["-Wl,--start-group"]
10521049
oneapi_link_args += [f"{x}" for x in get_one_api_help().get_onemkl_libraries()]
10531050
oneapi_link_args += ["-Wl,--end-group"]
1054-
oneapi_link_args += ["-lOpenCL", "-lpthread", "-lm", "-ldl"]
1051+
oneapi_link_args += ["-lsycl", "-lOpenCL", "-lpthread", "-lm", "-ldl"]
10551052

10561053
# Append IPEX link parameters.
10571054
oneapi_link_args += ["-lintel-ext-pt-gpu"]
@@ -1247,12 +1244,7 @@ def object_file_path(source_file: str) -> str:
12471244
return target
12481245

12491246
objects = [object_file_path(src) for src in sources]
1250-
ldflags = (
1251-
([] if is_standalone else [SHARED_FLAG])
1252-
+ [SYCL_FLAG]
1253-
+ [ABI_FLAG]
1254-
+ extra_ldflags
1255-
)
1247+
ldflags = ([] if is_standalone else [SHARED_FLAG]) + [SYCL_FLAG] + extra_ldflags
12561248

12571249
# The darwin linker needs explicit consent to ignore unresolved symbols.
12581250
if IS_MACOS:

0 commit comments

Comments
 (0)