Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
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
19 changes: 19 additions & 0 deletions check_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,22 @@ if [[ "$DESIRED_CUDA" != 'cpu' && "$DESIRED_CUDA" != *"rocm"* ]]; then
popd
fi # if libtorch
fi # if cuda

###############################################################################
# Check PyTorch supports TCP_TLS gloo transport
###############################################################################

if [[ "$(uname)" == 'Linux' && "$PACKAGE_TYPE" != 'libtorch' ]]; then
GLOO_CHECK="import torch.distributed as dist
try:
dist.init_process_group('gloo', rank=0, world_size=1)
except RuntimeError as e:
print(e)
"
RESULT=`GLOO_DEVICE_TRANSPORT=TCP_TLS MASTER_ADDR=localhost MASTER_PORT=63945 python -c "$GLOO_CHECK"`
GLOO_TRANSPORT_IS_NOT_SUPPORTED='gloo transport is not supported'
if [[ "$RESULT" =~ "$GLOO_TRANSPORT_IS_NOT_SUPPORTED" ]]; then
echo "PyTorch doesn't support TLS_TCP transport, please build with USE_GLOO_WITH_OPENSSL=1"
exit 1
fi
fi
5 changes: 5 additions & 0 deletions conda/build_pytorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ else
export CONDA_BUILD_EXTRA_ARGS=""
fi

# Build PyTorch with Gloo's TCP_TLS transport
if [[ "$(uname)" == 'Linux' ]]; then
export USE_GLOO_WITH_OPENSSL=1
fi

# Loop through all Python versions to build a package for each
for py_ver in "${DESIRED_PYTHON[@]}"; do
build_string="py${py_ver}_${build_string_suffix}"
Expand Down
1 change: 1 addition & 0 deletions conda/pytorch-nightly/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ build:
- DEVELOPER_DIR
- DEBUG
- USE_FBGEMM
- USE_GLOO_WITH_OPENSSL # [unix]
- USE_SCCACHE # [win]
- USE_DISTRIBUTED # [unix]
- CMAKE_OSX_ARCHITECTURES # [unix]
Expand Down