Revert "[inductor] Windows inductor use intel-openmp. (#160258)"

This reverts commit 41673110cd7c5960824cc74a6fcaeda1a8bc7a23.

Reverted https://github.com/pytorch/pytorch/pull/160258 on behalf of https://github.com/malfet due to Reverting to fix https://github.com/pytorch/pytorch/issues/160898 and https://github.com/pytorch/pytorch/issues/160962 ([comment](https://github.com/pytorch/pytorch/pull/160258#issuecomment-3220158145))
This commit is contained in:
PyTorch MergeBot
2025-08-25 12:57:47 +00:00
parent 1eccfb157a
commit ab7787fb82
2 changed files with 6 additions and 13 deletions

View File

@ -1588,7 +1588,6 @@ def main() -> None:
"networkx>=2.5.1", "networkx>=2.5.1",
"jinja2", "jinja2",
"fsspec>=0.8.5", "fsspec>=0.8.5",
'intel-openmp==2025.1.1 ;platform_system == "Windows" ', # for Windows inductor
] ]
if BUILD_PYTHON_ONLY: if BUILD_PYTHON_ONLY:
install_requires += [f"{LIBTORCH_PKG_NAME}=={TORCH_VERSION}"] install_requires += [f"{LIBTORCH_PKG_NAME}=={TORCH_VERSION}"]

View File

@ -1126,15 +1126,8 @@ def _get_python_related_args() -> tuple[list[str], list[str]]:
str( str(
( (
Path(sysconfig.get_path("include", scheme="nt")).parent / "libs" Path(sysconfig.get_path("include", scheme="nt")).parent / "libs"
).absolute() # python[ver].lib ).absolute()
), )
str(
(
Path(sysconfig.get_path("include", scheme="nt")).parent
/ "Library"
/ "lib"
).absolute() # install python librarys location, such as intel-openmp
),
] ]
else: else:
python_lib_path = [sysconfig.get_config_var("LIBDIR")] python_lib_path = [sysconfig.get_config_var("LIBDIR")]
@ -1300,10 +1293,11 @@ def _get_openmp_args(
libs.append("libiomp5md") libs.append("libiomp5md")
perload_icx_libomp_win(cpp_compiler) perload_icx_libomp_win(cpp_compiler)
else: else:
# /openmp, /openmp:llvm
# llvm on Windows, new openmp: https://devblogs.microsoft.com/cppblog/msvc-openmp-update/
# msvc openmp: https://learn.microsoft.com/zh-cn/cpp/build/reference/openmp-enable-openmp-2-0-support?view=msvc-170
cflags.append("openmp") cflags.append("openmp")
cflags.append("openmp:experimental") cflags.append("openmp:experimental") # MSVC CL
libs.append("libiomp5md") # intel-openmp
ldflags.append("nodefaultlib:vcomp")
else: else:
if config.is_fbcode(): if config.is_fbcode():
include_dir_paths.append(build_paths.openmp_include) include_dir_paths.append(build_paths.openmp_include)