Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 8337f03

Browse files
authored
Merge pull request #59 from pjh5/nightly_name
Support for different package names in build*.sh
2 parents ee53cda + 72ac07b commit 8337f03

File tree

2 files changed

+41
-8
lines changed

2 files changed

+41
-8
lines changed

manywheel/build.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
set -ex
44

5-
export PYTORCH_BUILD_VERSION=0.4.1
6-
export PYTORCH_BUILD_NUMBER=2
5+
if [[ -z "$PYTORCH_BUILD_VERSION" ]]; then
6+
export PYTORCH_BUILD_VERSION=0.4.1
7+
fi
8+
if [[ -z "$PYTORCH_BUILD_NUMBER" ]]; then
9+
export PYTORCH_BUILD_NUMBER=2
10+
fi
711
export CMAKE_LIBRARY_PATH="/opt/intel/lib:/lib:$CMAKE_LIBRARY_PATH"
812
export CMAKE_INCLUDE_PATH="/opt/intel:$CMAKE_INCLUDE_PATH"
913
export TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
@@ -59,6 +63,7 @@ for (( i=0; i<"${#DESIRED_PYTHON[@]}"; i++ )); do
5963
done
6064
echo "Will build for all Pythons: ${DESIRED_PYTHON[@]}"
6165

66+
6267
# ########################################################
6368
# # Compile wheels
6469
# #######################################################
@@ -281,12 +286,26 @@ cp /$WHEELHOUSE_DIR/torch*.whl /remote/$WHEELHOUSE_DIR/
281286
rm -rf /usr/local/cuda*
282287
rm -rf /opt/rh
283288

289+
# The package's name that we made could be torch-nightly
290+
if [[ -n "$TORCH_PACKAGE_NAME" ]]; then
291+
package_name="$TORCH_PACKAGE_NAME"
292+
else
293+
package_name='torch'
294+
fi
295+
echo "Expecting the built wheels to be packages for '$package_name'"
296+
297+
298+
# Test that all the wheels work
284299
export OMP_NUM_THREADS=4 # on NUMA machines this takes too long
285300
pushd $PYTORCH_DIR/test
286301
for PYDIR in "${DESIRED_PYTHON[@]}"; do
287-
"${PYDIR}/bin/pip" uninstall -y torch
288-
"${PYDIR}/bin/pip" install torch --no-index -f /$WHEELHOUSE_DIR
302+
"${PYDIR}/bin/pip" uninstall -y "$package_name"
303+
"${PYDIR}/bin/pip" install "$package_name" --no-index -f /$WHEELHOUSE_DIR
289304
LD_LIBRARY_PATH="/usr/local/nvidia/lib64" PYCMD=$PYDIR/bin/python $PYDIR/bin/python run_test.py --exclude distributed
305+
306+
# Distributed tests are not expected to work on shared GPU machines (as of
307+
# 8/06/2018) so the errors from test_distributed are ignored. Expected
308+
# errors include socket addresses already being used.
290309
set +e
291310
LD_LIBRARY_PATH="/usr/local/nvidia/lib64" PYCMD=$PYDIR/bin/python $PYDIR/bin/python run_test.py -i distributed
292311
set -e

manywheel/build_cpu.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
set -ex
44

5-
export PYTORCH_BUILD_VERSION=0.4.1
6-
export PYTORCH_BUILD_NUMBER=2
5+
if [[ -z "$PYTORCH_BUILD_VERSION" ]]; then
6+
export PYTORCH_BUILD_VERSION=0.4.1
7+
fi
8+
if [[ -z "$PYTORCH_BUILD_NUMBER" ]]; then
9+
export PYTORCH_BUILD_NUMBER=2
10+
fi
711
export TH_BINARY_BUILD=1
812
export NO_CUDA=1
913
export CMAKE_LIBRARY_PATH="/opt/intel/lib:/lib:$CMAKE_LIBRARY_PATH"
@@ -208,10 +212,20 @@ cp /$WHEELHOUSE_DIR/torch*.whl /remote/$WHEELHOUSE_DIR/
208212
# remove stuff before testing
209213
rm -rf /opt/rh
210214

215+
# The package's name that we made could be torch-nightly
216+
if [[ -n "$TORCH_PACKAGE_NAME" ]]; then
217+
package_name="$TORCH_PACKAGE_NAME"
218+
else
219+
package_name='torch'
220+
fi
221+
echo "Expecting the built wheels to be packages for '$package_name'"
222+
223+
224+
# Test that all the wheels work
211225
export OMP_NUM_THREADS=4 # on NUMA machines this takes too long
212226
pushd $PYTORCH_DIR/test
213227
for PYDIR in "${DESIRED_PYTHON[@]}"; do
214-
"${PYDIR}/bin/pip" uninstall -y torch
215-
"${PYDIR}/bin/pip" install torch --no-index -f /$WHEELHOUSE_DIR
228+
"${PYDIR}/bin/pip" uninstall -y "$package_name"
229+
"${PYDIR}/bin/pip" install "$package_name" --no-index -f /$WHEELHOUSE_DIR
216230
LD_LIBRARY_PATH="/usr/local/nvidia/lib64" PYCMD=$PYDIR/bin/python $PYDIR/bin/python run_test.py
217231
done

0 commit comments

Comments
 (0)