Skip to content

Remove torchdata==0.9.0 pin and torchtext as deprecated (#4849) #4860

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

Merged
merged 3 commits into from
Aug 8, 2025
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
16 changes: 0 additions & 16 deletions .github/workflows/e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ jobs:
# cmake<4.0.0 is required as a workaround for CMake Error at third_party/double-conversion/CMakeLists.txt:1 (cmake_minimum_required)
pip install wheel 'cmake<4.0.0'
# https://github.com/pytorch/data/blob/e316c5ca1ab2a4f69dd6d48e8fc9c6f8d0c7c468/README.md?plain=1#L6-L15
- name: Install pinned torchdata
run: |
pip install torchdata==0.9.0
- name: Setup PyTorch
uses: ./.github/actions/setup-pytorch
with:
Expand All @@ -105,7 +100,6 @@ jobs:
cd pytorch
echo "BENCHMARK_COMMIT_ID=$(<.github/ci_commit_pins/torchbench.txt)" | tee -a "$GITHUB_ENV"
echo "TORCHVISION_COMMIT_ID=$(<.github/ci_commit_pins/vision.txt)" | tee -a "$GITHUB_ENV"
echo "TORCHTEXT_COMMIT_ID=$(<.github/ci_commit_pins/text.txt)" | tee -a "$GITHUB_ENV"
echo "TORCHAUDIO_COMMIT_ID=$(<.github/ci_commit_pins/audio.txt)" | tee -a "$GITHUB_ENV"
echo "TRANSFORMERS_VERSION=$(<.ci/docker/ci_commit_pins/huggingface.txt)" | tee -a "$GITHUB_ENV"
echo "TIMM_COMMIT_ID=$(<.ci/docker/ci_commit_pins/timm.txt)" | tee -a "$GITHUB_ENV"
Expand Down Expand Up @@ -163,15 +157,6 @@ jobs:
ref: ${{ env.TORCHVISION_COMMIT_ID }}
extra-cache-key: ${{ env.PYTORCH_VERSION }}

- name: Install torchtext package
if: ${{ inputs.suite == 'torchbench' }}
uses: ./.github/actions/install-dependency
with:
package: torchtext
repository: pytorch/text
ref: ${{ env.TORCHTEXT_COMMIT_ID }}
extra-cache-key: ${{ env.PYTORCH_VERSION }}

- name: Install torchaudio package
if: ${{ inputs.suite == 'torchbench' }}
uses: ./.github/actions/install-dependency
Expand Down Expand Up @@ -273,7 +258,6 @@ jobs:
TRITON_REPO=$GITHUB_REPOSITORY
TRITON_COMMIT_ID=$GITHUB_SHA
TORCHVISION_COMMIT_ID=$TORCHVISION_COMMIT_ID
TORCHTEXT_COMMIT_ID=$TORCHTEXT_COMMIT_ID
TORCHAUDIO_COMMIT_ID=$TORCHAUDIO_COMMIT_ID
TRANSFORMERS_VERSION=$TRANSFORMERS_VERSION
TIMM_COMMIT_ID=$TIMM_COMMIT_ID
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/e2e-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ jobs:
cd c:/pytorch
echo "BENCHMARK_COMMIT_ID=$(<.github/ci_commit_pins/torchbench.txt)" | tee -a "$GITHUB_ENV"
echo "TORCHVISION_COMMIT_ID=$(<.github/ci_commit_pins/vision.txt)" | tee -a "$GITHUB_ENV"
echo "TORCHTEXT_COMMIT_ID=$(<.github/ci_commit_pins/text.txt)" | tee -a "$GITHUB_ENV"
echo "TORCHAUDIO_COMMIT_ID=$(<.github/ci_commit_pins/audio.txt)" | tee -a "$GITHUB_ENV"
echo "TRANSFORMERS_VERSION=$(<.ci/docker/ci_commit_pins/huggingface.txt)" | tee -a "$GITHUB_ENV"
echo "TIMM_COMMIT_ID=$(<.ci/docker/ci_commit_pins/timm.txt)" | tee -a "$GITHUB_ENV"
Expand Down Expand Up @@ -237,7 +236,6 @@ jobs:
TRITON_REPO=$GITHUB_REPOSITORY
TRITON_COMMIT_ID=$GITHUB_SHA
TORCHVISION_COMMIT_ID=$TORCHVISION_COMMIT_ID
TORCHTEXT_COMMIT_ID=$TORCHTEXT_COMMIT_ID
TORCHAUDIO_COMMIT_ID=$TORCHAUDIO_COMMIT_ID
TRANSFORMERS_VERSION=$TRANSFORMERS_VERSION
TIMM_COMMIT_ID=$TIMM_COMMIT_ID
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/nightly-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,13 @@ jobs:
# cmake 3.22.1 does not work with the recent torchaudio: https://github.com/intel/intel-xpu-backend-for-triton/issues/2079
pip install wheel cmake
# https://github.com/pytorch/data/blob/e316c5ca1ab2a4f69dd6d48e8fc9c6f8d0c7c468/README.md?plain=1#L6-L15
- name: Install pinned torchdata
run: |
pip install torchdata==0.9.0
- name: Setup PyTorch
uses: ./.github/actions/setup-pytorch

- name: Identify pinned versions
run: |
cd pytorch
echo "TORCHVISION_COMMIT_ID=$(<.github/ci_commit_pins/vision.txt)" | tee -a $GITHUB_ENV
echo "TORCHTEXT_COMMIT_ID=$(<.github/ci_commit_pins/text.txt)" | tee -a $GITHUB_ENV
echo "TORCHAUDIO_COMMIT_ID=$(<.github/ci_commit_pins/audio.txt)" | tee -a $GITHUB_ENV
echo "TRANSFORMERS_VERSION=$(<.ci/docker/ci_commit_pins/huggingface.txt)" | tee -a $GITHUB_ENV
echo "TIMM_COMMIT_ID=$(<.ci/docker/ci_commit_pins/timm.txt)" | tee -a $GITHUB_ENV
Expand All @@ -85,14 +79,6 @@ jobs:
ref: ${{ env.TORCHVISION_COMMIT_ID }}
extra-cache-key: ${{ env.PYTORCH_VERSION }}

- name: Install torchtext package
uses: ./.github/actions/install-dependency
with:
package: torchtext
repository: pytorch/text
ref: ${{ env.TORCHTEXT_COMMIT_ID }}
extra-cache-key: ${{ env.PYTORCH_VERSION }}

- name: Install torchaudio package
uses: ./.github/actions/install-dependency
with:
Expand Down Expand Up @@ -124,7 +110,6 @@ jobs:
cp -L pytorch/dist/*.whl wheels/
cp -L dist/*.whl wheels/
cp -L torchvision*/dist/*.whl wheels/
cp -L torchtext*/dist/*.whl wheels/
cp -L torchaudio*/dist/*.whl wheels/
cp -L timm*/dist/*.whl wheels/
cp -L transformers*/dist/*.whl wheels/
Expand All @@ -148,7 +133,6 @@ jobs:
TRITON_REPO=intel/intel-xpu-backend-for-triton
TRITON_COMMIT_ID=$TRITON_COMMIT_ID
TORCHVISION_COMMIT_ID=$TORCHVISION_COMMIT_ID
TORCHTEXT_COMMIT_ID=$TORCHTEXT_COMMIT_ID
TORCHAUDIO_COMMIT_ID=$TORCHAUDIO_COMMIT_ID
EOF
Expand Down
7 changes: 6 additions & 1 deletion python/test/unit/language/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,12 @@ def kernel(X, Z, BLOCK: tl.constexpr):
# input
rs = RandomState(17)
# limit the range of integers so that the sum does not overflow
x = numpy_random((shape, ), dtype_str=dtype_str, rs=rs)
if dtype_str in integral_dtypes:
low = 0 if dtype_str in uint_dtypes else -100
high = 100
x = numpy_random((shape, ), dtype_str=dtype_str, rs=rs, low=low, high=high)
else:
x = numpy_random((shape, ), dtype_str=dtype_str, rs=rs)
numpy_op = {
'sum': np.sum,
'max': np.max,
Expand Down
4 changes: 2 additions & 2 deletions scripts/install-pytorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fi
############################################################################
# Check installed torch pinned dependencies

PINNED_TORCH_DEPENDENCIES_REGEX="^torchtext==|^torchaudio==|^torchvision=="
PINNED_TORCH_DEPENDENCIES_REGEX="^torchaudio==|^torchvision=="
INSTALLED_PINNED_TORCH_DEPENDENCIES=$(pip list --format=freeze | grep -iE "$PINNED_TORCH_DEPENDENCIES_REGEX" || true)

if [ -n "$INSTALLED_PINNED_TORCH_DEPENDENCIES" ]; then
Expand All @@ -104,7 +104,7 @@ if [ -n "$INSTALLED_PINNED_TORCH_DEPENDENCIES" ]; then
echo "**** INFO: PyTorch pinned dependencies build from source mode is not supported. ****"
exit 1
fi
pip uninstall -y torchtext torchaudio torchvision
pip uninstall -y torchaudio torchvision
fi

############################################################################
Expand Down
2 changes: 1 addition & 1 deletion scripts/patch-pytorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ apply_patch() {
echo "Applying PyTorch patches in $REPO_ROOT"

# put your patch applies here
apply_patch https://github.com/pytorch/pytorch/pull/143553.diff
# apply_patch https://github.com/pytorch/pytorch/pull/143553.diff
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code takes changes online and is now incompatible with the old Pytorch. Considering that it is only needed for our dev CI, I think it is ok to disable this patch so as not to change PyTorch version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand, why we no longer need changes from pytorch/pytorch#143553? Are we able to perform flex attention testing without?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we able to perform flex attention testing without?

No, but it's not needed for PyTorch 2.8 (note: the changes will be merged into release/3.4.x branch). The idea is to make changes (only needed for wheel build) that PyTorch can accept without acceptance testing.

The next step is to update Triton pin in PyTorch using our main branch. With changes for Flex Attn etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icic, didn't notice the base of this PR is release/3.4.0

apply_patch pytorch_fp64.patch