Skip to content

Change schema of efficient_attention_forward_ck to have optional tens… #767

Change schema of efficient_attention_forward_ck to have optional tens…

Change schema of efficient_attention_forward_ck to have optional tens… #767

Workflow file for this run

name: wheels
on:
pull_request:
paths:
- ".github/compute_wheel_version.py"
- ".github/workflows/wheel*"
- ".github/actions/setup-build-cuda/action.yml"
- "setup.py"
- "requirements*.txt"
push:
branches:
- main
tags:
- "v[0-9]+*"
jobs:
target_determinator:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
shell: python
run: |
import os
import json
import itertools
environ = os.environ
# All builds are python-version agnostic,
# and built with python 3.9
PYTHON_VERSION = "3.9"
# NOTE: Don't forget to update `upload_pt`'s matrix
# when changing the CUDA/ROCM versions below!
CU_VERSIONS = ['118', '126', '128']
ROCM_VERSIONS = ["6.2.4", "6.3"]
include = []
for os in ['8-core-ubuntu', 'windows-8-core']:
for torch_version in ['2.7.0']:
# CUDA builds
for cuda_short_version in CU_VERSIONS:
if cuda_short_version < "124" and "windows" in os:
print("Windows builder no longer compatible with cu<124")
continue
include.append(dict(
os=os,
python=PYTHON_VERSION,
torch_version=torch_version,
toolkit_type="cuda",
toolkit_short_version=cuda_short_version,
))
print(include[-1])
# ROCM builds
for rocm_short_version in ROCM_VERSIONS:
if os == 'windows-8-core':
continue
include.append(dict(
os="16-core-ubuntu", # use for ROCm wheels only to avoid CI timeouts
python=PYTHON_VERSION,
torch_version=torch_version,
toolkit_type="rocm",
toolkit_short_version=rocm_short_version,
))
print(include[-1])
matrix = {'include': include}
print(json.dumps(matrix))
with open(environ["GITHUB_OUTPUT"], "a") as fd:
fd.write("matrix="+json.dumps(matrix))
build:
needs: target_determinator
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.target_determinator.outputs.matrix) }}
uses: ./.github/workflows/wheels_build.yml
if: github.repository == 'facebookresearch/xformers' || github.event_name == 'pull_request'
with:
os: ${{ matrix.os }}
python: ${{ matrix.python }}
torch_version: ${{ matrix.torch_version }}
toolkit_type: ${{ matrix.toolkit_type }}
toolkit_short_version: ${{ matrix.toolkit_short_version }}
upload_pip:
needs: build
uses: ./.github/workflows/wheels_upload_pip.yml
with:
twine_username: __token__
filter: "*torch2.7.0+cu126*"
execute: ${{ github.repository == 'facebookresearch/xformers' && github.event_name != 'pull_request' }}
secrets:
twine_password: ${{ secrets.PYPI_TOKEN }}
upload_pt:
needs: build
strategy:
fail-fast: false
matrix:
suffix:
- cu118
- cu126
- cu128
- rocm6.2.4
- rocm6.3
uses: ./.github/workflows/wheels_upload_s3.yml
with:
aws_role: "arn:aws:iam::749337293305:role/pytorch_bot_uploader_role"
s3_path: s3://pytorch/whl/${{ matrix.suffix }}/
aws_s3_cp_extra_args: --acl public-read
filter: "*torch2.7.0+${{ matrix.suffix }}*"
execute: ${{ github.repository == 'facebookresearch/xformers' && github.ref_type == 'tag' }}