Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 9 additions & 4 deletions dev-tools/docker/linux_aarch64_native_image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,15 @@ RUN \
export PYTORCH_BUILD_NUMBER=1 && \
export MAX_JOBS=10 && \
/usr/local/bin/python3.12 setup.py install && \
mkdir /usr/local/gcc133/include/pytorch && \
cp -r torch/include/* /usr/local/gcc133/include/pytorch/ && \
cp torch/lib/libtorch_cpu.so /usr/local/gcc133/lib && \
cp torch/lib/libc10.so /usr/local/gcc133/lib && \
# Recent PyTorch redirects `setup.py install` to `pip install .`, which installs the
# torch package (headers + libs) into site-packages rather than leaving them in the
# source tree (see pytorch/pytorch#152276). Resolve the installed package location so
# this works whether the build is in-tree (older tags) or a wheel install (newer).
TORCH_DIR=$(/usr/local/bin/python3.12 -c "import sysconfig, os; print(os.path.join(sysconfig.get_paths()['platlib'], 'torch'))") && \
mkdir -p /usr/local/gcc133/include/pytorch && \
cp -r "${TORCH_DIR}"/include/* /usr/local/gcc133/include/pytorch/ && \
cp "${TORCH_DIR}"/lib/libtorch_cpu.so /usr/local/gcc133/lib && \
cp "${TORCH_DIR}"/lib/libc10.so /usr/local/gcc133/lib && \
Comment thread
edsavage marked this conversation as resolved.
cd .. && \
rm -rf pytorch /tmp/*

Expand Down
13 changes: 9 additions & 4 deletions dev-tools/docker/linux_image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,15 @@ RUN \
export PYTORCH_BUILD_NUMBER=1 && \
export MAX_JOBS=10 && \
/usr/local/bin/python3.12 setup.py install && \
mkdir /usr/local/gcc133/include/pytorch && \
cp -r torch/include/* /usr/local/gcc133/include/pytorch/ && \
cp torch/lib/libtorch_cpu.so /usr/local/gcc133/lib && \
cp torch/lib/libc10.so /usr/local/gcc133/lib && \
# Recent PyTorch redirects `setup.py install` to `pip install .`, which installs the
# torch package (headers + libs) into site-packages rather than leaving them in the
# source tree (see pytorch/pytorch#152276). Resolve the installed package location so
# this works whether the build is in-tree (older tags) or a wheel install (newer).
TORCH_DIR=$(/usr/local/bin/python3.12 -c "import sysconfig, os; print(os.path.join(sysconfig.get_paths()['platlib'], 'torch'))") && \
mkdir -p /usr/local/gcc133/include/pytorch && \
cp -r "${TORCH_DIR}"/include/* /usr/local/gcc133/include/pytorch/ && \
cp "${TORCH_DIR}"/lib/libtorch_cpu.so /usr/local/gcc133/lib && \
cp "${TORCH_DIR}"/lib/libc10.so /usr/local/gcc133/lib && \
Comment thread
edsavage marked this conversation as resolved.
cd .. && \
rm -rf pytorch /tmp/*

Expand Down
11 changes: 8 additions & 3 deletions dev-tools/docker/pytorch_linux_image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,15 @@ RUN --mount=type=secret,id=gcs_key \
/usr/local/bin/python3.12 -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org -r requirements.txt && \
/usr/local/bin/python3.12 setup.py install && \
if command -v sccache &>/dev/null && sccache --show-stats &>/dev/null; then sccache --show-stats; sccache --stop-server; fi && \
# Recent PyTorch redirects `setup.py install` to `pip install .`, which installs the
# torch package (headers + libs) into site-packages rather than leaving them in the
# source tree (see pytorch/pytorch#152276). Resolve the installed package location so
# this works whether the build is in-tree (older tags) or a wheel install (newer).
TORCH_DIR=$(/usr/local/bin/python3.12 -c "import sysconfig, os; print(os.path.join(sysconfig.get_paths()['platlib'], 'torch'))") && \
mkdir -p /usr/local/gcc133/include/pytorch && \
/bin/cp -rf torch/include/* /usr/local/gcc133/include/pytorch/ && \
/bin/cp -f torch/lib/libtorch_cpu.so /usr/local/gcc133/lib && \
/bin/cp -f torch/lib/libc10.so /usr/local/gcc133/lib && \
/bin/cp -rf "${TORCH_DIR}"/include/* /usr/local/gcc133/include/pytorch/ && \
/bin/cp -f "${TORCH_DIR}"/lib/libtorch_cpu.so /usr/local/gcc133/lib && \
/bin/cp -f "${TORCH_DIR}"/lib/libc10.so /usr/local/gcc133/lib && \
cd .. && \
rm -rf pytorch

Expand Down
Loading