Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6facae4
Add some comments to avoid duplicated error-finding
danpetry Jan 7, 2025
63aa7dd
Don't override upstream C++ standard
danpetry Jan 7, 2025
81363c0
Use N-1 cores
danpetry Jan 7, 2025
e8d6740
Add fall-through for blas if-else construct
danpetry Jan 7, 2025
e1f50ac
Don't isolate build
danpetry Jan 7, 2025
9fcb3a7
Unvendor pybind11 and eigen
danpetry Jan 7, 2025
ca90fa0
Add and run upstream smoke test
danpetry Jan 7, 2025
ff040de
Use unittest-xml-reporting instead of the historical xmlrunner
danpetry Jan 14, 2025
a2694a9
Add some testing for openmp bug, python api and torch.compile
danpetry Jan 14, 2025
6074128
reinstate `MAX_JOBS=${CPU_COUNT}` on azure
h-vetinari Jan 15, 2025
407a78d
Add description and doc_url
danpetry Jan 14, 2025
393d0d5
correct selector, move comment
danpetry Jan 14, 2025
0f9b587
Revert "Use N-1 cores"
danpetry Jan 17, 2025
4feaee5
Use N-1 cores by default
danpetry Jan 21, 2025
0fe0ba4
Remove CMAKE_ARGS conversion to individual env variables; legacy, rem…
danpetry Jan 21, 2025
14ca3d2
Hand TORCH_CUDA_ARCH_LIST to cmake rather than setting as an env vari…
danpetry Jan 21, 2025
eaaae74
Improve smoke test env variable comment
danpetry Jan 21, 2025
e19af70
Format patch with git format-patch, rename for clarity
danpetry Jan 21, 2025
939dae1
Bump version
danpetry Jan 21, 2025
af73dbe
Correct build number comment
danpetry Jan 21, 2025
65bcd3b
add build dependency on rsync rather than using platform
danpetry Jan 21, 2025
a26ede2
Don't use selectors in jinja expressions [ci skip] ***NO_CI***
danpetry Jan 23, 2025
03b2fc7
Add back disabling hypothesis tests
danpetry Jan 23, 2025
f3bfe5f
Hand contents of CMAKE_ARGS directly to CMake, to remove TORCH_CUDA_A…
danpetry Jan 23, 2025
a811bb2
Temporarily remove smoke test; it's not in the pytorch repo for v2.5.1
danpetry Jan 23, 2025
bd450c9
Revert "Hand contents of CMAKE_ARGS directly to CMake, to remove TORC…
danpetry Jan 24, 2025
6f49c62
Revert "Remove CMAKE_ARGS conversion to individual env variables; leg…
danpetry Jan 24, 2025
10bfd83
Revert "Use unittest-xml-reporting instead of the historical xmlrunner"
danpetry Jan 24, 2025
46f4e8e
appease linter
danpetry Jan 24, 2025
c1c1e6c
Merge branch 'main' into anaconda-sync
h-vetinari Jan 25, 2025
3a34b59
remove obsolete fmt handling in bld.bat
h-vetinari Jan 26, 2025
e19e11c
add pybind11 as a run-dependency of pytorch
h-vetinari Jan 26, 2025
5f19e7f
build non-CUDA builds on CPU agents
h-vetinari Jan 26, 2025
f6bbd00
MNT: Re-rendered with conda-build 25.1.1, conda-smithy 3.45.4, and co…
h-vetinari Jan 26, 2025
9864e70
Combine header messages into one
danpetry Jan 27, 2025
a002741
Change blas_impl if-else block into a case block instead
danpetry Jan 27, 2025
226f526
Correct cpu/gpu build config
danpetry Jan 27, 2025
ad37dec
MNT: Re-rendered with conda-build 25.1.1, conda-smithy 3.45.4, and co…
danpetry Jan 27, 2025
59af084
Revert "Correct cpu/gpu build config"
danpetry Jan 27, 2025
78b5aca
Run all linux builds on a gpu machine
danpetry Jan 27, 2025
db810d0
MNT: Re-rendered with conda-build 25.1.1, conda-smithy 3.45.4, and co…
danpetry Jan 27, 2025
a623264
update comment about `-std=c++<ver>` flag
h-vetinari Jan 27, 2025
e44b0d5
limit torch.backends CUDA availability tests to linux64
h-vetinari Jan 27, 2025
415a628
Revert change to hand TORCH_CUDA_ARCH_LIST as an environment variable…
danpetry Jan 28, 2025
0a2094f
set CMAKE_INSTALL_PREFIX; used in some installation commands
h-vetinari Jan 28, 2025
3889dee
fix install location of DLLs in CMake metadata; add test
h-vetinari Jan 28, 2025
982cadf
unset CMAKE_INSTALL_PREFIX again; instead, patch ATEN_INCLUDE_DIR
h-vetinari Jan 28, 2025
4683abe
distinguish destinations between lib & bin on windows
h-vetinari Jan 28, 2025
e91c713
do not modify destination for `install(FILES`
h-vetinari Jan 28, 2025
46d06c1
back to deleting DESTINATION, but only for TARGETS
h-vetinari Jan 28, 2025
cdabb36
remove Caffee2 from cmake_test; imported through torch anyway
h-vetinari Jan 28, 2025
89d7354
Skip tests failing due to unsupported GPUs [ci skip] ***NO_CI***
danpetry Jan 28, 2025
8a92b36
backport patch for skipping some inducer test failures
h-vetinari Jan 28, 2025
8338fd7
add cuda compiler for CMake tests of CUDA-enabled libtorch
h-vetinari Jan 29, 2025
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
10 changes: 10 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ setlocal enabledelayedexpansion
REM remove pyproject.toml to avoid installing deps from pip
if EXIST pyproject.toml DEL pyproject.toml

:: The PyTorch test suite includes some symlinks, which aren't resolved on Windows, leading to packaging errors.
:: ATTN! These change and have to be updated manually, often with each release.
:: (no current symlinks being packaged. Leaving this information here as it took some months to find the issue. Look out
:: for a failure with error message: "conda_package_handling.exceptions.ArchiveCreationError: <somefile> Cannot stat
:: while writing file")

set TH_BINARY_BUILD=1
set PYTORCH_BUILD_VERSION=%PKG_VERSION%
:: Always pass 0 to avoid appending ".post" to version string.
Expand Down Expand Up @@ -106,6 +112,10 @@ if not "%cuda_compiler_version%" == "None" (

set DISTUTILS_USE_SDK=1

:: Use our Pybind11, Eigen
set USE_SYSTEM_PYBIND11=1
set USE_SYSTEM_EIGEN_INSTALL=1

set CMAKE_INCLUDE_PATH=%LIBRARY_PREFIX%\include
set LIB=%LIBRARY_PREFIX%\lib;%LIB%

Expand Down
45 changes: 40 additions & 5 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ echo "=== Building ${PKG_NAME} (py: ${PY_VER}) ==="

set -ex

echo "####################################################################"
echo "Building PyTorch using BLAS implementation: $blas_impl "
echo "####################################################################"

# This is used to detect if it's in the process of building pytorch
export IN_PYTORCH_BUILD=1

Expand All @@ -20,9 +24,21 @@ rm -rf pyproject.toml
export USE_CUFILE=0
export USE_NUMA=0
export USE_ITT=0

#################### ADJUST COMPILER AND LINKER FLAGS #####################
# Pytorch's build system doesn't like us setting the c++ standard and will
# issue a warning:
# https://github.com/pytorch/pytorch/blob/3beb7006dd5a415dfa236081ad5d55ae38346324/CMakeLists.txt#L41
export CXXFLAGS="$(echo $CXXFLAGS | sed 's/-std=c++[0-9][0-9]//g')"
# The below three lines expose symbols that would otherwise be hidden or
# optimised away. They were here before, so removing them would potentially
# break users' programs
export CFLAGS="$(echo $CFLAGS | sed 's/-fvisibility-inlines-hidden//g')"
export CXXFLAGS="$(echo $CXXFLAGS | sed 's/-fvisibility-inlines-hidden//g')"
export LDFLAGS="$(echo $LDFLAGS | sed 's/-Wl,--as-needed//g')"
# The default conda LDFLAGs include -Wl,-dead_strip_dylibs, which removes all the
# MKL sequential, core, etc. libraries, resulting in a "Symbol not found: _mkl_blas_caxpy"
# error on osx-64.
export LDFLAGS="$(echo $LDFLAGS | sed 's/-Wl,-dead_strip_dylibs//g')"
export LDFLAGS_LD="$(echo $LDFLAGS_LD | sed 's/-dead_strip_dylibs//g')"
if [[ "$c_compiler" == "clang" ]]; then
Expand All @@ -45,6 +61,7 @@ fi
# can be imported on system without a GPU
LDFLAGS="${LDFLAGS//-Wl,-z,now/-Wl,-z,lazy}"

################ CONFIGURE CMAKE FOR CONDA ENVIRONMENT ###################
export CMAKE_GENERATOR=Ninja
export CMAKE_LIBRARY_PATH=$PREFIX/lib:$PREFIX/include:$CMAKE_LIBRARY_PATH
export CMAKE_PREFIX_PATH=$PREFIX
Expand All @@ -62,6 +79,7 @@ done
CMAKE_FIND_ROOT_PATH+=";$SRC_DIR"
unset CMAKE_INSTALL_PREFIX
export TH_BINARY_BUILD=1
# Use our build version and number for inserting into binaries
export PYTORCH_BUILD_VERSION=$PKG_VERSION
# Always pass 0 to avoid appending ".post" to version string.
# https://github.com/conda-forge/pytorch-cpu-feedstock/issues/315
Expand All @@ -74,6 +92,8 @@ export USE_SYSTEM_SLEEF=1
# use our protobuf
export BUILD_CUSTOM_PROTOBUF=OFF
rm -rf $PREFIX/bin/protoc
export USE_SYSTEM_PYBIND11=1
export USE_SYSTEM_EIGEN_INSTALL=1
Comment on lines +92 to +93
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens to the PyTorch vendored copies of these when using the system copies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It ignores them: pybind11 eigen

Although in the case of eigen it will use the vendored one if it doesn't find the system one, rather than erroring, which can mean accidental vendoring if you don't look at the logs carefully, which isn't great IMHO

Copy link
Contributor Author

@danpetry danpetry Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a patch to prevent this for mkl but I thought it best to look at the blas/openmp stuff closer and maybe address in a different PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you ok with this?


# prevent six from being downloaded
> third_party/NNPACK/cmake/DownloadSix.cmake
Expand All @@ -99,16 +119,23 @@ if [[ "${CI}" == "github_actions" ]]; then
# reduce parallelism to avoid getting OOM-killed on
# cirun-openstack-gpu-2xlarge, which has 32GB RAM, 8 CPUs
export MAX_JOBS=4
else
elif [[ "${CI}" == "azure" ]]; then
export MAX_JOBS=${CPU_COUNT}
else
# Leave a spare core for other tasks. This may need to be reduced further
# if we get out of memory errors.
export MAX_JOBS=$((CPU_COUNT > 1 ? CPU_COUNT - 1 : 1))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if CPU_COUNT is undefined or empty string?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What CI provider do things run on for anaconda? I think it might need to become specific to that, and not in the overall else: clause here. Our OSX builds on azure work are successful withing the 6h limit, but seem to fail with this PR. This is a likely culprit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's AWS. Happy to just leave it as-is. I think originally we had it maxed at four cores and then increased it to CPU_COUNT-1 because of common practice and a desire to speed things up rather than concrete technical reasons. We can leave this as-is and if we have issues our end solve them later

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed our case in 6074128, so I have no objection to doing what helps you in the else: branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have made this a default in the else branch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that CPU_COUNT is a passthrough environment variable

So one can set this in their CI scripts to the intended value and conda-build will use it. This is what conda-forge does

Instead of adding this to the build recipe, would recommend doing this in Anaconda's CI scripts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CPU_COUNT isn't being set here. If it's set (somewhere else, like in CI as you suggest) then it'll be used to set MAX_JOBS. If it's not set, this expression will evaluate to 1

fi

if [[ "$blas_impl" == "generic" ]]; then
# Fake openblas
export BLAS=OpenBLAS
export OpenBLAS_HOME=${PREFIX}
else
elif [[ "$blas_impl" == "mkl" ]]; then
export BLAS=MKL
else
echo "[ERROR] Unsupported BLAS implementation '${blas_impl}'" >&2
exit 1
fi

if [[ "$PKG_NAME" == "pytorch" ]]; then
Expand Down Expand Up @@ -164,12 +191,19 @@ elif [[ ${cuda_compiler_version} != "None" ]]; then
echo "unknown CUDA arch, edit build.sh"
exit 1
esac
# Warning from pytorch v1.12.1: In the future we will require one to
# explicitly pass TORCH_CUDA_ARCH_LIST to cmake instead of implicitly
# setting it as an env variable.
#
# See:
# https://pytorch.org/docs/stable/cpp_extension.html (Compute capabilities)
# https://github.com/pytorch/pytorch/blob/main/.ci/manywheel/build_cuda.sh
case ${cuda_compiler_version} in
12.6)
export TORCH_CUDA_ARCH_LIST="5.0;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0+PTX"
;;
*)
echo "unsupported cuda version. edit build.sh"
echo "No CUDA architecture list exists for CUDA v${cuda_compiler_version}. See build.sh for information on adding one."
exit 1
esac
export TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
Expand Down Expand Up @@ -204,15 +238,16 @@ case ${PKG_NAME} in

mv build/lib.*/torch/bin/* ${PREFIX}/bin/
mv build/lib.*/torch/lib/* ${PREFIX}/lib/
mv build/lib.*/torch/share/* ${PREFIX}/share/
# need to merge these now because we're using system pybind11, meaning the destination directory is not empty
rsync -a build/lib.*/torch/share/* ${PREFIX}/share/
mv build/lib.*/torch/include/{ATen,caffe2,tensorpipe,torch,c10} ${PREFIX}/include/
rm ${PREFIX}/lib/libtorch_python.*

# Keep the original backed up to sed later
cp build/CMakeCache.txt build/CMakeCache.txt.orig
;;
pytorch)
$PREFIX/bin/python -m pip install . --no-deps -vvv --no-clean \
$PREFIX/bin/python -m pip install . --no-deps --no-build-isolation -vvv --no-clean \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we sync these flags across calls and Windows? Seems they vary a bit

Idk whether it is worth it, but we could also consider using script_env to set most of these flags once and reuse them throughout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for windows we've got

%PYTHON% -m pip %PIP_ACTION% . --no-build-isolation --no-deps -vvv --no-clean

and unix

$PREFIX/bin/python -m pip install . --no-deps --no-build-isolation -vvv --no-clean

So the same AFAICS?
Keeping them here seems more in line with what people will expect given other feedstocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any further comments?

| sed "s,${CXX},\$\{CXX\},g" \
| sed "s,${PREFIX},\$\{PREFIX\},g"
# Keep this in ${PREFIX}/lib so that the library can be found by
Expand Down
47 changes: 45 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{% set version = "2.5.1" %}
{% set build = 9 %}

# Use a higher build number for the CUDA variant, to ensure that it's
# preferred by conda's solver, and it's preferentially
# installed where the platform supports it.
{% if cuda_compiler_version != "None" %}
{% set build = build + 200 %}
{% endif %}
Expand Down Expand Up @@ -63,6 +66,7 @@ source:
- patches/0014-Fix-FindOpenBLAS.patch
# backport https://github.com/pytorch/pytorch/pull/138095
- patches/0015-CD-Enable-Python-3.13-on-windows-138095.patch
- patches/0016-use-prefix-include-for-inductor.patch

build:
number: {{ build }}
Expand Down Expand Up @@ -166,6 +170,8 @@ requirements:
- libuv
- pkg-config # [unix]
- typing_extensions
- pybind11
- eigen
run:
# GPU requirements without run_exports
- {{ pin_compatible('cudnn') }} # [cuda_compiler_version != "None"]
Expand Down Expand Up @@ -304,6 +310,8 @@ outputs:
- pkg-config # [unix]
- typing_extensions
- {{ pin_subpackage('libtorch', exact=True) }}
- pybind11
- eigen
run:
- llvm-openmp # [osx]
- intel-openmp {{ mkl }} # [win]
Expand Down Expand Up @@ -348,7 +356,8 @@ outputs:
- pydot
- pip
- expecttest
- xmlrunner
# unittest-xml-reporting supersedes xmlrunner
- unittest-xml-reporting
# Required by run_test.py
- pytest-flakefinder
- pytest-rerunfailures
Expand All @@ -365,13 +374,23 @@ outputs:
# tools/ is needed to optimise test run
# as of pytorch=2.0.0, there is a bug when trying to run tests without the tools
- tools
- .ci/pytorch/smoke_test/smoke_test.py
commands:
# Run pip check so as to ensure that all pytorch packages are installed
# https://github.com/conda-forge/pytorch-cpu-feedstock/issues/24
- pip check
- python -c "import torch; print(torch.__version__)"
- python -c "import torch; assert torch.backends.mkldnn.m.is_available()" # [x86 and cuda_compiler_version == "None"]
- python -c "import torch; torch.tensor(1).to('cpu').numpy(); print('numpy support enabled!!!')"
# We have had issues with openmp .dylibs being doubly loaded in certain cases. These two tests catch the (observed) issue
- python -c "import torch; import numpy"
- python -c "import numpy; import torch"
# distributed support is enabled by default on linux; for mac, we enable it manually in build.sh
- python -c "import torch; assert torch.distributed.is_available()" # [linux or osx]
- python -c "import torch; assert torch.backends.cuda.is_built()" # [(cuda_compiler_version != "None")]
- python -c "import torch; assert torch.backends.cudnn.is_available()" # [(cuda_compiler_version != "None")]
- python -c "import torch; assert torch.cuda.is_available()" # [(cuda_compiler_version != "None")]
- python -c "import torch; assert torch.backends.cudnn.enabled" # [(cuda_compiler_version != "None")]
# At conda-forge, we target versions of OSX that are too old for MPS support
# But if users install a newer version of OSX, they will have MPS support
# https://github.com/conda-forge/pytorch-cpu-feedstock/pull/123#issuecomment-1186355073
Expand All @@ -380,6 +399,29 @@ outputs:
# python-version-specific library (default location in SP_DIR symlinks back to this)
- test -f $PREFIX/lib/libtorch_python${SHLIB_EXT} # [unix]

# the smoke test script takes a bunch of env variables, defined below
- set MATRIX_GPU_ARCH_VERSION="{{ '.'.join(cuda_compiler_version.split('.')[:2]) }}" # [(cuda_compiler_version != "None") and (win)]
- set MATRIX_GPU_ARCH_TYPE="cuda" # [(gpu_variant or "").startswith("cuda") and (win)]
- set MATRIX_GPU_ARCH_VERSION="none" # [(cuda_compiler_version == "None") and (win)]
- set MATRIX_GPU_ARCH_TYPE="none" # [(cuda_compiler_version == "None") and (win)]
- set MATRIX_CHANNEL="defaults" # [win]
- set MATRIX_STABLE_VERSION={{ version }} # [win]
- set MATRIX_PACKAGE_TYPE="conda" # [win]
- set TARGET_OS="windows" # [win]
- set OMP_NUM_THREADS=4 # [win]
- export MATRIX_GPU_ARCH_VERSION="{{ '.'.join(cuda_compiler_version.split('.')[:2]) }}" # [(cuda_compiler_version != "None") and (linux and x86_64)]
- export MATRIX_GPU_ARCH_TYPE="cuda" # [(cuda_compiler_version != "None") and (linux and x86_64)]
- export MATRIX_GPU_ARCH_VERSION="none" # [(cuda_compiler_version == "None") and (not win)]
- export MATRIX_GPU_ARCH_TYPE="none" # [(cuda_compiler_version == "None") and (not win)]
- export MATRIX_CHANNEL="defaults" # [not win]
- export MATRIX_STABLE_VERSION="{{ version }}" # [not win]
- export MATRIX_PACKAGE_TYPE="conda" # [not win]
- export TARGET_OS="linux" # [linux]
- export TARGET_OS="macos-arm64" # [(osx and arm64)]
- export TARGET_OS="macos-x86_64" # [(osx and x86_64)]
- export OMP_NUM_THREADS=4 # [not win]
- python ./smoke_test/smoke_test.py --package torchonly

# a reasonably safe subset of tests that should run under 15 minutes
# disable hypothesis because it randomly yields health check errors
{% set tests = " ".join([
Expand All @@ -392,6 +434,8 @@ outputs:
"test/test_nn.py",
"test/test_torch.py",
"test/test_xnnpack_integration.py",
# The inductor tests test torch.compile
"test/inductor/test_torchinductor.py", # [cuda_compiler_version != "None"]
"-m \"not hypothesis\"",
]) %}

Expand Down Expand Up @@ -476,7 +520,6 @@ about:
license_file:
- LICENSE
- NOTICE
- third_party/pybind11/LICENSE
summary: PyTorch is an optimized tensor library for deep learning using GPUs and CPUs.

extra:
Expand Down
16 changes: 16 additions & 0 deletions recipe/patches/0016-use-prefix-include-for-inductor.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Currently inductor doesn't look in conda's includes and libs. This results in errors when it tries to compile, if system versions are being used of dependencies (e.g., sleef).

author: [email protected]

Index: pytorch/torch/_inductor/cpp_builder.py
===================================================================
--- pytorch.orig/torch/_inductor/cpp_builder.py 2024-12-16 15:16:47.074821258 -0600
+++ pytorch/torch/_inductor/cpp_builder.py 2024-12-16 15:17:33.922130106 -0600
@@ -1055,6 +1055,7 @@
+ python_include_dirs
+ torch_include_dirs
+ omp_include_dir_paths
+ + [os.getenv('CONDA_PREFIX') + '/include']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glancing through the source code, it looks inductor accepts an include_dirs flag, which comes from a JSON config file

Could we just add our own JSON config file?

Seems this may be needed in other contexts as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inductor takes the compile_flags.json file for its AOT mode (handled in package.py), but not for its JIT mode. This is the problem the patch is solving - making it look in prefix/include during JIT (torch.compile) compilation. Probably in AOT mode the user wants to specify their own compile flags for their platform, which is what this json file is for.

The code you're looking at is where the AOT code is initializing the base class (BuildOptionsBase). However, we want to initialize the include directories in the child CppTorchOptions class, which is instantiated in cpu_vec_isa.py. It was a while ago I wrote this patch but IIRC that was the path in the stack trace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this check out ok for you?

)
cflags = sys_libs_cflags + omp_cflags
ldflags = omp_ldflags
Loading