Skip to content

enable python 3.13t (freethreading) in binary validation workflow #3049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

TroyGarden
Copy link
Contributor

Summary:

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 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
conda create -n py313 python=3.13 python-freethreading -c conda-forge

Differential Revision: D76109652

Summary:

# context
* torchrec github actions re-uses lots of workflows from pytorch-test-infra
* in the build-wheels-linux it disables rocm
```
  generate-matrix:
    uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
    with:
      package-type: wheel
      os: linux
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
      with-rocm: false
```
* but in the validate-binaries it uses default, which generates rocm arch for testing
```
  validate-binaries:
    uses: pytorch/test-infra/.github/workflows/validate-domain-library.yml@main
    with:
      package_type: "wheel"
      os: "linux"
      channel: ${{ inputs.channel }}
      repository: "pytorch/torchrec"
      smoke_test: "source ./.github/scripts/validate_binaries.sh"
      with_cuda: enable
      with_rocm: false <---- this line is added by this diff
```
* since there's no ROCM support so the validate_binaries.sh script has to do an early return
```
if [[ ${MATRIX_GPU_ARCH_TYPE} = 'rocm' ]]; then
    echo "We don't support rocm"
    exit 0
fi
```
WARNING: although the validate-binaries.sh script does early return but it still consume github runner to set up the docker and so. Pure waste of resources.
* this entire thing is unnecessary if we just exclude ROCM arch in the config

Reviewed By: aporialiao

Differential Revision: D76107773
Summary:
# 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 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
```

Differential Revision: D76109652
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 6, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76109652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants