Skip to content

Commit 515b97b

Browse files
TroyGardenfacebook-github-bot
authored andcommitted
enable python 3.13t (freethreading) in binary validation workflow (#3049)
Summary: Pull Request resolved: #3049 # context * python 3.13t was never supported in the github "binary validation" workflow due to lack of conda native support ``` $ conda create -n py313t python=3.13t Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed PackagesNotFoundError: The following packages are not available from current channels: - python=3.13t Current channels: - https://repo.anaconda.com/pkgs/main/linux-64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/r/linux-64 - https://repo.anaconda.com/pkgs/r/noarch To search for alternate channels that may provide the conda package you're looking for, navigate to https://anaconda.org and use the search bar at the top of the page. ``` * therefore previously the validation workflow for python3.13t is alway skipped (early return) ``` if [[ ${MATRIX_PYTHON_VERSION} = '3.13t' ]]; then echo "Conda doesn't support 3.13t yet, you can just try \`conda create -n test python=3.13t\`" exit 0 fi ``` * the workaround is to use conda-forge channel to get the freethreading python https://conda-forge.org/blog/2024/09/26/python-313/ ``` conda create -n py313 python=3.13 python-freethreading -c conda-forge ``` Reviewed By: iamzainhuda Differential Revision: D76109652 fbshipit-source-id: d711832ff7e5b9a6725aefd6cb66c6fabd5a2c6b
1 parent 3dbdf4a commit 515b97b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ export PYTORCH_CUDA_PKG=""
1010
export CONDA_ENV="build_binary"
1111

1212
if [[ ${MATRIX_PYTHON_VERSION} = '3.13t' ]]; then
13-
echo "Conda doesn't support 3.13t yet, you can just try \`conda create -n test python=3.13t\`"
14-
exit 0
13+
# use conda-forge to install python3.13t
14+
conda create -y -n "${CONDA_ENV}" python="3.13" python-freethreading -c conda-forge
15+
conda run -n "${CONDA_ENV}" python -c "import sys; print(f'python GIL enabled: {sys._is_gil_enabled()}')"
16+
else
17+
conda create -y -n "${CONDA_ENV}" python="${MATRIX_PYTHON_VERSION}"
1518
fi
1619

17-
conda create -y -n "${CONDA_ENV}" python="${MATRIX_PYTHON_VERSION}"
18-
19-
conda run -n build_binary python --version
20+
conda run -n "${CONDA_ENV}" python --version
2021

2122
# Install pytorch, torchrec and fbgemm as per
2223
# installation instructions on following page
@@ -83,7 +84,7 @@ conda run -n "${CONDA_ENV}" pip install fbgemm-gpu --index-url "$PYTORCH_URL"
8384
conda run -n "${CONDA_ENV}" pip install torchmetrics==1.0.3
8485

8586
# install tensordict from pypi
86-
conda run -n "${CONDA_ENV}" pip install tensordict==0.7.1
87+
conda run -n "${CONDA_ENV}" pip install tensordict==0.8.1
8788

8889
# install torchrec
8990
conda run -n "${CONDA_ENV}" pip install torchrec --index-url "$PYTORCH_URL"

0 commit comments

Comments
 (0)