Compare commits

..

1 Commits

Author SHA1 Message Date
7fd3a2cf43 [Dynamo] Support for proxying frozen dataclasses
ghstack-source-id: fb6556cd2f9424fe223147471fe95126441954d9
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134846
2024-09-01 13:30:12 -07:00
609 changed files with 12861 additions and 24211 deletions

View File

@ -236,7 +236,7 @@ case "$image" in
TRITON=yes
;;
pytorch-linux-focal-py3-clang10-onnx)
ANACONDA_PYTHON_VERSION=3.9
ANACONDA_PYTHON_VERSION=3.8
CLANG_VERSION=10
PROTOBUF=yes
DB=yes
@ -245,7 +245,7 @@ case "$image" in
ONNX=yes
;;
pytorch-linux-focal-py3-clang9-android-ndk-r21e)
ANACONDA_PYTHON_VERSION=3.9
ANACONDA_PYTHON_VERSION=3.8
CLANG_VERSION=9
LLVMDEV=yes
PROTOBUF=yes
@ -254,8 +254,8 @@ case "$image" in
GRADLE_VERSION=6.8.3
NINJA_VERSION=1.9.0
;;
pytorch-linux-focal-py3.9-clang10)
ANACONDA_PYTHON_VERSION=3.9
pytorch-linux-focal-py3.8-clang10)
ANACONDA_PYTHON_VERSION=3.8
CLANG_VERSION=10
PROTOBUF=yes
DB=yes
@ -276,8 +276,8 @@ case "$image" in
CONDA_CMAKE=yes
TRITON=yes
;;
pytorch-linux-focal-py3.9-gcc9)
ANACONDA_PYTHON_VERSION=3.9
pytorch-linux-focal-py3.8-gcc9)
ANACONDA_PYTHON_VERSION=3.8
GCC_VERSION=9
PROTOBUF=yes
DB=yes
@ -318,8 +318,8 @@ case "$image" in
CONDA_CMAKE=yes
TRITON=yes
;;
pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks)
ANACONDA_PYTHON_VERSION=3.9
pytorch-linux-jammy-py3.8-gcc11-inductor-benchmarks)
ANACONDA_PYTHON_VERSION=3.8
GCC_VERSION=11
PROTOBUF=yes
DB=yes
@ -330,8 +330,8 @@ case "$image" in
DOCS=yes
INDUCTOR_BENCHMARKS=yes
;;
pytorch-linux-jammy-cuda11.8-cudnn9-py3.9-clang12)
ANACONDA_PYTHON_VERSION=3.9
pytorch-linux-jammy-cuda11.8-cudnn9-py3.8-clang12)
ANACONDA_PYTHON_VERSION=3.8
CUDA_VERSION=11.8
CUDNN_VERSION=9
CLANG_VERSION=12
@ -355,8 +355,8 @@ case "$image" in
CONDA_CMAKE=yes
VISION=yes
;;
pytorch-linux-jammy-py3.9-gcc11)
ANACONDA_PYTHON_VERSION=3.9
pytorch-linux-jammy-py3.8-gcc11)
ANACONDA_PYTHON_VERSION=3.8
GCC_VERSION=11
PROTOBUF=yes
DB=yes

View File

@ -108,10 +108,10 @@ ENV CMAKE_C_COMPILER cc
ENV CMAKE_CXX_COMPILER c++
COPY ./common/install_triton.sh install_triton.sh
COPY ./common/common_utils.sh common_utils.sh
COPY ci_commit_pins/triton.txt triton.txt
COPY ci_commit_pins/triton-rocm.txt triton-rocm.txt
COPY triton_version.txt triton_version.txt
RUN if [ -n "${TRITON}" ]; then bash ./install_triton.sh; fi
RUN rm install_triton.sh common_utils.sh triton.txt triton_version.txt
RUN rm install_triton.sh common_utils.sh triton-rocm.txt triton_version.txt
# Install AOTriton (Early fail)
COPY ./aotriton_version.txt aotriton_version.txt

View File

@ -1 +1 @@
cd1c833b079adb324871dcbbe75b43d42ffc0ade
69472e5c43481324ad923ceb29392ab72830acee

View File

@ -1 +1 @@
461c12871f336fe6f57b55d6a297f13ef209161b
340136fec6d3ebc73e7a19eba1663e9b0ba8ab2d

View File

@ -0,0 +1 @@
21eae954efa5bf584da70324b640288c3ee7aede

View File

@ -1 +1 @@
cc981feba10a3f4c2e46f3fe368e8fcf5f5643df
1b2f15840e0d70eec50d84c7a0575cb835524def

View File

@ -1 +1 @@
757b6a61e7df814ba806f498f8bb3160f84b120c
dedb7bdf339a3546896d4820366ca562c586bfa0

View File

@ -15,7 +15,7 @@ pip_install \
flatbuffers==2.0 \
mock==5.0.1 \
ninja==1.10.2 \
networkx==2.5 \
networkx==2.0 \
numpy==1.24.2
# ONNXRuntime should be installed before installing
@ -30,9 +30,10 @@ pip_install \
pip_install coloredlogs packaging
pip_install onnxruntime==1.18.1
pip_install onnx==1.16.2
pip_install onnxscript==0.1.0.dev20240831 --no-deps
pip_install onnxruntime==1.18
pip_install onnx==1.16.0
# pip_install "onnxscript@git+https://github.com/microsoft/onnxscript@3e869ef8ccf19b5ebd21c10d3e9c267c9a9fa729" --no-deps
pip_install onnxscript==0.1.0.dev20240613 --no-deps
# required by onnxscript
pip_install ml_dtypes

View File

@ -12,7 +12,10 @@ conda_reinstall() {
as_jenkins conda install -q -n py_$ANACONDA_PYTHON_VERSION -y --force-reinstall $*
}
if [ -n "${XPU_VERSION}" ]; then
if [ -n "${ROCM_VERSION}" ]; then
TRITON_REPO="https://github.com/openai/triton"
TRITON_TEXT_FILE="triton-rocm"
elif [ -n "${XPU_VERSION}" ]; then
TRITON_REPO="https://github.com/intel/intel-xpu-backend-for-triton"
TRITON_TEXT_FILE="triton-xpu"
else

View File

@ -30,14 +30,9 @@ dill==0.3.7
#Pinned versions: 0.3.7
#test that import: dynamo/test_replay_record.py test_dataloader.py test_datapipe.py test_serialization.py
expecttest==0.2.1
expecttest==0.1.6
#Description: method for writing tests where test framework auto populates
# the expected output based on previous runs
#Pinned versions: 0.2.1
#test that import:
fbscribelogger==0.1.6
#Description: write to scribe from authenticated jobs on CI
#Pinned versions: 0.1.6
#test that import:
@ -109,7 +104,7 @@ networkx==2.8.8
#test that import: run_test.py, test_cpp_extensions_aot.py,test_determination.py
numba==0.49.0 ; python_version < "3.9"
numba==0.55.2 ; python_version == "3.9"
numba==0.54.1 ; python_version == "3.9"
numba==0.55.2 ; python_version == "3.10"
#Description: Just-In-Time Compiler for Numerical Functions
#Pinned versions: 0.54.1, 0.49.0, <=0.49.1

View File

@ -100,10 +100,10 @@ ARG TRITON
# try to reach out to S3, which docker build runners don't have access
COPY ./common/install_triton.sh install_triton.sh
COPY ./common/common_utils.sh common_utils.sh
COPY ci_commit_pins/triton.txt triton.txt
COPY ci_commit_pins/triton-rocm.txt triton-rocm.txt
COPY triton_version.txt triton_version.txt
RUN if [ -n "${TRITON}" ]; then bash ./install_triton.sh; fi
RUN rm install_triton.sh common_utils.sh triton.txt triton_version.txt
RUN rm install_triton.sh common_utils.sh triton-rocm.txt triton_version.txt
# Install AOTriton
COPY ./aotriton_version.txt aotriton_version.txt

View File

@ -285,8 +285,9 @@ else
if [[ "$BUILD_ENVIRONMENT" != *rocm* &&
"$BUILD_ENVIRONMENT" != *xla* ]]; then
if [[ "$BUILD_ENVIRONMENT" != *py3.8* ]]; then
# Install numpy-2.0.2 for builds which are backward compatible with 1.X
python -mpip install --pre numpy==2.0.2
# Install numpy-2.0 release candidate for builds
# Which should be backward compatible with Numpy-1.X
python -mpip install --pre numpy==2.0.0rc1
fi
WERROR=1 python setup.py clean

View File

@ -596,9 +596,6 @@ test_single_dynamo_benchmark() {
test_inductor_micro_benchmark() {
TEST_REPORTS_DIR=$(pwd)/test/test-reports
if [[ "${TEST_CONFIG}" == *cpu* ]]; then
test_inductor_set_cpu_affinity
fi
python benchmarks/gpt_fast/benchmark.py --output "${TEST_REPORTS_DIR}/gpt_fast_benchmark.csv"
}
@ -1482,7 +1479,7 @@ elif [[ "${TEST_CONFIG}" == *inductor* ]]; then
install_torchvision
test_inductor_shard "${SHARD_NUMBER}"
if [[ "${SHARD_NUMBER}" == 1 ]]; then
if [[ "${BUILD_ENVIRONMENT}" != linux-jammy-py3.9-gcc11-build ]]; then
if [[ "${BUILD_ENVIRONMENT}" != linux-jammy-py3.8-gcc11-build ]]; then
test_inductor_distributed
fi
fi

View File

@ -24,12 +24,6 @@ call %INSTALLER_DIR%\install_sccache.bat
if errorlevel 1 goto fail
if not errorlevel 0 goto fail
if "%USE_XPU%"=="1" (
:: Install xpu support packages
call %INSTALLER_DIR%\install_xpu.bat
if errorlevel 1 exit /b 1
)
:: Miniconda has been installed as part of the Windows AMI with all the dependencies.
:: We just need to activate it here
call %INSTALLER_DIR%\activate_miniconda3.bat
@ -49,16 +43,6 @@ if "%VC_VERSION%" == "" (
)
if errorlevel 1 goto fail
if not errorlevel 0 goto fail
if "%USE_XPU%"=="1" (
:: Activate xpu environment - VS env is required for xpu
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
if errorlevel 1 exit /b 1
:: Reduce build time. Only have MTL self-hosted runner now
SET TORCH_XPU_ARCH_LIST=xe-lpg
SET USE_KINETO=0
)
@echo on
popd

View File

@ -1,91 +0,0 @@
@echo on
REM Description: Install Intel Support Packages on Windows
REM BKM reference: https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpu/2-5.html
set XPU_INSTALL_MODE=%~1
if "%XPU_INSTALL_MODE%"=="" goto xpu_bundle_install_start
if "%XPU_INSTALL_MODE%"=="bundle" goto xpu_bundle_install_start
if "%XPU_INSTALL_MODE%"=="driver" goto xpu_driver_install_start
if "%XPU_INSTALL_MODE%"=="all" goto xpu_driver_install_start
:arg_error
echo Illegal XPU installation mode. The value can be "bundle"/"driver"/"all"
echo If keep the value as space, will use default "bundle" mode
exit /b 1
:xpu_driver_install_start
:: TODO Need more testing for driver installation
set XPU_DRIVER_LINK=https://downloadmirror.intel.com/830975/gfx_win_101.5972.exe
curl -o xpu_driver.exe --retry 3 --retry-all-errors -k %XPU_DRIVER_LINK%
echo "XPU Driver installing..."
start /wait "Intel XPU Driver Installer" "xpu_driver.exe"
if errorlevel 1 exit /b 1
del xpu_driver.exe
if "%XPU_INSTALL_MODE%"=="driver" goto xpu_install_end
:xpu_bundle_install_start
set XPU_BUNDLE_PARENT_DIR=C:\Program Files (x86)\Intel\oneAPI
set XPU_BUNDLE_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/9d1a91e2-e8b8-40a5-8c7f-5db768a6a60c/w_intel-for-pytorch-gpu-dev_p_0.5.3.37_offline.exe
set XPU_PTI_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/9d1a91e2-e8b8-40a5-8c7f-5db768a6a60c/w_intel-pti-dev_p_0.9.0.37_offline.exe
set XPU_BUNDLE_VERSION=0.5.3+31
set XPU_PTI_VERSION=0.9.0+36
set XPU_BUNDLE_PRODUCT_NAME=intel.oneapi.win.intel-for-pytorch-gpu-dev.product
set XPU_PTI_PRODUCT_NAME=intel.oneapi.win.intel-pti-dev.product
set XPU_BUNDLE_INSTALLED=0
set XPU_PTI_INSTALLED=0
set XPU_BUNDLE_UNINSTALL=0
set XPU_PTI_UNINSTALL=0
:: Check if XPU bundle is target version or already installed
if exist "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" goto xpu_bundle_ver_check
goto xpu_bundle_install
:xpu_bundle_ver_check
"%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" --list-products > xpu_bundle_installed_ver.log
for /f "tokens=1,2" %%a in (xpu_bundle_installed_ver.log) do (
if "%%a"=="%XPU_BUNDLE_PRODUCT_NAME%" (
echo %%a Installed Version: %%b
set XPU_BUNDLE_INSTALLED=1
if not "%XPU_BUNDLE_VERSION%"=="%%b" (
start /wait "Installer Title" "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" --action=remove --eula=accept --silent --product-id %XPU_BUNDLE_PRODUCT_NAME% --product-ver %%b --log-dir uninstall_bundle
set XPU_BUNDLE_UNINSTALL=1
)
)
if "%%a"=="%XPU_PTI_PRODUCT_NAME%" (
echo %%a Installed Version: %%b
set XPU_PTI_INSTALLED=1
if not "%XPU_PTI_VERSION%"=="%%b" (
start /wait "Installer Title" "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" --action=remove --eula=accept --silent --product-id %XPU_PTI_PRODUCT_NAME% --product-ver %%b --log-dir uninstall_bundle
set XPU_PTI_UNINSTALL=1
)
)
)
if errorlevel 1 exit /b 1
if exist xpu_bundle_installed_ver.log del xpu_bundle_installed_ver.log
if "%XPU_BUNDLE_INSTALLED%"=="0" goto xpu_bundle_install
if "%XPU_BUNDLE_UNINSTALL%"=="1" goto xpu_bundle_install
if "%XPU_PTI_INSTALLED%"=="0" goto xpu_pti_install
if "%XPU_PTI_UNINSTALL%"=="1" goto xpu_pti_install
goto xpu_install_end
:xpu_bundle_install
curl -o xpu_bundle.exe --retry 3 --retry-all-errors -k %XPU_BUNDLE_URL%
echo "XPU Bundle installing..."
start /wait "Intel Pytorch Bundle Installer" "xpu_bundle.exe" --action=install --eula=accept --silent --log-dir install_bundle
if errorlevel 1 exit /b 1
del xpu_bundle.exe
:xpu_pti_install
curl -o xpu_pti.exe --retry 3 --retry-all-errors -k %XPU_PTI_URL%
echo "XPU PTI installing..."
start /wait "Intel PTI Installer" "xpu_pti.exe" --action=install --eula=accept --silent --log-dir install_bundle
if errorlevel 1 exit /b 1
del xpu_pti.exe
:xpu_install_end

View File

@ -40,9 +40,6 @@ python -m pip install pytest-rerunfailures==10.3 pytest-cpp==2.3.0 tensorboard==
# Install Z3 optional dependency for Windows builds.
python -m pip install z3-solver==4.12.2.0
# Install tlparse for test\dynamo\test_structured_trace.py UTs.
python -m pip install tlparse==0.3.25
run_tests() {
# Run nvidia-smi if available
for path in '/c/Program Files/NVIDIA Corporation/NVSMI/nvidia-smi.exe' /c/Windows/System32/nvidia-smi.exe; do

View File

@ -119,11 +119,6 @@ fi
# Test the package
/builder/check_binary.sh
if [[ "\$GPU_ARCH_TYPE" != *s390x* && "\$GPU_ARCH_TYPE" != *xpu* && "\$GPU_ARCH_TYPE" != *rocm* && "$PACKAGE_TYPE" != libtorch ]]; then
# Exclude s390, xpu, rocm and libtorch builds from smoke testing
python /builder/test/smoke_test/smoke_test.py --package=torchonly --torch-compile-check disabled
fi
# Clean temp files
cd /builder && git clean -ffdx

View File

@ -90,7 +90,7 @@ fi
if [[ "$PACKAGE_TYPE" =~ .*wheel.* && -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*rocm.* && $(uname) == "Linux" ]]; then
TRITON_REQUIREMENT="pytorch-triton-rocm==${TRITON_VERSION}; ${TRITON_CONSTRAINT}"
if [[ -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*dev.* ]]; then
TRITON_SHORTHASH=$(cut -c1-10 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt)
TRITON_SHORTHASH=$(cut -c1-10 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt)
TRITON_REQUIREMENT="pytorch-triton-rocm==${TRITON_VERSION}+${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
fi
if [[ -z "${PYTORCH_EXTRA_INSTALL_REQUIREMENTS:-}" ]]; then

View File

@ -10,11 +10,6 @@ export SCCACHE_BUCKET=ossci-compiler-cache
export SCCACHE_IGNORE_SERVER_IO_ERROR=1
export VC_YEAR=2019
if [[ "$DESIRED_CUDA" == 'xpu' ]]; then
export VC_YEAR=2022
export USE_SCCACHE=0
fi
echo "Free space on filesystem before build:"
df -h

View File

@ -6,10 +6,6 @@ source "${BINARY_ENV_FILE:-/c/w/env}"
export CUDA_VERSION="${DESIRED_CUDA/cu/}"
export VC_YEAR=2019
if [[ "$DESIRED_CUDA" == 'xpu' ]]; then
export VC_YEAR=2022
fi
pushd "$BUILDER_ROOT"
./windows/internal/smoke_test.bat

View File

@ -3,6 +3,8 @@ self-hosted-runner:
# GitHub hosted x86 Linux runners
- linux.20_04.4x
- linux.20_04.16x
# Repo-specific LF hosted ARC runners
- linux.large.arc
# Organization-wide AWS Linux Runners
- linux.large
- linux.2xlarge

View File

@ -31,10 +31,6 @@
- "module: flex attention"
then:
- "module: higher order operators"
- any:
- "module: aotinductor"
then:
- "oncall: export"
- any:
- "module: dynamo"
- "module: pt2-dispatcher"

View File

@ -107,8 +107,8 @@
mandatory_checks_name:
- EasyCLA
- Lint
- pull / linux-focal-py3_9-clang9-xla / build
- pull / linux-focal-py3_9-clang9-xla / test (xla, 1, 1, linux.12xlarge)
- pull / linux-focal-py3_8-clang9-xla / build
- pull / linux-focal-py3_8-clang9-xla / test (xla, 1, 1, linux.12xlarge)
- name: Documentation
patterns:

View File

@ -9,7 +9,6 @@ ciflow_push_tags:
- ciflow/inductor-rocm
- ciflow/inductor-perf-compare
- ciflow/inductor-micro-benchmark
- ciflow/inductor-micro-benchmark-cpu-x86
- ciflow/inductor-cu124
- ciflow/linux-aarch64
- ciflow/mps

View File

@ -1,7 +1,6 @@
boto3==1.19.12
hypothesis==6.56.4
expecttest==0.2.1
fbscribelogger==0.1.6
expecttest==0.1.6
librosa>=0.6.2
mpmath==1.3.0
networkx==2.8.7

View File

@ -15,7 +15,9 @@ REPO_DIR = SCRIPT_DIR.parent.parent
def read_triton_pin(device: str = "cuda") -> str:
triton_file = "triton.txt"
if device == "xpu":
if device == "rocm":
triton_file = "triton-rocm.txt"
elif device == "xpu":
triton_file = "triton-xpu.txt"
with open(REPO_DIR / ".ci" / "docker" / "ci_commit_pins" / triton_file) as f:
return f.read().strip()

View File

@ -325,7 +325,6 @@ def generate_wheels_matrix(
os: str,
arches: Optional[List[str]] = None,
python_versions: Optional[List[str]] = None,
use_split_build: bool = False,
) -> List[Dict[str, str]]:
package_type = "wheel"
if os == "linux" or os == "linux-aarch64" or os == "linux-s390x":
@ -341,7 +340,7 @@ def generate_wheels_matrix(
if os == "linux":
arches += CPU_CXX11_ABI_ARCH + CUDA_ARCHES + ROCM_ARCHES + XPU_ARCHES
elif os == "windows":
arches += CUDA_ARCHES + XPU_ARCHES
arches += CUDA_ARCHES
elif os == "linux-aarch64":
# Only want the one arch as the CPU type is different and
# uses different build/test scripts
@ -372,17 +371,7 @@ def generate_wheels_matrix(
) and python_version == "3.13":
continue
if use_split_build and (
arch_version not in ["12.4", "12.1", "11.8", "cpu"] or os != "linux"
):
raise RuntimeError(
"Split build is only supported on linux with cuda 12.4, 12.1, 11.8, and cpu.\n"
f"Currently attempting to build on arch version {arch_version} and os {os}.\n"
"Please modify the matrix generation to exclude this combination."
)
# 12.1 linux wheels require PYTORCH_EXTRA_INSTALL_REQUIREMENTS to install
if (
arch_version in ["12.4", "12.1", "11.8"]
and os == "linux"
@ -396,7 +385,6 @@ def generate_wheels_matrix(
"desired_cuda": translate_desired_cuda(
gpu_arch_type, gpu_arch_version
),
"use_split_build": "True" if use_split_build else "False",
"devtoolset": (
"cxx11-abi" if arch_version == "cuda-aarch64" else ""
),
@ -412,8 +400,7 @@ def generate_wheels_matrix(
),
}
)
# Special build building to use on Colab. PyThon 3.10 for 12.1 CUDA
if python_version == "3.10" and arch_version == "12.1":
if arch_version != "cuda-aarch64":
ret.append(
{
"python_version": python_version,
@ -422,16 +409,40 @@ def generate_wheels_matrix(
"desired_cuda": translate_desired_cuda(
gpu_arch_type, gpu_arch_version
),
"use_split_build": "True" if use_split_build else "False",
"use_split_build": "True",
"devtoolset": "",
"container_image": WHEEL_CONTAINER_IMAGES[arch_version],
"package_type": package_type,
"pytorch_extra_install_requirements": "",
"build_name": f"{package_type}-py{python_version}-{gpu_arch_type}{gpu_arch_version}-full".replace( # noqa: B950
"pytorch_extra_install_requirements": (
PYTORCH_EXTRA_INSTALL_REQUIREMENTS[arch_version] # fmt: skip
if os != "linux-aarch64"
else ""
),
"build_name": f"{package_type}-py{python_version}-{gpu_arch_type}{gpu_arch_version}-split".replace( # noqa: B950
".", "_"
),
}
)
# Special build building to use on Colab. PyThon 3.10 for 12.1 CUDA
if python_version == "3.10" and arch_version == "12.1":
ret.append(
{
"python_version": python_version,
"gpu_arch_type": gpu_arch_type,
"gpu_arch_version": gpu_arch_version,
"desired_cuda": translate_desired_cuda(
gpu_arch_type, gpu_arch_version
),
"use_split_build": "False",
"devtoolset": "",
"container_image": WHEEL_CONTAINER_IMAGES[arch_version],
"package_type": package_type,
"pytorch_extra_install_requirements": "",
"build_name": f"{package_type}-py{python_version}-{gpu_arch_type}{gpu_arch_version}-full".replace( # noqa: B950
".", "_"
),
}
)
else:
ret.append(
{
@ -441,7 +452,6 @@ def generate_wheels_matrix(
"desired_cuda": translate_desired_cuda(
gpu_arch_type, gpu_arch_version
),
"use_split_build": "True" if use_split_build else "False",
"devtoolset": (
"cxx11-abi" if arch_version == "cpu-cxx11-abi" else ""
),
@ -452,12 +462,11 @@ def generate_wheels_matrix(
),
"pytorch_extra_install_requirements": (
PYTORCH_EXTRA_INSTALL_REQUIREMENTS["12.1"] # fmt: skip
if os != "linux" and gpu_arch_type != "xpu"
if os != "linux"
else ""
),
}
)
return ret

View File

@ -61,7 +61,6 @@ class BinaryBuildWorkflow:
# Mainly for macos
cross_compile_arm64: bool = False
macos_runner: str = "macos-14-xlarge"
use_split_build: bool = False
def __post_init__(self) -> None:
if self.abi_version:
@ -76,11 +75,6 @@ class BinaryBuildWorkflow:
GITHUB_DIR
/ f"workflows/generated-{self.build_environment}-{self.branches}.yml"
)
if self.use_split_build:
output_file_path = (
GITHUB_DIR
/ f"workflows/generated-{self.build_environment}-{self.branches}-split.yml"
)
with open(output_file_path, "w") as output_file:
GENERATED = "generated" # Note that please keep the variable GENERATED otherwise phabricator will hide the whole file
output_file.writelines([f"# @{GENERATED} DO NOT EDIT MANUALLY\n"])
@ -116,20 +110,6 @@ LINUX_BINARY_BUILD_WORFKLOWS = [
isolated_workflow=True,
),
),
BinaryBuildWorkflow(
os=OperatingSystem.LINUX,
package_type="manywheel",
build_configs=generate_binary_build_matrix.generate_wheels_matrix(
OperatingSystem.LINUX,
use_split_build=True,
arches=["11.8", "12.1", "12.4", "cpu"],
),
ciflow_config=CIFlowConfig(
labels={LABEL_CIFLOW_BINARIES, LABEL_CIFLOW_BINARIES_WHEEL},
isolated_workflow=True,
),
use_split_build=True,
),
BinaryBuildWorkflow(
os=OperatingSystem.LINUX,
package_type="conda",
@ -182,21 +162,6 @@ LINUX_BINARY_SMOKE_WORKFLOWS = [
),
branches="main",
),
BinaryBuildWorkflow(
os=OperatingSystem.LINUX,
package_type="manywheel",
build_configs=generate_binary_build_matrix.generate_wheels_matrix(
OperatingSystem.LINUX,
arches=["11.8", "12.1", "12.4"],
python_versions=["3.9"],
use_split_build=True,
),
ciflow_config=CIFlowConfig(
labels={LABEL_CIFLOW_PERIODIC},
),
branches="main",
use_split_build=True,
),
BinaryBuildWorkflow(
os=OperatingSystem.LINUX,
package_type="libtorch",

View File

@ -46,24 +46,16 @@ def gh_fetch_url_and_headers(
with urlopen(Request(url, headers=headers, data=data_, method=method)) as conn:
return conn.headers, reader(conn)
except HTTPError as err:
if (
err.code == 403
and all(
key in err.headers
for key in ["X-RateLimit-Limit", "X-RateLimit-Remaining"]
)
and int(err.headers["X-RateLimit-Remaining"]) == 0
if err.code == 403 and all(
key in err.headers for key in ["X-RateLimit-Limit", "X-RateLimit-Used"]
):
print(
f"""{url}
Rate limit exceeded:
f"""Rate limit exceeded:
Used: {err.headers['X-RateLimit-Used']}
Limit: {err.headers['X-RateLimit-Limit']}
Remaining: {err.headers['X-RateLimit-Remaining']}
Resets at: {err.headers['x-RateLimit-Reset']}"""
)
else:
print(f"Error fetching {url} {err}")
raise

View File

@ -137,14 +137,11 @@ def get_issue(gh: Github, repo: str, issue_num: int) -> Issue:
def get_potential_pr_author(
github_token: str, repo: str, username: str, ref_type: str, ref_name: str
gh: Github, repo: str, username: str, ref_type: str, ref_name: str
) -> str:
# If the trigger was a new tag added by a bot, this is a ciflow case
# Fetch the actual username from the original PR. The PR number is
# embedded in the tag name: ciflow/<name>/<pr-number>
gh = get_gh_client(github_token)
if username == "pytorch-bot[bot]" and ref_type == "tag":
split_tag = ref_name.split("/")
if (
@ -166,32 +163,23 @@ def get_potential_pr_author(
def is_exception_branch(branch: str) -> bool:
"""
Branches that get opted out of all experiments and should always use Meta runners
"""
return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"}
def get_fleet(rollout_state: str, workflow_requestors: Iterable[str]) -> str:
"""
Determines if the job should run on the LF fleet or the Meta fleet
Returns:
The appropriate label prefix for the runner, corresponding to the fleet to use.
This gets prefixed to the very start of the runner label.
"""
def get_workflow_type(issue: Issue, workflow_requestors: Iterable[str]) -> str:
try:
if rollout_state[0] == "!":
first_comment = issue.get_comments()[0].body.strip("\n\t ")
if first_comment[0] == "!":
log.info("LF Workflows are disabled for everyone. Using meta runners.")
return WORKFLOW_LABEL_META
elif rollout_state[0] == "*":
elif first_comment[0] == "*":
log.info("LF Workflows are enabled for everyone. Using LF runners.")
return WORKFLOW_LABEL_LF
else:
all_opted_in_users = {
usr_raw.strip("\n\t@ ").split(",")[0]
for usr_raw in rollout_state.split()
for usr_raw in first_comment.split()
}
opted_in_requestors = {
usr for usr in workflow_requestors if usr in all_opted_in_users
@ -215,17 +203,11 @@ def get_fleet(rollout_state: str, workflow_requestors: Iterable[str]) -> str:
def get_optin_feature(
rollout_state: str, workflow_requestors: Iterable[str], feature: str, fallback: str
issue: Issue, workflow_requestors: Iterable[str], feature: str, fallback: str
) -> str:
"""
Used to dynamically opt in jobs to specific runner-type variants.
Returns:
The runner-type's variant name if the user has opted in to the feature, otherwise returns an empty string.
This variant name is prefixed to the runner-type in the label.
"""
try:
userlist = {u.lstrip("#").strip("\n\t@ ") for u in rollout_state.split()}
first_comment = issue.get_comments()[0].body.strip("\n\t ")
userlist = {u.lstrip("#").strip("\n\t@ ") for u in first_comment.split()}
all_opted_in_users = set()
for user in userlist:
for i in user.split(","):
@ -253,17 +235,6 @@ def get_optin_feature(
return fallback
def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str:
"""
Gets the first comment of the issue, which contains the desired rollout state.
The default issue we use - https://github.com/pytorch/test-infra/issues/5132
"""
gh = get_gh_client(github_token)
issue = get_issue(gh, repo, issue_num)
return str(issue.get_comments()[0].body.strip("\n\t "))
def main() -> None:
args = parse_args()
@ -273,27 +244,25 @@ def main() -> None:
runner_ami = RUNNER_AMI_LEGACY
else:
try:
rollout_state = get_rollout_state_from_issue(
args.github_token, args.github_issue_repo, args.github_issue
)
gh = get_gh_client(args.github_token)
# The default issue we use - https://github.com/pytorch/test-infra/issues/5132
issue = get_issue(gh, args.github_issue_repo, args.github_issue)
username = get_potential_pr_author(
args.github_token,
gh,
args.github_repo,
args.github_actor,
args.github_ref_type,
args.github_branch,
)
label_type = get_fleet(
rollout_state,
label_type = get_workflow_type(
issue,
(
args.github_issue_owner,
username,
),
)
runner_ami = get_optin_feature(
rollout_state=rollout_state,
issue=issue,
workflow_requestors=(
args.github_issue_owner,
username,

View File

@ -3,7 +3,7 @@
## Install prerequisites.
```
$ sudo dnf install podman podman-docker jq
$ sudo dnf install docker
```
## Add services.
@ -27,48 +27,23 @@ $ sudo systemctl enable --now qemu-user-static
## Rebuild the image
First build s390x builder image `docker.io/pytorch/manylinuxs390x-builder`,
using following commands:
```
$ cd ~
$ git clone https://github.com/pytorch/pytorch
$ cd pytorch
$ git submodule update --init --recursive
$ GPU_ARCH_TYPE=cpu-s390x "$(pwd)/.ci/docker/manywheel/build.sh" manylinuxs390x-builder
$ docker image tag localhost/pytorch/manylinuxs390x-builder docker.io/pytorch/manylinuxs390x-builder:cpu-s390x
$ docker image save -o ~/manywheel-s390x.tar docker.io/pytorch/manylinuxs390x-builder:cpu-s390x
```
Next step is to build `actions-runner` image using:
In order to build or update the `iiilinuxibmcom/actions-runner` image, e.g. to get the
latest OS security fixes, use the following commands:
```
$ cd self-hosted-builder
$ sudo docker build \
--build-arg repo=<owner>/<name> \
--build-arg token=<***> \
--pull \
-f actions-runner.Dockerfile \
-t iiilinuxibmcom/actions-runner.<name> \
-t iiilinuxibmcom/actions-runner \
.
```
If there are failures, ensure that selinux doesn't prevent it from working.
If it fails, ensure that selinux doesn't prevent it from working.
In worst case, selinux can be disabled with `setenforce 0`.
Now prepare all necessary files for runner registration:
```
$ sudo mkdir -p /etc/actions-runner/<name>
$ sudo chmod 700 /etc/actions-runner/<name>
$ sudo /bin/cp <github_app_private_key_file> /etc/actions-runner/<name>/key_private.pem
$ sudo echo <github_app_id> | sudo tee /etc/actions-runner/<name>/appid.env
$ sudo echo <github_app_install_id> | sudo tee /etc/actions-runner/<name>/installid.env
$ sudo echo NAME=<worker_name> | sudo tee /etc/actions-runner/<name>/env
$ sudo echo ORG=<github_org> | sudo tee -a /etc/actions-runner/<name>/env
$ cd self-hosted-builder
$ sudo /bin/cp helpers/*.sh /usr/local/bin/
$ sudo chmod 755 /usr/local/bin/app_token.sh /usr/local/bin/gh_token_generator.sh
```
## Autostart the runner.
```

View File

@ -1,12 +1,12 @@
# Self-Hosted IBM Z Github Actions Runner.
# Temporary image: amd64 dependencies.
FROM docker.io/amd64/ubuntu:23.10 as ld-prefix
FROM docker.io/amd64/ubuntu:22.04 as ld-prefix
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install ca-certificates libicu72 libssl3
RUN apt-get update && apt-get -y install ca-certificates libicu70 libssl3
# Main image.
FROM docker.io/s390x/ubuntu:23.10
FROM docker.io/s390x/ubuntu:22.04
# Packages for pytorch building and testing.
ENV DEBIAN_FRONTEND=noninteractive
@ -16,7 +16,6 @@ RUN apt-get update && apt-get -y install \
gcc \
git \
jq \
zip \
libxml2-dev \
libxslt-dev \
ninja-build \
@ -44,28 +43,24 @@ COPY fs/ /
RUN chmod +x /usr/bin/actions-runner /usr/bin/entrypoint
# install podman
RUN apt -y install podman podman-docker
# amd64 Github Actions Runner.
RUN useradd -m actions-runner
USER actions-runner
WORKDIR /home/actions-runner
RUN curl -L https://github.com/actions/runner/releases/download/v2.309.0/actions-runner-linux-x64-2.309.0.tar.gz | tar -xz
# set up python virtual environment which is later used by runner.
# build workflows use "python -m pip install ...",
# and it doesn't work for non-root user
RUN virtualenv --system-site-packages venv
# repository
ARG repo
# copy prebuilt manywheel docker image for builds and tests
# build command is:
# GPU_ARCH_TYPE=cpu-s390x "$(pwd)/manywheel/build_docker.sh"
# and save command is:
# docker image save -o manywheel-s390x.tar pytorch/manylinuxs390x-builder:cpu-s390x
#
COPY --chown=actions-runner:actions-runner manywheel-s390x.tar /home/actions-runner/manywheel-s390x.tar
# repository token
ARG token
RUN curl -L https://github.com/actions/runner/releases/download/v2.317.0/actions-runner-linux-x64-2.317.0.tar.gz | tar -xz
RUN ./config.sh \
--unattended \
--url "https://github.com/${repo}" \
--token "${token}" \
--no-default-labels \
--labels self-hosted,linux.s390x
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/usr/bin/actions-runner"]

View File

@ -8,16 +8,12 @@ StartLimitIntervalSec=0
Type=simple
Restart=always
ExecStartPre=-/usr/bin/docker rm --force actions-runner.%i
ExecStartPre=-/usr/local/bin/gh_token_generator.sh /etc/actions-runner/%i/appid.env /etc/actions-runner/%i/installid.env /etc/actions-runner/%i/key_private.pem /etc/actions-runner/%i/ghtoken.env
ExecStart=/usr/bin/docker run \
--env-file=/etc/actions-runner/%i/env \
--env-file=/etc/actions-runner/%i/ghtoken.env \
--init \
--interactive \
--name=actions-runner.%i \
--rm \
--privileged \
iiilinuxibmcom/actions-runner.%i
iiilinuxibmcom/actions-runner
ExecStop=/bin/sh -c "docker exec actions-runner.%i kill -INT -- -1"
ExecStop=/bin/sh -c "docker wait actions-runner.%i"
ExecStop=/bin/sh -c "docker rm actions-runner.%i"

View File

@ -2,45 +2,5 @@
set -e -u
# first import docker image
if [ -f ./manywheel-s390x.tar ] ; then
docker image load --input manywheel-s390x.tar
docker image tag docker.io/pytorch/manylinuxs390x-builder:cpu-s390x docker.io/pytorch/manylinuxs390x-builder:cpu-s390x-main
rm -f manywheel-s390x.tar
fi
token_file=registration-token.json
# Generate registration token
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
"https://api.github.com/orgs/${ORG}/actions/runners/registration-token" \
-o "$token_file"
unset ACCESS_TOKEN
# register runner as ephemeral runner
# it does one job, stops and unregisters
registration_token=$(jq --raw-output .token "$token_file")
./config.sh \
--unattended \
--ephemeral \
--url "https://github.com/${ORG}" \
--token "${registration_token}" \
--name "${NAME}" \
--no-default-labels \
--labels self-hosted,linux.s390x
unset registration_token
rm -f "$token_file"
# enter into python virtual environment.
# build workflows use "python -m pip install ...",
# and it doesn't work for non-root user
source venv/bin/activate
# Run one job.
./run.sh
./run.sh --once

View File

@ -1,84 +0,0 @@
#!/usr/bin/env bash
#
# Request an ACCESS_TOKEN to be used by a GitHub APP
# Environment variable that need to be set up:
# * APP_ID, the GitHub's app ID
# * INSTALL_ID, the Github's app's installation ID
# * APP_PRIVATE_KEY, the content of GitHub app's private key in PEM format.
#
# https://github.com/orgs/community/discussions/24743#discussioncomment-3245300
#
set -o pipefail
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
# If URL is not github.com then use the enterprise api endpoint
if [[ ${GITHUB_HOST} = "github.com" ]]; then
URI="https://api.${_GITHUB_HOST}"
else
URI="https://${_GITHUB_HOST}/api/v3"
fi
API_VERSION=v3
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
CONTENT_LENGTH_HEADER="Content-Length: 0"
APP_INSTALLATIONS_URI="${URI}/app/installations"
# JWT parameters based off
# https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app
#
# JWT token issuance and expiration parameters
JWT_IAT_DRIFT=60
JWT_EXP_DELTA=600
JWT_JOSE_HEADER='{
"alg": "RS256",
"typ": "JWT"
}'
build_jwt_payload() {
now=$(date +%s)
iat=$((now - JWT_IAT_DRIFT))
jq -c \
--arg iat_str "${iat}" \
--arg exp_delta_str "${JWT_EXP_DELTA}" \
--arg app_id_str "${APP_ID}" \
'
($iat_str | tonumber) as $iat
| ($exp_delta_str | tonumber) as $exp_delta
| ($app_id_str | tonumber) as $app_id
| .iat = $iat
| .exp = ($iat + $exp_delta)
| .iss = $app_id
' <<< "{}" | tr -d '\n'
}
base64url() {
base64 | tr '+/' '-_' | tr -d '=\n'
}
rs256_sign() {
openssl dgst -binary -sha256 -sign <(echo "$1")
}
request_access_token() {
jwt_payload=$(build_jwt_payload)
encoded_jwt_parts=$(base64url <<<"${JWT_JOSE_HEADER}").$(base64url <<<"${jwt_payload}")
encoded_mac=$(echo -n "$encoded_jwt_parts" | rs256_sign "${APP_PRIVATE_KEY}" | base64url)
generated_jwt="${encoded_jwt_parts}.${encoded_mac}"
auth_header="Authorization: Bearer ${generated_jwt}"
app_installations_response=$(curl -sX POST \
-H "${auth_header}" \
-H "${API_HEADER}" \
--header "X-GitHub-Api-Version: 2022-11-28" \
--url "https://api.github.com/app/installations/${INSTALL_ID}/access_tokens" \
)
echo "$app_installations_response" | jq --raw-output '.token'
}
request_access_token

View File

@ -1,10 +0,0 @@
#!/usr/bin/env bash
SCRIPT_DIR=$(dirname "$0")
APP_ID=$1
INSTALL_ID=$2
APP_PRIVATE_KEY=$3
DST_FILE="$4"
ACCESS_TOKEN="$(APP_ID="$(<"${APP_ID}")" INSTALL_ID="$(<"${INSTALL_ID}")" APP_PRIVATE_KEY="$(<"${APP_PRIVATE_KEY}")" "${SCRIPT_DIR}/app_token.sh")"
echo "ACCESS_TOKEN=${ACCESS_TOKEN}" > "${DST_FILE}"

View File

@ -1,7 +1,7 @@
{%- set upload_artifact_s3_action = "seemethere/upload-artifact-s3@v5" -%}
{%- set download_artifact_s3_action = "seemethere/download-artifact-s3@v4" -%}
{%- set upload_artifact_action = "actions/upload-artifact@v4.4.0" -%}
{%- set download_artifact_action = "actions/download-artifact@v4.1.7" -%}
{%- set upload_artifact_action = "actions/upload-artifact@v3" -%}
{%- set download_artifact_action = "actions/download-artifact@v3" -%}
{%- set timeout_minutes = 240 -%}

View File

@ -101,7 +101,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: !{{ config["build_name"] }}

View File

@ -45,7 +45,7 @@
{%- if is_windows %}
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
{%- endif %}
{%- else %}

View File

@ -104,9 +104,9 @@ jobs:
- get-label-type
{%- if config["gpu_arch_type"] == "cuda" %}
{%- if branches == "nightly" %}
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
{%- else %}
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge.nonephemeral"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu.nonephemeral"
{%- endif %}
{%- else %}
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge.nonephemeral"

View File

@ -283,7 +283,7 @@ jobs:
# Ensure the working directory gets chowned back to the current user
docker run --rm -v "${RUNNER_TEMP}/artifacts:/v" -w /v "${ALPINE_IMAGE}" chown -R "$(id -u):$(id -g)" .
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: ${{ steps.filter.outputs.is-test-matrix-empty == 'False' }}
with:
name: ${{ inputs.build_name }}

View File

@ -210,7 +210,7 @@ jobs:
- name: Download Build Artifacts
if: ${{ steps.filter.outputs.is-test-matrix-empty == 'False' }}
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v3
with:
name: ${{ inputs.build_name }}
path: "${{ runner.temp }}/artifacts/"

View File

@ -126,7 +126,7 @@ jobs:
# NB: When the previous build job is skipped, there won't be any artifacts and
# this step will fail. Binary build jobs can only be skipped on CI, not nightly
continue-on-error: true
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v3
with:
name: ${{ inputs.build_name }}
path: "${{ runner.temp }}/artifacts/"

View File

@ -292,7 +292,7 @@ jobs:
bundler-cache: true
- name: Download arm64 artifacts
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v3
with:
name: pytorch-ios-build-artifacts-arm64

View File

@ -196,14 +196,11 @@ jobs:
def get_potential_pr_author(
github_token: str, repo: str, username: str, ref_type: str, ref_name: str
gh: Github, repo: str, username: str, ref_type: str, ref_name: str
) -> str:
# If the trigger was a new tag added by a bot, this is a ciflow case
# Fetch the actual username from the original PR. The PR number is
# embedded in the tag name: ciflow/<name>/<pr-number>
gh = get_gh_client(github_token)
if username == "pytorch-bot[bot]" and ref_type == "tag":
split_tag = ref_name.split("/")
if (
@ -225,32 +222,23 @@ jobs:
def is_exception_branch(branch: str) -> bool:
"""
Branches that get opted out of all experiments and should always use Meta runners
"""
return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"}
def get_fleet(rollout_state: str, workflow_requestors: Iterable[str]) -> str:
"""
Determines if the job should run on the LF fleet or the Meta fleet
Returns:
The appropriate label prefix for the runner, corresponding to the fleet to use.
This gets prefixed to the very start of the runner label.
"""
def get_workflow_type(issue: Issue, workflow_requestors: Iterable[str]) -> str:
try:
if rollout_state[0] == "!":
first_comment = issue.get_comments()[0].body.strip("\n\t ")
if first_comment[0] == "!":
log.info("LF Workflows are disabled for everyone. Using meta runners.")
return WORKFLOW_LABEL_META
elif rollout_state[0] == "*":
elif first_comment[0] == "*":
log.info("LF Workflows are enabled for everyone. Using LF runners.")
return WORKFLOW_LABEL_LF
else:
all_opted_in_users = {
usr_raw.strip("\n\t@ ").split(",")[0]
for usr_raw in rollout_state.split()
for usr_raw in first_comment.split()
}
opted_in_requestors = {
usr for usr in workflow_requestors if usr in all_opted_in_users
@ -274,17 +262,11 @@ jobs:
def get_optin_feature(
rollout_state: str, workflow_requestors: Iterable[str], feature: str, fallback: str
issue: Issue, workflow_requestors: Iterable[str], feature: str, fallback: str
) -> str:
"""
Used to dynamically opt in jobs to specific runner-type variants.
Returns:
The runner-type's variant name if the user has opted in to the feature, otherwise returns an empty string.
This variant name is prefixed to the runner-type in the label.
"""
try:
userlist = {u.lstrip("#").strip("\n\t@ ") for u in rollout_state.split()}
first_comment = issue.get_comments()[0].body.strip("\n\t ")
userlist = {u.lstrip("#").strip("\n\t@ ") for u in first_comment.split()}
all_opted_in_users = set()
for user in userlist:
for i in user.split(","):
@ -312,17 +294,6 @@ jobs:
return fallback
def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str:
"""
Gets the first comment of the issue, which contains the desired rollout state.
The default issue we use - https://github.com/pytorch/test-infra/issues/5132
"""
gh = get_gh_client(github_token)
issue = get_issue(gh, repo, issue_num)
return str(issue.get_comments()[0].body.strip("\n\t "))
def main() -> None:
args = parse_args()
@ -332,27 +303,25 @@ jobs:
runner_ami = RUNNER_AMI_LEGACY
else:
try:
rollout_state = get_rollout_state_from_issue(
args.github_token, args.github_issue_repo, args.github_issue
)
gh = get_gh_client(args.github_token)
# The default issue we use - https://github.com/pytorch/test-infra/issues/5132
issue = get_issue(gh, args.github_issue_repo, args.github_issue)
username = get_potential_pr_author(
args.github_token,
gh,
args.github_repo,
args.github_actor,
args.github_ref_type,
args.github_branch,
)
label_type = get_fleet(
rollout_state,
label_type = get_workflow_type(
issue,
(
args.github_issue_owner,
username,
),
)
runner_ami = get_optin_feature(
rollout_state=rollout_state,
issue=issue,
workflow_requestors=(
args.github_issue_owner,
username,
@ -377,7 +346,6 @@ jobs:
if __name__ == "__main__":
main()
EOF
cat runner_determinator.py

View File

@ -11,16 +11,6 @@ on:
required: true
type: string
description: What CUDA version to build with, "cpu" for none.
use-xpu:
required: false
type: boolean
default: false
description: If set, build with XPU support.
vc-year:
required: false
type: string
default: "2019"
description: The Visual Studio year to use for building.
build-with-debug:
required: false
type: boolean
@ -151,7 +141,7 @@ jobs:
SCCACHE_REGION: us-east-1
VC_PRODUCT: "BuildTools"
VC_VERSION: ""
VC_YEAR: "${{ inputs.vc-year }}"
VC_YEAR: "2019"
ALPINE_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine"
AWS_DEFAULT_REGION: us-east-1
PR_NUMBER: ${{ github.event.pull_request.number }}
@ -159,7 +149,6 @@ jobs:
DEBUG: ${{ inputs.build-with-debug && '1' || '0' }}
TORCH_CUDA_ARCH_LIST: "8.6"
USE_CUDA: ${{ inputs.cuda-version != 'cpu' && '1' || '0' }}
USE_XPU: ${{ inputs.use-xpu == true && '1' || '0' }}
OUR_GITHUB_JOB_ID: ${{ steps.get-job-id.outputs.job-id }}
run: |
.ci/pytorch/win-build.sh

View File

@ -13,6 +13,7 @@ on:
- .github/scripts/build_triton_wheel.py
- .github/ci_commit_pins/triton.txt
- .ci/docker/ci_commit_pins/triton.txt
- .ci/docker/ci_commit_pins/triton-rocm.txt
- .ci/docker/ci_commit_pins/triton-xpu.txt
pull_request:
paths:
@ -20,6 +21,7 @@ on:
- .github/scripts/build_triton_wheel.py
- .github/ci_commit_pins/triton.txt
- .ci/docker/ci_commit_pins/triton.txt
- .ci/docker/ci_commit_pins/triton-rocm.txt
- .ci/docker/ci_commit_pins/triton-xpu.txt
concurrency:
@ -29,7 +31,7 @@ concurrency:
jobs:
build-wheel:
name: "Build Triton Wheel"
runs-on: [self-hosted, linux.4xlarge]
runs-on: [self-hosted, linux.2xlarge]
strategy:
fail-fast: false
matrix:
@ -118,7 +120,7 @@ jobs:
fi
docker exec -t "${container_name}" chown -R 1000.1000 /artifacts
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
with:
name: pytorch-triton-wheel-${{ matrix.py_vers }}-${{ matrix.device }}
if-no-files-found: error
@ -155,7 +157,7 @@ jobs:
aws-region: us-east-1
- name: Download Build Artifacts
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v3
with:
# Download all available artifacts
path: ${{ runner.temp }}/artifacts-all
@ -251,7 +253,7 @@ jobs:
docker exec -t "${container_name}" python /pytorch/.github/scripts/build_triton_wheel.py --build-conda --py-version="${PY_VERS}" $RELEASE
docker exec -t "${container_name}" chown -R 1000.1000 /artifacts
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
with:
name: pytorch-triton-conda-${{ matrix.py_vers }}
if-no-files-found: error
@ -271,7 +273,7 @@ jobs:
- uses: actions/checkout@v3
- name: Download Build Artifacts
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v3
with:
# Download all available artifacts
path: ${{ runner.temp }}/artifacts-all

View File

@ -80,7 +80,7 @@ jobs:
id-token: write
needs: release
steps:
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v2
with:
name: ${{ needs.release.outputs.pt_release_name }}
- name: Configure AWS credentials(PyTorch account)

View File

@ -45,15 +45,15 @@ jobs:
pytorch-linux-focal-cuda12.1-cudnn9-py3-gcc9-inductor-benchmarks,
pytorch-linux-focal-cuda12.1-cudnn9-py3.12-gcc9-inductor-benchmarks,
pytorch-linux-focal-cuda11.8-cudnn9-py3-gcc9,
pytorch-linux-focal-py3.9-clang10,
pytorch-linux-focal-py3.8-clang10,
pytorch-linux-focal-py3.11-clang10,
pytorch-linux-focal-py3.12-clang10,
pytorch-linux-focal-rocm-n-1-py3,
pytorch-linux-focal-rocm-n-py3,
pytorch-linux-jammy-cuda11.8-cudnn9-py3.9-clang12,
pytorch-linux-jammy-cuda11.8-cudnn9-py3.8-clang12,
pytorch-linux-focal-py3-clang9-android-ndk-r21e,
pytorch-linux-jammy-py3.9-gcc11,
pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks,
pytorch-linux-jammy-py3.8-gcc11,
pytorch-linux-jammy-py3.8-gcc11-inductor-benchmarks,
pytorch-linux-jammy-py3.12-halide,
pytorch-linux-jammy-xpu-2024.0-py3,
pytorch-linux-jammy-py3-clang15-asan,

View File

@ -58,7 +58,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.9"
runs_on: linux.arm64.m7g.4xlarge.ephemeral
ALPINE_IMAGE: "arm64v8/alpine"
@ -82,7 +81,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cpu-aarch64
build_environment: linux-aarch64-binary-manywheel
@ -105,7 +103,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cpu-aarch64
secrets:
@ -128,7 +125,6 @@ jobs:
GPU_ARCH_TYPE: cuda-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cuda12.4-main
DESIRED_DEVTOOLSET: cxx11-abi
use_split_build: False
DESIRED_PYTHON: "3.9"
runs_on: linux.arm64.m7g.4xlarge.ephemeral
ALPINE_IMAGE: "arm64v8/alpine"
@ -153,7 +149,6 @@ jobs:
GPU_ARCH_TYPE: cuda-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cuda12.4-main
DESIRED_DEVTOOLSET: cxx11-abi
use_split_build: False
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda-aarch64
secrets:
@ -175,7 +170,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.10"
runs_on: linux.arm64.m7g.4xlarge.ephemeral
ALPINE_IMAGE: "arm64v8/alpine"
@ -199,7 +193,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.10"
build_name: manywheel-py3_10-cpu-aarch64
build_environment: linux-aarch64-binary-manywheel
@ -222,7 +215,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.10"
build_name: manywheel-py3_10-cpu-aarch64
secrets:
@ -245,7 +237,6 @@ jobs:
GPU_ARCH_TYPE: cuda-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cuda12.4-main
DESIRED_DEVTOOLSET: cxx11-abi
use_split_build: False
DESIRED_PYTHON: "3.10"
runs_on: linux.arm64.m7g.4xlarge.ephemeral
ALPINE_IMAGE: "arm64v8/alpine"
@ -270,7 +261,6 @@ jobs:
GPU_ARCH_TYPE: cuda-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cuda12.4-main
DESIRED_DEVTOOLSET: cxx11-abi
use_split_build: False
DESIRED_PYTHON: "3.10"
build_name: manywheel-py3_10-cuda-aarch64
secrets:
@ -292,7 +282,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.11"
runs_on: linux.arm64.m7g.4xlarge.ephemeral
ALPINE_IMAGE: "arm64v8/alpine"
@ -316,7 +305,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.11"
build_name: manywheel-py3_11-cpu-aarch64
build_environment: linux-aarch64-binary-manywheel
@ -339,7 +327,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.11"
build_name: manywheel-py3_11-cpu-aarch64
secrets:
@ -362,7 +349,6 @@ jobs:
GPU_ARCH_TYPE: cuda-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cuda12.4-main
DESIRED_DEVTOOLSET: cxx11-abi
use_split_build: False
DESIRED_PYTHON: "3.11"
runs_on: linux.arm64.m7g.4xlarge.ephemeral
ALPINE_IMAGE: "arm64v8/alpine"
@ -387,7 +373,6 @@ jobs:
GPU_ARCH_TYPE: cuda-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cuda12.4-main
DESIRED_DEVTOOLSET: cxx11-abi
use_split_build: False
DESIRED_PYTHON: "3.11"
build_name: manywheel-py3_11-cuda-aarch64
secrets:
@ -409,7 +394,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.12"
runs_on: linux.arm64.m7g.4xlarge.ephemeral
ALPINE_IMAGE: "arm64v8/alpine"
@ -433,7 +417,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.12"
build_name: manywheel-py3_12-cpu-aarch64
build_environment: linux-aarch64-binary-manywheel
@ -456,7 +439,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cpu-aarch64-main
use_split_build: False
DESIRED_PYTHON: "3.12"
build_name: manywheel-py3_12-cpu-aarch64
secrets:
@ -479,7 +461,6 @@ jobs:
GPU_ARCH_TYPE: cuda-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cuda12.4-main
DESIRED_DEVTOOLSET: cxx11-abi
use_split_build: False
DESIRED_PYTHON: "3.12"
runs_on: linux.arm64.m7g.4xlarge.ephemeral
ALPINE_IMAGE: "arm64v8/alpine"
@ -504,7 +485,6 @@ jobs:
GPU_ARCH_TYPE: cuda-aarch64
DOCKER_IMAGE: pytorch/manylinuxaarch64-builder:cuda12.4-main
DESIRED_DEVTOOLSET: cxx11-abi
use_split_build: False
DESIRED_PYTHON: "3.12"
build_name: manywheel-py3_12-cuda-aarch64
secrets:

View File

@ -366,7 +366,7 @@ jobs:
steps:
- name: Setup ROCm
uses: ./.github/actions/setup-rocm
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-rocm6_1-shared-with-deps-cxx11-abi
@ -476,7 +476,7 @@ jobs:
steps:
- name: Setup ROCm
uses: ./.github/actions/setup-rocm
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-rocm6_2-shared-with-deps-cxx11-abi

View File

@ -366,7 +366,7 @@ jobs:
steps:
- name: Setup ROCm
uses: ./.github/actions/setup-rocm
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-rocm6_1-shared-with-deps-pre-cxx11
@ -476,7 +476,7 @@ jobs:
steps:
- name: Setup ROCm
uses: ./.github/actions/setup-rocm
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-rocm6_2-shared-with-deps-pre-cxx11

View File

@ -1,182 +0,0 @@
# @generated DO NOT EDIT MANUALLY
# Template is at: .github/templates/linux_binary_build_workflow.yml.j2
# Generation script: .github/scripts/generate_ci_workflows.py
name: linux-binary-manywheel
on:
push:
branches:
- main
tags:
- 'ciflow/periodic/*'
workflow_dispatch:
env:
# Needed for conda builds
ALPINE_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine"
ANACONDA_USER: pytorch
AWS_DEFAULT_REGION: us-east-1
BINARY_ENV_FILE: /tmp/env
BUILD_ENVIRONMENT: linux-binary-manywheel
BUILDER_ROOT: /builder
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PYTORCH_FINAL_PACKAGE_DIR: /artifacts
PYTORCH_ROOT: /pytorch
SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
SKIP_ALL_TESTS: 0
concurrency:
group: linux-binary-manywheel-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
jobs:
get-label-type:
name: get-label-type
uses: ./.github/workflows/_runner-determinator.yml
with:
triggering_actor: ${{ github.triggering_actor }}
issue_owner: ${{ github.event.pull_request.user.login || github.event.issue.user.login }}
curr_branch: ${{ github.head_ref || github.ref_name }}
curr_ref_type: ${{ github.ref_type }}
manywheel-py3_9-cuda11_8-build:
if: ${{ github.repository_owner == 'pytorch' }}
uses: ./.github/workflows/_binary-build-linux.yml
needs: get-label-type
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu118
GPU_ARCH_VERSION: 11.8
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda11.8-main
use_split_build: True
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda11_8
build_environment: linux-binary-manywheel
PYTORCH_EXTRA_INSTALL_REQUIREMENTS: nvidia-cuda-nvrtc-cu11==11.8.89; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-runtime-cu11==11.8.89; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-cupti-cu11==11.8.87; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cudnn-cu11==9.1.0.70; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cublas-cu11==11.11.3.6; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cufft-cu11==10.9.0.58; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-curand-cu11==10.3.0.86; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusolver-cu11==11.4.1.48; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusparse-cu11==11.7.5.86; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nccl-cu11==2.21.5; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nvtx-cu11==11.8.86; platform_system == 'Linux' and platform_machine == 'x86_64'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda11_8-test: # Testing
if: ${{ github.repository_owner == 'pytorch' }}
needs:
- manywheel-py3_9-cuda11_8-build
- get-label-type
uses: ./.github/workflows/_binary-test-linux.yml
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu118
GPU_ARCH_VERSION: 11.8
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda11.8-main
use_split_build: True
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda11_8
build_environment: linux-binary-manywheel
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
runs_on: linux.4xlarge.nvidia.gpu
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_1-build:
if: ${{ github.repository_owner == 'pytorch' }}
uses: ./.github/workflows/_binary-build-linux.yml
needs: get-label-type
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu121
GPU_ARCH_VERSION: 12.1
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.1-main
use_split_build: True
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda12_1
build_environment: linux-binary-manywheel
PYTORCH_EXTRA_INSTALL_REQUIREMENTS: nvidia-cuda-nvrtc-cu12==12.1.105; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-runtime-cu12==12.1.105; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-cupti-cu12==12.1.105; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cudnn-cu12==9.1.0.70; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cublas-cu12==12.1.3.1; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cufft-cu12==11.0.2.54; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-curand-cu12==10.3.2.106; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusolver-cu12==11.4.5.107; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusparse-cu12==12.1.0.106; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nccl-cu12==2.21.5; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nvtx-cu12==12.1.105; platform_system == 'Linux' and platform_machine == 'x86_64'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_1-test: # Testing
if: ${{ github.repository_owner == 'pytorch' }}
needs:
- manywheel-py3_9-cuda12_1-build
- get-label-type
uses: ./.github/workflows/_binary-test-linux.yml
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu121
GPU_ARCH_VERSION: 12.1
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.1-main
use_split_build: True
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda12_1
build_environment: linux-binary-manywheel
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
runs_on: linux.4xlarge.nvidia.gpu
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_4-build:
if: ${{ github.repository_owner == 'pytorch' }}
uses: ./.github/workflows/_binary-build-linux.yml
needs: get-label-type
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu124
GPU_ARCH_VERSION: 12.4
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.4-main
use_split_build: True
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda12_4
build_environment: linux-binary-manywheel
PYTORCH_EXTRA_INSTALL_REQUIREMENTS: nvidia-cuda-nvrtc-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-runtime-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-cupti-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cudnn-cu12==9.1.0.70; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cublas-cu12==12.4.5.8; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cufft-cu12==11.2.1.3; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-curand-cu12==10.3.5.147; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusolver-cu12==11.6.1.9; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusparse-cu12==12.3.1.170; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nccl-cu12==2.21.5; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nvtx-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nvjitlink-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_4-test: # Testing
if: ${{ github.repository_owner == 'pytorch' }}
needs:
- manywheel-py3_9-cuda12_4-build
- get-label-type
uses: ./.github/workflows/_binary-test-linux.yml
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu124
GPU_ARCH_VERSION: 12.4
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.4-main
use_split_build: True
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda12_4
build_environment: linux-binary-manywheel
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
runs_on: linux.4xlarge.nvidia.gpu
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -54,7 +54,6 @@ jobs:
GPU_ARCH_VERSION: 11.8
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda11.8-main
use_split_build: False
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda11_8
@ -78,7 +77,6 @@ jobs:
GPU_ARCH_VERSION: 11.8
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda11.8-main
use_split_build: False
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda11_8
build_environment: linux-binary-manywheel
@ -87,6 +85,53 @@ jobs:
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda11_8-split-build:
if: ${{ github.repository_owner == 'pytorch' }}
uses: ./.github/workflows/_binary-build-linux.yml
needs: get-label-type
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu118
GPU_ARCH_VERSION: 11.8
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda11.8-main
use_split_build: True
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda11_8-split
build_environment: linux-binary-manywheel
PYTORCH_EXTRA_INSTALL_REQUIREMENTS: nvidia-cuda-nvrtc-cu11==11.8.89; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-runtime-cu11==11.8.89; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-cupti-cu11==11.8.87; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cudnn-cu11==9.1.0.70; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cublas-cu11==11.11.3.6; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cufft-cu11==10.9.0.58; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-curand-cu11==10.3.0.86; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusolver-cu11==11.4.1.48; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusparse-cu11==11.7.5.86; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nccl-cu11==2.21.5; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nvtx-cu11==11.8.86; platform_system == 'Linux' and platform_machine == 'x86_64'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda11_8-split-test: # Testing
if: ${{ github.repository_owner == 'pytorch' }}
needs:
- manywheel-py3_9-cuda11_8-split-build
- get-label-type
uses: ./.github/workflows/_binary-test-linux.yml
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu118
GPU_ARCH_VERSION: 11.8
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda11.8-main
use_split_build: True
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda11_8-split
build_environment: linux-binary-manywheel
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
runs_on: linux.4xlarge.nvidia.gpu
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_1-build:
if: ${{ github.repository_owner == 'pytorch' }}
uses: ./.github/workflows/_binary-build-linux.yml
@ -101,7 +146,6 @@ jobs:
GPU_ARCH_VERSION: 12.1
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.1-main
use_split_build: False
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda12_1
@ -125,7 +169,6 @@ jobs:
GPU_ARCH_VERSION: 12.1
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.1-main
use_split_build: False
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda12_1
build_environment: linux-binary-manywheel
@ -134,6 +177,53 @@ jobs:
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_1-split-build:
if: ${{ github.repository_owner == 'pytorch' }}
uses: ./.github/workflows/_binary-build-linux.yml
needs: get-label-type
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu121
GPU_ARCH_VERSION: 12.1
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.1-main
use_split_build: True
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda12_1-split
build_environment: linux-binary-manywheel
PYTORCH_EXTRA_INSTALL_REQUIREMENTS: nvidia-cuda-nvrtc-cu12==12.1.105; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-runtime-cu12==12.1.105; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-cupti-cu12==12.1.105; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cudnn-cu12==9.1.0.70; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cublas-cu12==12.1.3.1; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cufft-cu12==11.0.2.54; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-curand-cu12==10.3.2.106; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusolver-cu12==11.4.5.107; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusparse-cu12==12.1.0.106; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nccl-cu12==2.21.5; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nvtx-cu12==12.1.105; platform_system == 'Linux' and platform_machine == 'x86_64'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_1-split-test: # Testing
if: ${{ github.repository_owner == 'pytorch' }}
needs:
- manywheel-py3_9-cuda12_1-split-build
- get-label-type
uses: ./.github/workflows/_binary-test-linux.yml
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu121
GPU_ARCH_VERSION: 12.1
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.1-main
use_split_build: True
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda12_1-split
build_environment: linux-binary-manywheel
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
runs_on: linux.4xlarge.nvidia.gpu
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_4-build:
if: ${{ github.repository_owner == 'pytorch' }}
uses: ./.github/workflows/_binary-build-linux.yml
@ -148,7 +238,6 @@ jobs:
GPU_ARCH_VERSION: 12.4
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.4-main
use_split_build: False
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda12_4
@ -172,7 +261,6 @@ jobs:
GPU_ARCH_VERSION: 12.4
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.4-main
use_split_build: False
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda12_4
build_environment: linux-binary-manywheel
@ -180,3 +268,50 @@ jobs:
runs_on: linux.4xlarge.nvidia.gpu
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_4-split-build:
if: ${{ github.repository_owner == 'pytorch' }}
uses: ./.github/workflows/_binary-build-linux.yml
needs: get-label-type
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu124
GPU_ARCH_VERSION: 12.4
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.4-main
use_split_build: True
DESIRED_PYTHON: "3.9"
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build_name: manywheel-py3_9-cuda12_4-split
build_environment: linux-binary-manywheel
PYTORCH_EXTRA_INSTALL_REQUIREMENTS: nvidia-cuda-nvrtc-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-runtime-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cuda-cupti-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cudnn-cu12==9.1.0.70; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cublas-cu12==12.4.5.8; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cufft-cu12==11.2.1.3; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-curand-cu12==10.3.5.147; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusolver-cu12==11.6.1.9; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-cusparse-cu12==12.3.1.170; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nccl-cu12==2.21.5; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nvtx-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | nvidia-nvjitlink-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
manywheel-py3_9-cuda12_4-split-test: # Testing
if: ${{ github.repository_owner == 'pytorch' }}
needs:
- manywheel-py3_9-cuda12_4-split-build
- get-label-type
uses: ./.github/workflows/_binary-test-linux.yml
with:
PYTORCH_ROOT: /pytorch
BUILDER_ROOT: /builder
PACKAGE_TYPE: manywheel
# TODO: This is a legacy variable that we eventually want to get rid of in
# favor of GPU_ARCH_VERSION
DESIRED_CUDA: cu124
GPU_ARCH_VERSION: 12.4
GPU_ARCH_TYPE: cuda
DOCKER_IMAGE: pytorch/manylinux-builder:cuda12.4-main
use_split_build: True
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cuda12_4-split
build_environment: linux-binary-manywheel
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
runs_on: linux.4xlarge.nvidia.gpu
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -58,7 +58,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.9"
runs_on: linux.s390x
ALPINE_IMAGE: "docker.io/s390x/alpine"
@ -82,7 +81,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cpu-s390x
build_environment: linux-s390x-binary-manywheel
@ -105,7 +103,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.9"
build_name: manywheel-py3_9-cpu-s390x
secrets:
@ -127,7 +124,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.10"
runs_on: linux.s390x
ALPINE_IMAGE: "docker.io/s390x/alpine"
@ -151,7 +147,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.10"
build_name: manywheel-py3_10-cpu-s390x
build_environment: linux-s390x-binary-manywheel
@ -174,7 +169,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.10"
build_name: manywheel-py3_10-cpu-s390x
secrets:
@ -196,7 +190,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.11"
runs_on: linux.s390x
ALPINE_IMAGE: "docker.io/s390x/alpine"
@ -220,7 +213,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.11"
build_name: manywheel-py3_11-cpu-s390x
build_environment: linux-s390x-binary-manywheel
@ -243,7 +235,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.11"
build_name: manywheel-py3_11-cpu-s390x
secrets:
@ -265,7 +256,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.12"
runs_on: linux.s390x
ALPINE_IMAGE: "docker.io/s390x/alpine"
@ -289,7 +279,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.12"
build_name: manywheel-py3_12-cpu-s390x
build_environment: linux-s390x-binary-manywheel
@ -312,7 +301,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.12"
build_name: manywheel-py3_12-cpu-s390x
secrets:
@ -334,7 +322,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.13"
runs_on: linux.s390x
ALPINE_IMAGE: "docker.io/s390x/alpine"
@ -358,7 +345,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.13"
build_name: manywheel-py3_13-cpu-s390x
build_environment: linux-s390x-binary-manywheel
@ -381,7 +367,6 @@ jobs:
DESIRED_CUDA: cpu
GPU_ARCH_TYPE: cpu-s390x
DOCKER_IMAGE: pytorch/manylinuxs390x-builder:cpu-s390x-main
use_split_build: False
DESIRED_PYTHON: "3.13"
build_name: manywheel-py3_13-cpu-s390x
secrets:

View File

@ -117,7 +117,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_9-cpu
@ -232,7 +232,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_10-cpu
@ -347,7 +347,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_11-cpu
@ -462,7 +462,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_12-cpu

View File

@ -49,7 +49,7 @@ jobs:
DESIRED_DEVTOOLSET: cxx11-abi
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
# NOTE: These environment variables are put here so that they can be applied on every job equally
# They are also here because setting them at a workflow level doesn't give us access to the
@ -121,7 +121,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cpu-shared-with-deps-cxx11-abi

View File

@ -118,7 +118,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: wheel-py3_9-cpu
@ -234,7 +234,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: wheel-py3_10-cpu
@ -350,7 +350,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: wheel-py3_11-cpu
@ -466,7 +466,7 @@ jobs:
# shellcheck disable=SC1091
source "${RUNNER_TEMP}/anaconda/bin/activate"
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: wheel-py3_12-cpu

View File

@ -132,7 +132,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_9-cpu
@ -213,7 +213,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_9-cpu
@ -378,7 +378,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_9-cuda11_8
@ -403,7 +403,7 @@ jobs:
needs:
- conda-py3_9-cuda11_8-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -460,7 +460,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_9-cuda11_8
@ -626,7 +626,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_9-cuda12_1
@ -651,7 +651,7 @@ jobs:
needs:
- conda-py3_9-cuda12_1-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -708,7 +708,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_9-cuda12_1
@ -874,7 +874,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_9-cuda12_4
@ -899,7 +899,7 @@ jobs:
needs:
- conda-py3_9-cuda12_4-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -956,7 +956,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_9-cuda12_4
@ -1121,7 +1121,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_10-cpu
@ -1202,7 +1202,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_10-cpu
@ -1367,7 +1367,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_10-cuda11_8
@ -1392,7 +1392,7 @@ jobs:
needs:
- conda-py3_10-cuda11_8-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -1449,7 +1449,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_10-cuda11_8
@ -1615,7 +1615,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_10-cuda12_1
@ -1640,7 +1640,7 @@ jobs:
needs:
- conda-py3_10-cuda12_1-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -1697,7 +1697,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_10-cuda12_1
@ -1863,7 +1863,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_10-cuda12_4
@ -1888,7 +1888,7 @@ jobs:
needs:
- conda-py3_10-cuda12_4-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -1945,7 +1945,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_10-cuda12_4
@ -2110,7 +2110,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_11-cpu
@ -2191,7 +2191,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_11-cpu
@ -2356,7 +2356,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_11-cuda11_8
@ -2381,7 +2381,7 @@ jobs:
needs:
- conda-py3_11-cuda11_8-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -2438,7 +2438,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_11-cuda11_8
@ -2604,7 +2604,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_11-cuda12_1
@ -2629,7 +2629,7 @@ jobs:
needs:
- conda-py3_11-cuda12_1-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -2686,7 +2686,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_11-cuda12_1
@ -2852,7 +2852,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_11-cuda12_4
@ -2877,7 +2877,7 @@ jobs:
needs:
- conda-py3_11-cuda12_4-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -2934,7 +2934,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_11-cuda12_4
@ -3099,7 +3099,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_12-cpu
@ -3180,7 +3180,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_12-cpu
@ -3345,7 +3345,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_12-cuda11_8
@ -3370,7 +3370,7 @@ jobs:
needs:
- conda-py3_12-cuda11_8-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -3427,7 +3427,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_12-cuda11_8
@ -3593,7 +3593,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_12-cuda12_1
@ -3618,7 +3618,7 @@ jobs:
needs:
- conda-py3_12-cuda12_1-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -3675,7 +3675,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_12-cuda12_1
@ -3841,7 +3841,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda-py3_12-cuda12_4
@ -3866,7 +3866,7 @@ jobs:
needs:
- conda-py3_12-cuda12_4-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -3923,7 +3923,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: conda-py3_12-cuda12_4

View File

@ -51,7 +51,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -129,7 +129,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cpu-shared-with-deps-debug
@ -169,7 +169,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -214,7 +214,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cpu-shared-with-deps-debug

View File

@ -58,7 +58,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -136,7 +136,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cpu-shared-with-deps-debug
@ -176,7 +176,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -221,7 +221,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cpu-shared-with-deps-debug
@ -290,7 +290,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
build_name: libtorch-cpu-shared-with-deps-debug
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
@ -316,7 +316,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -394,7 +394,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cuda11_8-shared-with-deps-debug
@ -419,7 +419,7 @@ jobs:
needs:
- libtorch-cuda11_8-shared-with-deps-debug-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -435,7 +435,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -480,7 +480,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cuda11_8-shared-with-deps-debug
@ -550,7 +550,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
build_name: libtorch-cuda11_8-shared-with-deps-debug
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
@ -576,7 +576,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -654,7 +654,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cuda12_1-shared-with-deps-debug
@ -679,7 +679,7 @@ jobs:
needs:
- libtorch-cuda12_1-shared-with-deps-debug-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -695,7 +695,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -740,7 +740,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cuda12_1-shared-with-deps-debug
@ -810,7 +810,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
build_name: libtorch-cuda12_1-shared-with-deps-debug
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
@ -836,7 +836,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -914,7 +914,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cuda12_4-shared-with-deps-debug
@ -939,7 +939,7 @@ jobs:
needs:
- libtorch-cuda12_4-shared-with-deps-debug-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -955,7 +955,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -1000,7 +1000,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cuda12_4-shared-with-deps-debug
@ -1070,7 +1070,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
build_name: libtorch-cuda12_4-shared-with-deps-debug
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -51,7 +51,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -129,7 +129,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cpu-shared-with-deps-release
@ -169,7 +169,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -214,7 +214,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cpu-shared-with-deps-release

View File

@ -58,7 +58,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -136,7 +136,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cpu-shared-with-deps-release
@ -176,7 +176,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -221,7 +221,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cpu-shared-with-deps-release
@ -290,7 +290,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
build_name: libtorch-cpu-shared-with-deps-release
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
@ -316,7 +316,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -394,7 +394,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cuda11_8-shared-with-deps-release
@ -419,7 +419,7 @@ jobs:
needs:
- libtorch-cuda11_8-shared-with-deps-release-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -435,7 +435,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -480,7 +480,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cuda11_8-shared-with-deps-release
@ -550,7 +550,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
build_name: libtorch-cuda11_8-shared-with-deps-release
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
@ -576,7 +576,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -654,7 +654,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cuda12_1-shared-with-deps-release
@ -679,7 +679,7 @@ jobs:
needs:
- libtorch-cuda12_1-shared-with-deps-release-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -695,7 +695,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -740,7 +740,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cuda12_1-shared-with-deps-release
@ -810,7 +810,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
build_name: libtorch-cuda12_1-shared-with-deps-release
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
@ -836,7 +836,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -914,7 +914,7 @@ jobs:
shell: bash
run: |
"${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
- uses: actions/upload-artifact@v4.4.0
- uses: actions/upload-artifact@v3
if: always()
with:
name: libtorch-cuda12_4-shared-with-deps-release
@ -939,7 +939,7 @@ jobs:
needs:
- libtorch-cuda12_4-shared-with-deps-release-build
- get-label-type
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.g4dn.xlarge"
runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.8xlarge.nvidia.gpu"
timeout-minutes: 240
env:
PYTORCH_ROOT: ${{ github.workspace }}/pytorch
@ -955,7 +955,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
steps:
- name: Display EC2 information
shell: bash
@ -1000,7 +1000,7 @@ jobs:
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
name: Download Build Artifacts
with:
name: libtorch-cuda12_4-shared-with-deps-release
@ -1070,7 +1070,7 @@ jobs:
LIBTORCH_VARIANT: shared-with-deps
# This is a dummy value for libtorch to work correctly with our batch scripts
# without this value pip does not get installed for some reason
DESIRED_PYTHON: "3.9"
DESIRED_PYTHON: "3.8"
build_name: libtorch-cuda12_4-shared-with-deps-release
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +0,0 @@
name: inductor-micro-benchmark-x86
on:
schedule:
- cron: 0 7 * * *
push:
tags:
- ciflow/inductor-micro-benchmark-cpu-x86/*
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true
permissions: read-all
jobs:
linux-jammy-cpu-py3_9-gcc11-inductor-build:
name: linux-jammy-cpu-py3.9-gcc11-inductor
uses: ./.github/workflows/_linux-build.yml
with:
build-environment: linux-jammy-py3.9-gcc11
docker-image-name: pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks
# Use metal host for benchmark jobs
test-matrix: |
{ include: [
{ config: "inductor-micro-benchmark-cpu-x86", shard: 1, num_shards: 1, runner: "linux.24xl.spr-metal" },
]}
linux-jammy-cpu-py3_9-gcc11-inductor-micro-benchmark-test:
name: linux-jammy-cpu-py3.9-gcc11-inductor
uses: ./.github/workflows/_linux-test.yml
needs: linux-jammy-cpu-py3_9-gcc11-inductor-build
with:
build-environment: linux-jammy-py3.9-gcc11
docker-image: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.test-matrix }}
use-gha: anything-non-empty-to-use-gha
timeout-minutes: 720

View File

@ -48,12 +48,12 @@ concurrency:
permissions: read-all
jobs:
linux-jammy-cpu-py3_9-gcc11-inductor-build:
name: linux-jammy-cpu-py3.9-gcc11-inductor
linux-jammy-cpu-py3_8-gcc11-inductor-build:
name: linux-jammy-cpu-py3.8-gcc11-inductor
uses: ./.github/workflows/_linux-build.yml
with:
build-environment: linux-jammy-py3.9-gcc11-build
docker-image-name: pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks
build-environment: linux-jammy-py3.8-gcc11-build
docker-image-name: pytorch-linux-jammy-py3.8-gcc11-inductor-benchmarks
test-matrix: |
{ include: [
{ config: "inductor_huggingface_perf_cpu_x86", shard: 1, num_shards: 3, runner: "linux.24xl.spr-metal" },
@ -74,32 +74,32 @@ jobs:
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
linux-jammy-cpu-py3_9-gcc11-inductor-test-nightly:
name: linux-jammy-cpu-py3.9-gcc11-inductor
linux-jammy-cpu-py3_8-gcc11-inductor-test-nightly:
name: linux-jammy-cpu-py3.8-gcc11-inductor
uses: ./.github/workflows/_linux-test.yml
needs: linux-jammy-cpu-py3_9-gcc11-inductor-build
needs: linux-jammy-cpu-py3_8-gcc11-inductor-build
if: github.event.schedule == '0 7 * * *'
with:
build-environment: linux-jammy-py3.9-gcc11-build
build-environment: linux-jammy-py3.8-gcc11-build
dashboard-tag: training-false-inference-true-default-true-dynamic-true-aotinductor-true
docker-image: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.test-matrix }}
docker-image: ${{ needs.linux-jammy-cpu-py3_8-gcc11-inductor-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-cpu-py3_8-gcc11-inductor-build.outputs.test-matrix }}
use-gha: anything-non-empty-to-use-gha
timeout-minutes: 720
secrets:
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
linux-jammy-cpu-py3_9-gcc11-inductor-test:
name: linux-jammy-cpu-py3.9-gcc11-inductor
linux-jammy-cpu-py3_8-gcc11-inductor-test:
name: linux-jammy-cpu-py3.8-gcc11-inductor
uses: ./.github/workflows/_linux-test.yml
needs: linux-jammy-cpu-py3_9-gcc11-inductor-build
needs: linux-jammy-cpu-py3_8-gcc11-inductor-build
if: github.event_name == 'workflow_dispatch'
with:
build-environment: linux-jammy-py3.9-gcc11-build
build-environment: linux-jammy-py3.8-gcc11-build
dashboard-tag: training-${{ inputs.training }}-inference-${{ inputs.inference }}-default-${{ inputs.default }}-dynamic-${{ inputs.dynamic }}-aotinductor-${{ inputs.aotinductor }}
docker-image: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.test-matrix }}
docker-image: ${{ needs.linux-jammy-cpu-py3_8-gcc11-inductor-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-cpu-py3_8-gcc11-inductor-build.outputs.test-matrix }}
use-gha: anything-non-empty-to-use-gha
timeout-minutes: 720
secrets:

View File

@ -149,13 +149,13 @@ jobs:
secrets:
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
linux-jammy-cpu-py3_9-gcc11-inductor-build:
name: linux-jammy-cpu-py3.9-gcc11-inductor
linux-jammy-cpu-py3_8-gcc11-inductor-build:
name: linux-jammy-cpu-py3.8-gcc11-inductor
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
build-environment: linux-jammy-py3.9-gcc11-build
docker-image-name: pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks
build-environment: linux-jammy-py3.8-gcc11-build
docker-image-name: pytorch-linux-jammy-py3.8-gcc11-inductor-benchmarks
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
test-matrix: |
{ include: [
@ -204,13 +204,13 @@ jobs:
secrets:
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
linux-jammy-cpu-py3_9-gcc11-inductor-test:
name: linux-jammy-cpu-py3.9-gcc11-inductor
linux-jammy-cpu-py3_8-gcc11-inductor-test:
name: linux-jammy-cpu-py3.8-gcc11-inductor
uses: ./.github/workflows/_linux-test.yml
needs: linux-jammy-cpu-py3_9-gcc11-inductor-build
needs: linux-jammy-cpu-py3_8-gcc11-inductor-build
with:
build-environment: linux-jammy-py3.9-gcc11-build
docker-image: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.test-matrix }}
build-environment: linux-jammy-py3.8-gcc11-build
docker-image: ${{ needs.linux-jammy-cpu-py3_8-gcc11-inductor-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-cpu-py3_8-gcc11-inductor-build.outputs.test-matrix }}
secrets:
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}

View File

@ -223,7 +223,7 @@ jobs:
cache: pip
- name: Install dependencies
run: |
pip install pytest-rerunfailures==11.1.* pytest-flakefinder==1.1.* pytest-xdist==3.3.* expecttest==0.2.* fbscribelogger==0.1.* numpy==1.24.*
pip install pytest-rerunfailures==11.1.* pytest-flakefinder==1.1.* pytest-xdist==3.3.* expecttest==0.1.* numpy==1.24.*
pip install torch --pre --index-url https://download.pytorch.org/whl/nightly/cpu/
- name: Run run_test.py (nonretryable)
run: |

View File

@ -32,8 +32,8 @@ jobs:
needs: get-label-type
with:
runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge"
build-environment: linux-jammy-py3.9-gcc11
docker-image-name: pytorch-linux-jammy-py3.9-gcc11
build-environment: linux-jammy-py3.8-gcc11
docker-image-name: pytorch-linux-jammy-py3.8-gcc11
docs-push:
name: docs push
@ -43,7 +43,7 @@ jobs:
- get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-jammy-py3.9-gcc11
build-environment: linux-jammy-py3.8-gcc11
docker-image: ${{ needs.docs-build.outputs.docker-image }}
push: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.event.ref, 'refs/tags/v') }}
run-doxygen: true

View File

@ -104,14 +104,14 @@ jobs:
docker-image: ${{ needs.linux-focal-cuda12_4-py3_10-gcc9-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-cuda12_4-py3_10-gcc9-build.outputs.test-matrix }}
parallelnative-linux-jammy-py3_9-gcc11-build:
name: parallelnative-linux-jammy-py3.9-gcc11
parallelnative-linux-jammy-py3_8-gcc11-build:
name: parallelnative-linux-jammy-py3.8-gcc11
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: parallelnative-linux-jammy-py3.9-gcc11
docker-image-name: pytorch-linux-jammy-py3.9-gcc11
build-environment: parallelnative-linux-jammy-py3.8-gcc11
docker-image-name: pytorch-linux-jammy-py3.8-gcc11
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 3, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },
@ -119,16 +119,16 @@ jobs:
{ config: "default", shard: 3, num_shards: 3, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },
]}
parallelnative-linux-jammy-py3_9-gcc11-test:
name: parallelnative-linux-jammy-py3.9-gcc11
parallelnative-linux-jammy-py3_8-gcc11-test:
name: parallelnative-linux-jammy-py3.8-gcc11
uses: ./.github/workflows/_linux-test.yml
needs:
- parallelnative-linux-jammy-py3_9-gcc11-build
- parallelnative-linux-jammy-py3_8-gcc11-build
- target-determination
with:
build-environment: parallelnative-linux-jammy-py3.9-gcc11
docker-image: ${{ needs.parallelnative-linux-jammy-py3_9-gcc11-build.outputs.docker-image }}
test-matrix: ${{ needs.parallelnative-linux-jammy-py3_9-gcc11-build.outputs.test-matrix }}
build-environment: parallelnative-linux-jammy-py3.8-gcc11
docker-image: ${{ needs.parallelnative-linux-jammy-py3_8-gcc11-build.outputs.docker-image }}
test-matrix: ${{ needs.parallelnative-linux-jammy-py3_8-gcc11-build.outputs.test-matrix }}
linux-focal-cuda11_8-py3_9-gcc9-build:
name: linux-focal-cuda11.8-py3.9-gcc9

View File

@ -43,14 +43,14 @@ jobs:
issue_owner: ${{ github.event.pull_request.user.login || github.event.issue.user.login }}
curr_branch: ${{ github.head_ref || github.ref_name }}
linux-jammy-py3_9-gcc11-build:
name: linux-jammy-py3.9-gcc11
linux-jammy-py3_8-gcc11-build:
name: linux-jammy-py3.8-gcc11
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-jammy-py3.9-gcc11
docker-image-name: pytorch-linux-jammy-py3.9-gcc11
build-environment: linux-jammy-py3.8-gcc11
docker-image-name: pytorch-linux-jammy-py3.8-gcc11
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 4, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },
@ -65,49 +65,49 @@ jobs:
]}
secrets: inherit
linux-jammy-py3_9-gcc11-test:
name: linux-jammy-py3.9-gcc11
linux-jammy-py3_8-gcc11-test:
name: linux-jammy-py3.8-gcc11
uses: ./.github/workflows/_linux-test.yml
needs:
- linux-jammy-py3_9-gcc11-build
- linux-jammy-py3_8-gcc11-build
- target-determination
with:
build-environment: linux-jammy-py3.9-gcc11
docker-image: ${{ needs.linux-jammy-py3_9-gcc11-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-py3_9-gcc11-build.outputs.test-matrix }}
build-environment: linux-jammy-py3.8-gcc11
docker-image: ${{ needs.linux-jammy-py3_8-gcc11-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-py3_8-gcc11-build.outputs.test-matrix }}
secrets: inherit
linux-docs:
name: linux-docs
uses: ./.github/workflows/_docs.yml
needs: linux-jammy-py3_9-gcc11-build
needs: linux-jammy-py3_8-gcc11-build
with:
build-environment: linux-jammy-py3.9-gcc11
docker-image: ${{ needs.linux-jammy-py3_9-gcc11-build.outputs.docker-image }}
build-environment: linux-jammy-py3.8-gcc11
docker-image: ${{ needs.linux-jammy-py3_8-gcc11-build.outputs.docker-image }}
secrets: inherit
linux-jammy-py3_9-gcc11-no-ops:
name: linux-jammy-py3.9-gcc11-no-ops
linux-jammy-py3_8-gcc11-no-ops:
name: linux-jammy-py3.8-gcc11-no-ops
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-jammy-py3.9-gcc11-no-ops
docker-image-name: pytorch-linux-jammy-py3.9-gcc11
build-environment: linux-jammy-py3.8-gcc11-no-ops
docker-image-name: pytorch-linux-jammy-py3.8-gcc11
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 1 },
]}
secrets: inherit
linux-jammy-py3_9-gcc11-pch:
name: linux-jammy-py3.9-gcc11-pch
linux-jammy-py3_8-gcc11-pch:
name: linux-jammy-py3.8-gcc11-pch
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-jammy-py3.9-gcc11-pch
docker-image-name: pytorch-linux-jammy-py3.9-gcc11
build-environment: linux-jammy-py3.8-gcc11-pch
docker-image-name: pytorch-linux-jammy-py3.8-gcc11
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 1 },
@ -148,13 +148,13 @@ jobs:
sync-tag: asan-test
secrets: inherit
linux-focal-py3_9-clang10-onnx-build:
name: linux-focal-py3.9-clang10-onnx
linux-focal-py3_8-clang10-onnx-build:
name: linux-focal-py3.8-clang10-onnx
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-focal-py3.9-clang10-onnx
build-environment: linux-focal-py3.8-clang10-onnx
docker-image-name: pytorch-linux-focal-py3-clang10-onnx
test-matrix: |
{ include: [
@ -163,26 +163,26 @@ jobs:
]}
secrets: inherit
linux-focal-py3_9-clang10-onnx-test:
name: linux-focal-py3.9-clang10-onnx
linux-focal-py3_8-clang10-onnx-test:
name: linux-focal-py3.8-clang10-onnx
uses: ./.github/workflows/_linux-test.yml
needs:
- linux-focal-py3_9-clang10-onnx-build
- linux-focal-py3_8-clang10-onnx-build
- target-determination
with:
build-environment: linux-focal-py3.9-clang10-onnx
docker-image: ${{ needs.linux-focal-py3_9-clang10-onnx-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-py3_9-clang10-onnx-build.outputs.test-matrix }}
build-environment: linux-focal-py3.8-clang10-onnx
docker-image: ${{ needs.linux-focal-py3_8-clang10-onnx-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-py3_8-clang10-onnx-build.outputs.test-matrix }}
secrets: inherit
linux-focal-py3_9-clang10-build:
name: linux-focal-py3.9-clang10
linux-focal-py3_8-clang10-build:
name: linux-focal-py3.8-clang10
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge"
build-environment: linux-focal-py3.9-clang10
docker-image-name: pytorch-linux-focal-py3.9-clang10
build-environment: linux-focal-py3.8-clang10
docker-image-name: pytorch-linux-focal-py3.8-clang10
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 4, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },
@ -195,16 +195,16 @@ jobs:
{ config: "dynamo", shard: 2, num_shards: 3, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },
{ config: "dynamo", shard: 3, num_shards: 3, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },
]}
linux-focal-py3_9-clang10-test:
name: linux-focal-py3.9-clang10
linux-focal-py3_8-clang10-test:
name: linux-focal-py3.8-clang10
uses: ./.github/workflows/_linux-test.yml
needs:
- linux-focal-py3_9-clang10-build
- linux-focal-py3_8-clang10-build
- target-determination
with:
build-environment: linux-focal-py3.9-clang10
docker-image: ${{ needs.linux-focal-py3_9-clang10-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-py3_9-clang10-build.outputs.test-matrix }}
build-environment: linux-focal-py3.8-clang10
docker-image: ${{ needs.linux-focal-py3_8-clang10-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-py3_8-clang10-build.outputs.test-matrix }}
secrets: inherit
linux-focal-py3_11-clang10-build:
@ -347,14 +347,14 @@ jobs:
]}
secrets: inherit
linux-jammy-cuda-11_8-cudnn9-py3_9-clang12-build:
name: linux-jammy-cuda11.8-cudnn9-py3.9-clang12
linux-jammy-cuda-11_8-cudnn9-py3_8-clang12-build:
name: linux-jammy-cuda11.8-cudnn9-py3.8-clang12
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-jammy-cuda11.8-cudnn9-py3.9-clang12
docker-image-name: pytorch-linux-jammy-cuda11.8-cudnn9-py3.9-clang12
build-environment: linux-jammy-cuda11.8-cudnn9-py3.8-clang12
docker-image-name: pytorch-linux-jammy-cuda11.8-cudnn9-py3.8-clang12
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 1 },
@ -376,13 +376,13 @@ jobs:
]}
secrets: inherit
linux-focal-py3_9-clang9-xla-build:
name: linux-focal-py3_9-clang9-xla
linux-focal-py3_8-clang9-xla-build:
name: linux-focal-py3_8-clang9-xla
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-focal-py3.9-clang9-xla
build-environment: linux-focal-py3.8-clang9-xla
docker-image-name: 308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/xla_base:v1.1-lite
test-matrix: |
{ include: [
@ -390,14 +390,14 @@ jobs:
]}
secrets: inherit
linux-focal-py3_9-clang9-xla-test:
name: linux-focal-py3_9-clang9-xla
linux-focal-py3_8-clang9-xla-test:
name: linux-focal-py3_8-clang9-xla
uses: ./.github/workflows/_linux-test.yml
needs: linux-focal-py3_9-clang9-xla-build
needs: linux-focal-py3_8-clang9-xla-build
with:
build-environment: linux-focal-py3.9-clang9-xla
docker-image: ${{ needs.linux-focal-py3_9-clang9-xla-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-py3_9-clang9-xla-build.outputs.test-matrix }}
build-environment: linux-focal-py3.8-clang9-xla
docker-image: ${{ needs.linux-focal-py3_8-clang9-xla-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-py3_8-clang9-xla-build.outputs.test-matrix }}
secrets: inherit
win-vs2019-cpu-py3-build:
@ -488,14 +488,14 @@ jobs:
]}
secrets: inherit
linux-jammy-py3_9-gcc11-mobile-lightweight-dispatch-build:
name: linux-jammy-py3.9-gcc11-mobile-lightweight-dispatch-build
linux-jammy-py3_8-gcc11-mobile-lightweight-dispatch-build:
name: linux-jammy-py3.8-gcc11-mobile-lightweight-dispatch-build
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-jammy-py3.9-gcc111-mobile-lightweight-dispatch-build
docker-image-name: pytorch-linux-jammy-py3.9-gcc11
build-environment: linux-jammy-py3.8-gcc111-mobile-lightweight-dispatch-build
docker-image-name: pytorch-linux-jammy-py3.8-gcc11
build-generates-artifacts: false
test-matrix: |
{ include: [

View File

@ -1,40 +0,0 @@
name: Validate Runner Determinator Script is in Sync
on:
# Run on PRs when the runner-determinator script is updated to ensure it's copies are kept in sync
pull_request:
paths:
- .github/workflows/_runner-determinator.yml
- .github/workflows/runner-determinator-validator.yml
- .github/scripts/runner_determinator.py
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true
jobs:
check-runner-determinator:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run Hardcode runner-determinator script
id: hardcode-script
run: |
# Extract the script content from _runner-determinator.yml and skip the first 10 spaces of each line
script_content=$(awk '/cat <<EOF > runner_determinator.py/{flag=1;next}/EOF$/{flag=0}flag{print substr($0, 11)}' .github/workflows/_runner-determinator.yml)
# Write the extracted script content to runner_determinator.py
echo "$script_content" > runner_determinator_workflow.py
- name: Compare runner-determinator script embedded in workflow with checked in script
run: |
# Compare the extracted runner_determinator script with the existing one
# If this check fails, then make sure the contents of .github/scripts/runner_determinator.py is in sync with the
# version embedded into .github/workflows/_runner-determinator.yml
diff runner_determinator_workflow.py .github/scripts/runner_determinator.py
# Fail the job if the scripts are not identical
continue-on-error: false

View File

@ -102,30 +102,30 @@ jobs:
docker-image: ${{ needs.linux-focal-cuda12_1-py3_10-gcc9-sm86-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-cuda12_1-py3_10-gcc9-sm86-build.outputs.test-matrix }}
linux-focal-py3_9-clang10-build:
name: linux-focal-py3.9-clang10
linux-focal-py3_8-clang10-build:
name: linux-focal-py3.8-clang10
uses: ./.github/workflows/_linux-build.yml
needs: get-label-type
with:
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
build-environment: linux-focal-py3.9-clang10
docker-image-name: pytorch-linux-focal-py3.9-clang10
build-environment: linux-focal-py3.8-clang10
docker-image-name: pytorch-linux-focal-py3.8-clang10
test-matrix: |
{ include: [
{ config: "slow", shard: 1, num_shards: 2, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },
{ config: "slow", shard: 2, num_shards: 2, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },
]}
linux-focal-py3_9-clang10-test:
name: linux-focal-py3.9-clang10
linux-focal-py3_8-clang10-test:
name: linux-focal-py3.8-clang10
uses: ./.github/workflows/_linux-test.yml
needs:
- linux-focal-py3_9-clang10-build
- linux-focal-py3_8-clang10-build
- target-determination
with:
build-environment: linux-focal-py3.9-clang10
docker-image: ${{ needs.linux-focal-py3_9-clang10-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-py3_9-clang10-build.outputs.test-matrix }}
build-environment: linux-focal-py3.8-clang10
docker-image: ${{ needs.linux-focal-py3_8-clang10-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-focal-py3_8-clang10-build.outputs.test-matrix }}
linux-focal-rocm6_1-py3_8-build:
name: linux-focal-rocm6.1-py3.8

View File

@ -21,7 +21,7 @@ on:
jobs:
stale:
if: ${{ github.repository == 'pytorch/pytorch' }}
runs-on: linux.large
runs-on: linux.large.arc
permissions:
contents: read
pull-requests: write

View File

@ -2,7 +2,7 @@ name: Upload test stats
on:
workflow_run:
workflows: [pull, trunk, periodic, inductor, unstable, slow, unstable-periodic, inductor-periodic, rocm, inductor-micro-benchmark, inductor-micro-benchmark-x86, inductor-cu124, inductor-rocm]
workflows: [pull, trunk, periodic, inductor, unstable, slow, unstable-periodic, inductor-periodic, rocm, inductor-micro-benchmark, inductor-cu124, inductor-rocm]
types:
- completed

View File

@ -49,12 +49,3 @@ jobs:
build-environment: linux-jammy-xpu-py3.9
docker-image: ${{ needs.linux-jammy-xpu-py3_9-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-xpu-py3_9-build.outputs.test-matrix }}
windows-xpu-build:
name: win-vs2022-xpu-py3
uses: ./.github/workflows/_win-build.yml
with:
build-environment: win-vs2022-xpu-py3
cuda-version: cpu
use-xpu: true
vc-year: '2022'

View File

@ -138,7 +138,7 @@ init_command = [
'--dry-run={{DRYRUN}}',
'numpy==1.24.3 ; python_version == "3.8"',
'numpy==1.26.0 ; python_version >= "3.9"',
'expecttest==0.2.1',
'expecttest==0.1.6',
'mypy==1.10.0',
'sympy==1.12.1 ; python_version == "3.8"',
'sympy==1.13.0 ; python_version >= "3.9"',
@ -1482,7 +1482,7 @@ init_command = [
'black==23.12.1',
'usort==1.0.8.post1',
'isort==5.13.2',
'ruff==0.6.3', # sync with RUFF
'ruff==0.6.0', # sync with RUFF
]
is_formatter = true
@ -1567,7 +1567,7 @@ init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'ruff==0.6.3', # sync with PYFMT
'ruff==0.6.0', # sync with PYFMT
]
is_formatter = true

View File

@ -332,7 +332,6 @@ intern_build_aten_ops(
"@fbgemm",
"@mkl",
"@sleef",
"@mkl_dnn//:mkl-dnn",
],
)

View File

@ -57,6 +57,7 @@ nn/qat/ @jerryzh168
# Docker
/.ci/docker/ @jeffdaily
/.ci/docker/ci_commit_pins/triton.txt @desertfire @Chillee @eellison @shunting314 @bertmaher @jeffdaily @jataylo @jithunnair-amd @pruthvistony
/.ci/docker/ci_commit_pins/triton-rocm.txt @jeffdaily @jataylo @jithunnair-amd @pruthvistony
/.ci/docker/ci_commit_pins/triton-xpu.txt @EikanWang @gujinghui
# Github Actions

View File

@ -50,7 +50,6 @@ Following is the Release Compatibility Matrix for PyTorch releases:
| PyTorch version | Python | Stable CUDA | Experimental CUDA | Stable ROCm |
| --- | --- | --- | --- | --- |
| 2.5 | >=3.9, <=3.12, (3.13 experimental) | CUDA 11.8, CUDA 12.1, CUDA 12.4, CUDNN 9.1.0.70 | None | ROCm 6.2 |
| 2.4 | >=3.8, <=3.12 | CUDA 11.8, CUDA 12.1, CUDNN 9.1.0.70 | CUDA 12.4, CUDNN 9.1.0.70 | ROCm 6.1 |
| 2.3 | >=3.8, <=3.11, (3.12 experimental) | CUDA 11.8, CUDNN 8.7.0.84 | CUDA 12.1, CUDNN 8.9.2.26 | ROCm 6.0 |
| 2.2 | >=3.8, <=3.11, (3.12 experimental) | CUDA 11.8, CUDNN 8.7.0.84 | CUDA 12.1, CUDNN 8.9.2.26 | ROCm 5.7 |

View File

@ -52,7 +52,7 @@ class TORCH_API Context {
} else if (device_type == at::kIPU) {
return at::detail::getIPUHooks().getDefaultIPUGenerator(device.index());
} else if (device_type == at::kPrivateUse1) {
return at::detail::getPrivateUse1Hooks().getDefaultGenerator(
return at::GetPrivateUse1HooksInterface()->getDefaultGenerator(
device.index());
} else {
AT_ERROR(c10::DeviceTypeName(device_type), " device type not enabled.");
@ -91,7 +91,7 @@ class TORCH_API Context {
} else if (device_type == at::kXPU) {
return at::detail::getXPUHooks().getDeviceFromPtr(data);
} else if (device_type == at::kPrivateUse1) {
return at::detail::getPrivateUse1Hooks().getDeviceFromPtr(data);
return at::GetPrivateUse1HooksInterface()->getDeviceFromPtr(data);
} else {
AT_ERROR(c10::DeviceTypeName(device_type), " device type not enabled.");
}
@ -182,7 +182,7 @@ class TORCH_API Context {
void lazyInitPrivateUse1() {
c10::call_once(thp_init, [&] {
if (isPrivateUse1HooksRegistered()) {
at::detail::getPrivateUse1Hooks().initPrivateUse1();
at::GetPrivateUse1HooksInterface()->initPrivateUse1();
}
});
}

View File

@ -21,7 +21,7 @@ c10::Allocator* GetCPUAllocatorMaybePinned(bool pin_memory) {
} else if (at::globalContext().hasXPU()) {
return at::detail::getXPUHooks().getPinnedMemoryAllocator();
} else if(at::isPrivateUse1HooksRegistered()) {
return at::detail::getPrivateUse1Hooks().getPinnedMemoryAllocator();
return at::GetPrivateUse1HooksInterface()->getPinnedMemoryAllocator();
} else {
TORCH_CHECK(false, "Need to provide pin_memory allocator to use pin memory.")
}

View File

@ -707,12 +707,7 @@ bool are_all_mutations_under_no_grad_or_inference_mode(const Tensor& functional_
}
bool isFunctionalTensor(const at::Tensor& tensor) {
return tensor.unsafeGetTensorImpl()->key_set().has(c10::DispatchKey::Functionalize);
}
bool isBaseTensor(const at::Tensor& tensor) {
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(isFunctionalTensor(tensor));
return unsafeGetFunctionalWrapper(tensor)->isBaseTensor();
return tensor.unsafeGetTensorImpl()->key_set().has(c10::DispatchKey::Functionalize);
}
bool isFunctionalTensor(const std::optional<Tensor>& t) {

View File

@ -165,12 +165,6 @@ struct TORCH_API FunctionalTensorWrapper : public c10::TensorImpl {
was_storage_changed_ = true;
}
// A FunctionalTensor is considered a base if its not a view of another
// tensor.
bool isBaseTensor() const {
return view_metas_.empty();
}
c10::SymInt get_storage_size(bool before) {
return functional_storage_impl()->get_storage_size(before);
}
@ -296,8 +290,6 @@ TORCH_API inline FunctionalTensorWrapper* unsafeGetFunctionalWrapper(
return functional_impl;
}
TORCH_API bool isBaseTensor(const at::Tensor& tensor);
TORCH_API bool isFunctionalTensor(const at::Tensor& tensor);
TORCH_API bool isFunctionalTensor(const std::optional<Tensor>& t);
TORCH_API bool isFunctionalTensor(

View File

@ -1,7 +1,6 @@
#include <ATen/ThreadLocalState.h>
#if !defined(CAFFE2_IS_XPLAT_BUILD) && !defined(C10_MOBILE) && !defined(BUILD_LITE_INTERPRETER)
#include <ATen/autocast_mode.h>
#if !defined(CAFFE2_IS_XPLAT_BUILD) && !defined(C10_MOBILE)
#include <ATen/core/grad_mode.h>
#endif
@ -19,13 +18,7 @@ ThreadLocalState::ThreadLocalState()
torch_dispatch_mode_state_(c10::impl::TorchDispatchModeTLS::get_state()), python_dispatcher_state_(c10::impl::PythonDispatcherTLS::get_state()),
python_torch_function_state_(at::impl::PythonTorchFunctionTLS::get_state()),
saved_tensors_default_hooks_state_(at::SavedTensorDefaultHooks::get_tls_state()), functionalization_reapply_views_state_(at::functionalization::impl::getFunctionalizationReapplyViewsTLS()),
saved_objects_(at::impl::ThreadLocalPythonObjects::get_state()) {
#if !defined(CAFFE2_IS_XPLAT_BUILD) && !defined(C10_MOBILE) && !defined(BUILD_LITE_INTERPRETER)
for(uint8_t i=0; i<autocast_dtypes_.size(); i++) {
autocast_dtypes_[i] = at::autocast::get_autocast_dtype(static_cast<at::DeviceType>(i));
}
#endif
}
saved_objects_(at::impl::ThreadLocalPythonObjects::get_state()) {}
void ThreadLocalState::set_grad_mode(bool enabled) {
autograd_tls_.set_grad_mode(enabled);
@ -61,11 +54,6 @@ void ThreadLocalState::setThreadLocalState(
at::functionalization::impl::setFunctionalizationReapplyViewsTLS(state.functionalization_reapply_views_state_);
at::impl::ThreadLocalPythonObjects::set_state(state.saved_objects_);
#if !defined(CAFFE2_IS_XPLAT_BUILD) && !defined(C10_MOBILE) && !defined(BUILD_LITE_INTERPRETER)
for(uint8_t i=0; i<state.autocast_dtypes_.size(); i++) {
at::autocast::set_autocast_dtype(static_cast<at::DeviceType>(i), state.autocast_dtypes_[i]);
}
#endif
}
} // namespace at

View File

@ -78,13 +78,6 @@ class TORCH_API ThreadLocalState {
// TLS for arbitrary python objects that is registered via hooks
at::impl::ThreadLocalPythonObjects saved_objects_;
#if !defined(CAFFE2_IS_XPLAT_BUILD) && !defined(C10_MOBILE) && \
!defined(BUILD_LITE_INTERPRETER)
// TLS for autocast dtypes
std::array<at::ScalarType, at::COMPILE_TIME_MAX_DEVICE_TYPES>
autocast_dtypes_;
#endif
friend class ThreadLocalStateGuard;
};

View File

@ -69,7 +69,7 @@ thread_local std::array<at::ScalarType, at::COMPILE_TIME_MAX_DEVICE_TYPES>
at::ScalarType::Undefined, // Vulkan
at::ScalarType::Undefined, // Metal
at::kHalf, // XPU
at::kHalf, // MPS
at::ScalarType::Undefined, // MPS
at::ScalarType::Undefined, // Meta (tensors with no data)
at::kBFloat16, // HPU / HABANA
at::ScalarType::Undefined, // SX-Aurora / NEC
@ -206,118 +206,6 @@ TORCH_LIBRARY_IMPL(aten, Autocast, m) {
TORCH_FN((&at::autocast::binary_cross_entropy_banned)));
}
TORCH_LIBRARY_IMPL(_, AutocastMPS, m) {
m.fallback(torch::CppFunction::makeFallthrough());
}
TORCH_LIBRARY_IMPL(aten, AutocastMPS, m) {
// lower_precision_fp
KERNEL_MPS2(_convolution, deprecated, lower_precision_fp)
KERNEL_MPS(_convolution, lower_precision_fp)
KERNEL_MPS(conv1d, lower_precision_fp)
KERNEL_MPS(conv2d, lower_precision_fp)
KERNEL_MPS(conv_tbc, lower_precision_fp)
KERNEL_MPS(conv_transpose1d, lower_precision_fp)
KERNEL_MPS2(conv_transpose2d, input, lower_precision_fp)
KERNEL_MPS(convolution, lower_precision_fp)
KERNEL_MPS(_mps_convolution, lower_precision_fp)
KERNEL_MPS(prelu, lower_precision_fp)
KERNEL_MPS(addmm, lower_precision_fp)
KERNEL_MPS(addmv, lower_precision_fp)
KERNEL_MPS(addr, lower_precision_fp)
KERNEL_MPS(matmul, lower_precision_fp)
KERNEL_MPS(einsum, lower_precision_fp)
KERNEL_MPS(mm, lower_precision_fp)
KERNEL_MPS(mv, lower_precision_fp)
KERNEL_MPS(linear, lower_precision_fp)
KERNEL_MPS(addbmm, lower_precision_fp)
KERNEL_MPS(baddbmm, lower_precision_fp)
KERNEL_MPS(bmm, lower_precision_fp)
KERNEL_MPS(chain_matmul, lower_precision_fp)
KERNEL_MPS(linalg_multi_dot, lower_precision_fp)
KERNEL_MPS(lstm_cell, lower_precision_fp)
// fp32
KERNEL_MPS(acos, fp32)
KERNEL_MPS(asin, fp32)
KERNEL_MPS(cosh, fp32)
KERNEL_MPS(erfinv, fp32)
KERNEL_MPS(exp, fp32)
KERNEL_MPS(expm1, fp32)
KERNEL_MPS(log, fp32)
KERNEL_MPS(log10, fp32)
KERNEL_MPS(log2, fp32)
KERNEL_MPS(log1p, fp32)
KERNEL_MPS(reciprocal, fp32)
KERNEL_MPS(rsqrt, fp32)
KERNEL_MPS(sinh, fp32)
KERNEL_MPS(tan, fp32)
KERNEL_MPS2(pow, Tensor_Scalar, fp32)
KERNEL_MPS2(pow, Tensor_Tensor, fp32)
KERNEL_MPS2(pow, Scalar, fp32)
KERNEL_MPS(softplus, fp32)
KERNEL_MPS(layer_norm, fp32)
KERNEL_MPS(native_layer_norm, fp32)
KERNEL_MPS(group_norm, fp32)
KERNEL_MPS2(frobenius_norm, dim, fp32)
KERNEL_MPS(nuclear_norm, fp32)
KERNEL_MPS2(nuclear_norm, dim, fp32)
KERNEL_MPS(batch_norm, fp32)
KERNEL_MPS(cosine_similarity, fp32)
KERNEL_MPS(poisson_nll_loss, fp32)
KERNEL_MPS(cosine_embedding_loss, fp32)
KERNEL_MPS(nll_loss, fp32)
KERNEL_MPS(nll_loss2d, fp32)
KERNEL_MPS(hinge_embedding_loss, fp32)
KERNEL_MPS(kl_div, fp32)
KERNEL_MPS(l1_loss, fp32)
KERNEL_MPS(smooth_l1_loss, fp32)
KERNEL_MPS(huber_loss, fp32)
KERNEL_MPS(mse_loss, fp32)
KERNEL_MPS(margin_ranking_loss, fp32)
KERNEL_MPS(multilabel_margin_loss, fp32)
KERNEL_MPS(soft_margin_loss, fp32)
KERNEL_MPS(triplet_margin_loss, fp32)
KERNEL_MPS(multi_margin_loss, fp32)
KERNEL_MPS(binary_cross_entropy_with_logits, fp32)
KERNEL_MPS(dist, fp32)
KERNEL_MPS(pdist, fp32)
KERNEL_MPS(cdist, fp32)
KERNEL_MPS(renorm, fp32)
KERNEL_MPS(logsumexp, fp32)
// fp32_set_opt_dtype
KERNEL_MPS(prod, fp32)
KERNEL_MPS2(prod, dim_int, fp32)
KERNEL_MPS2(prod, dim_Dimname, fp32)
KERNEL_MPS2(softmax, int, fp32)
KERNEL_MPS2(softmax, Dimname, fp32)
KERNEL_MPS2(log_softmax, int, fp32)
KERNEL_MPS2(log_softmax, Dimname, fp32)
KERNEL_MPS(cumprod, fp32)
KERNEL_MPS2(cumprod, dimname, fp32)
KERNEL_MPS(cumsum, fp32)
KERNEL_MPS2(cumsum, dimname, fp32)
KERNEL_MPS(linalg_vector_norm, fp32)
KERNEL_MPS(linalg_matrix_norm, fp32)
KERNEL_MPS2(linalg_matrix_norm, str_ord, fp32)
KERNEL_MPS(sum, fp32)
KERNEL_MPS2(sum, dim_IntList, fp32)
KERNEL_MPS2(sum, dim_DimnameList, fp32)
//
// promote
KERNEL_MPS(addcdiv, promote)
KERNEL_MPS(addcmul, promote)
KERNEL_MPS(atan2, promote)
KERNEL_MPS(bilinear, promote)
KERNEL_MPS(cross, promote)
KERNEL_MPS(dot, promote)
KERNEL_MPS(grid_sampler, promote)
KERNEL_MPS(index_put, promote)
KERNEL_MPS(tensordot, promote)
KERNEL_MPS(scatter_add, promote)
}
TORCH_LIBRARY_IMPL(_, AutocastCPU, m) {
m.fallback(torch::CppFunction::makeFallthrough());
}

View File

@ -145,8 +145,6 @@ inline bool is_autocast_eligible(
return tensor.is_xla() && tensor.is_floating_point();
case c10::DeviceType::PrivateUse1:
return tensor.is_privateuseone() && tensor.is_floating_point();
case c10::DeviceType::MPS:
return tensor.is_mps() && tensor.is_floating_point();
default:
return false;
}
@ -170,8 +168,6 @@ inline DispatchKey get_autocast_dispatch_key_from_device_type(
return DispatchKey::AutocastXLA;
case c10::DeviceType::PrivateUse1:
return DispatchKey::AutocastPrivateUse1;
case c10::DeviceType::MPS:
return DispatchKey::AutocastMPS;
default:
throw std::runtime_error(
"unknown device type for autocast in get_autocast_dispatch_key_from_device_type");
@ -182,7 +178,7 @@ inline bool is_autocast_available(c10::DeviceType device_type) {
if (device_type == at::kCPU || device_type == at::kCUDA ||
device_type == at::kXPU || device_type == at::kIPU ||
device_type == at::kHPU || device_type == at::kXLA ||
device_type == at::kPrivateUse1 || device_type == at::kMPS) {
device_type == at::kPrivateUse1) {
return true;
} else {
return false;
@ -749,27 +745,6 @@ copy pasted in from VariableTypeEverything.cpp with appropriate substitutions.
REDISPATCH_SIGNATURE, \
POLICY)
// KERNEL_MPS registration for AutocastMPS
#define KERNEL_MPS(OP, POLICY) \
m.impl( \
TORCH_SELECTIVE_NAME("aten::" #OP), \
&WrapFunction< \
CastPolicy::POLICY, \
DeviceType::MPS, \
decltype(ATEN_FN(OP)), \
decltype(ATEN_FN(OP)), \
&ATEN_FN(OP)>::type::call);
#define KERNEL_MPS2(OP, OVERLOAD, POLICY) \
m.impl( \
TORCH_SELECTIVE_NAME("aten::" #OP "." #OVERLOAD), \
&WrapFunction< \
CastPolicy::POLICY, \
DeviceType::MPS, \
decltype(ATEN_FN2(OP, OVERLOAD)), \
decltype(ATEN_FN2(OP, OVERLOAD)), \
&ATEN_FN2(OP, OVERLOAD)>::type::call);
// Op lists for different policies.
// To make sure other backends can reuse the policy op list.
#define AT_FORALL_LOWER_PRECISION_FP(_) \

View File

@ -197,411 +197,4 @@ bool FunctionSchema::may_contain_alias(const SchemaArgument& lhs, const SchemaAr
return rhsWildcard || canAliasTypeSetsAlias(lhsContainedTypes, rhsContainedTypes);
}
}
std::ostream& operator<<(std::ostream& out, const FunctionSchema& schema) {
// eventually this should look almost identical to python arg parser, but
// it is simpler for now to work directly on this schema
out << schema.name();
if (!schema.overload_name().empty()) {
out << "." << schema.overload_name();
}
out << "(";
bool seen_kwarg_only = false;
for (const auto i : c10::irange(schema.arguments().size())) {
if (i > 0) out << ", ";
if (schema.arguments()[i].kwarg_only() && !seen_kwarg_only) {
out << "*, ";
seen_kwarg_only = true;
}
out << schema.arguments()[i];
}
if(schema.is_vararg()) {
if(!schema.arguments().empty())
out << ", ";
out << "...";
}
out << ") -> ";
const auto& returns = schema.returns();
/*
* We should skip parenthesis if we return a single item and it's not varret,
* or we return nothing but varret.
*
* Need special handling for schema
* aten::items.str(Dict(str, t) self) -> (str,t)[]
* Even though this schema returns a single item, we need add parenthesis.
* The is necessary so the printed schema can be parsed by the C++ SchemaParser
* Without the extra parenthesis, the parser sees the first parenthesis in '(str,t)' and mistakenly
* treat the return type as a tuple. An alternative is to enhance the Lexer
* to lookahead multiple tokens to accurately decide if the return type is
* a tuple.
*/
bool need_paren = !(
(returns.size() == 1 && !schema.is_varret()) ||
(returns.empty() && schema.is_varret()));
if (returns.size() == 1 && !schema.is_varret()) {
std::stringstream return_ss;
return_ss << returns.at(0);
auto return_str = return_ss.str();
// enclosing the single return item with parenthesis if the return type
// starts with a left parenthesis.
//
// There are 2 cases
// 1. something like 'aten::items.str(Dict(str, t) self) -> ((str, t)[])'.
// without the extra parenthesis, the c++ schem parser can not parse it.
// 2. something like '-> ((str, str))'. Need extra parenthesis so the return
// type is a single tuple rather than two strings.
// PR (https://github.com/pytorch/pytorch/pull/23204) has more context about
// this. test_serialize_and_deserialize (https://github.com/pytorch/pytorch/blob/master/test/test_function_schema.py#L15)
// also covers this case.
if (!return_str.empty() && return_str.front() == '(') {
need_paren = true;
}
}
if (need_paren) {
out << "(";
}
for (const auto i : c10::irange(returns.size())) {
if (i > 0) {
out << ", ";
}
out << returns.at(i);
}
if (schema.is_varret()) {
if (!returns.empty()) {
out << ", ";
}
out << "...";
}
if (need_paren) {
out << ")";
}
return out;
}
static size_t findFirstOutArg(const std::vector<Argument>& args) {
// find the start of out args in the schema
for (const auto out_start_idx : c10::irange(args.size())) {
if (args.at(out_start_idx).is_out()) {
return out_start_idx;
}
}
return args.size();
}
bool Argument::isBackwardCompatibleWith(
const Argument& old,
std::ostream* why_not) const {
const Argument* lhs = this;
const Argument* rhs = &old;
if (!(lhs->name() == rhs->name()
&& lhs->N() == rhs->N()
&& (lhs->alias_info() == rhs->alias_info()
|| (lhs->alias_info() != nullptr && rhs->alias_info() != nullptr
&& *lhs->alias_info() == *rhs->alias_info())))) {
return false;
}
if (lhs->kwarg_only() && !rhs->kwarg_only()) {
return false;
}
if (!rhs->type()->isSubtypeOfExt(*lhs->type(), why_not)) {
return false;
}
if (rhs->default_value().has_value() &&
lhs->default_value() != rhs->default_value()) {
return false;
}
return true;
}
bool Argument::isForwardCompatibleWith(
const Argument& old,
std::ostream* why_not) const {
const Argument* lhs = this;
const Argument* rhs = &old;
if (!(lhs->name() == rhs->name()
&& lhs->N() == rhs->N()
&& (lhs->alias_info() == rhs->alias_info()
|| (lhs->alias_info() != nullptr && rhs->alias_info() != nullptr
&& *lhs->alias_info() == *rhs->alias_info())))) {
return false;
}
if (lhs->kwarg_only() && !rhs->kwarg_only()) {
return false;
}
if (!lhs->type()->isSubtypeOfExt(rhs->type(), why_not)) {
return false;
}
if (rhs->default_value().has_value() &&
lhs->default_value() != rhs->default_value()) {
return false;
}
if (lhs->default_value().has_value() && !rhs->default_value().has_value()) {
return false;
}
return true;
}
std::string FunctionSchema::formatTypeMismatchMsg(
const Argument& expected,
const std::string& actual_type,
std::optional<size_t> position,
std::optional<std::string> value) const {
std::string position_str;
if (position) {
position_str = c10::str("Position: ", *position, "\n");
}
std::string value_str;
if (value) {
value_str = c10::str("Value: ", *value, "\n");
}
return c10::str(
name(),
"() ",
expected.formatTypeMismatchMsg(actual_type),
position_str,
value_str,
"Declaration: ",
*this);
}
bool FunctionSchema::isBackwardCompatibleWith(
const FunctionSchema& old,
std::ostream* why_not) const {
if (!(name() == old.name()
&& overload_name() == old.overload_name()
// we are conservative on is_vararg and is_varret,
// since they are only used by internal operators
&& is_vararg() == old.is_vararg()
&& is_varret() == old.is_varret()
&& returns().size() == old.returns().size()
&& arguments().size() >= old.arguments().size())) {
return false;
}
for (const auto i : c10::irange(returns().size())) {
// Backwards compatibility requires covariance on argument types
// (i.e. more generic), and contravariance on return types (i.e.
// more specific).
if (!old.returns().at(i).isBackwardCompatibleWith(
returns().at(i),
why_not)) {
return false;
}
}
// we want to test both out and default args separately
size_t old_out_start_idx = findFirstOutArg(old.arguments());
size_t new_out_start_idx = findFirstOutArg(arguments());
// make sure among the default args, they are backward compatible
for (const auto i : c10::irange(old_out_start_idx)) {
if (!arguments().at(i).isBackwardCompatibleWith(
old.arguments().at(i), why_not)) {
return false;
}
}
// Validate that all new arguments provided has a default value
for (const auto i : c10::irange(old_out_start_idx, new_out_start_idx)) {
if (!arguments().at(i).default_value()) {
if (why_not) {
*why_not
<< "Function schema not backward compatible since the new argument '"
<< arguments().at(i).name() << "' of type "
<< arguments().at(i).type()->str()
<< " did not provide a default value.";
}
return false;
}
}
// now compare the out args
for (const auto i : c10::irange(old_out_start_idx, old.arguments().size())) {
if (!arguments()
.at(i - old_out_start_idx + new_out_start_idx)
.isBackwardCompatibleWith(old.arguments().at(i), why_not)) {
return false;
}
}
return true;
}
bool FunctionSchema::isForwardCompatibleWith(
const FunctionSchema& old,
std::ostringstream& why_not) const {
if (!(name() == old.name() &&
overload_name() == old.overload_name()
// we are conservative on is_vararg and is_varret,
// since they are only used by internal operators
&& is_vararg() == old.is_vararg() && is_varret() == old.is_varret() &&
returns().size() == old.returns().size())) {
return false;
}
// we want to test both out and default args separately
size_t old_out_start_idx = findFirstOutArg(old.arguments());
size_t new_out_start_idx = findFirstOutArg(arguments());
if (old.arguments().size() - old_out_start_idx !=
arguments().size() - new_out_start_idx) {
if (why_not) {
why_not << "Function schema should have the "
<< "same number of out arguments";
}
return false;
}
// make sure among the default args, they are forward compatible
for (size_t i = 0; i < std::min(old_out_start_idx, new_out_start_idx); i++) {
if (!arguments().at(i).isForwardCompatibleWith(old.arguments().at(i))) {
if (why_not) {
why_not
<< "'" << arguments().at(i).name() << "'"
<< " is not forward compatible with the older version of the schema";
}
return false;
}
}
// Validate that all new arguments provided has a default value
for (size_t i = old_out_start_idx; i < new_out_start_idx; ++i) {
if (!arguments().at(i).default_value()) {
if (why_not) {
why_not
<< "Function schema is not forward compatible since the new argument '"
<< arguments().at(i).name() << "' of type "
<< arguments().at(i).type()->str()
<< " did not provide a default value.";
}
return false;
}
auto default_val = arguments().at(i).default_value().value();
if (default_val.isList() || default_val.isGenericDict()) {
if (why_not) {
why_not
<< "Function schema is not forward compatible since the new argument '"
<< arguments().at(i).name() << "' of type "
<< arguments().at(i).type()->str() << " has a container type "
<< "as its default value.";
}
return false;
}
}
// now compare the out args
for (size_t i = old_out_start_idx; i < old.arguments().size(); i++) {
if (!arguments()
.at(i - old_out_start_idx + new_out_start_idx)
.isForwardCompatibleWith(old.arguments().at(i))) {
if (why_not) {
why_not << "Out argument '"
<< "'" << arguments().at(i).name()
<< " is not FC with the older version of the schema";
}
return false;
}
}
return true;
}
std::string FunctionSchema::findErrorInKwargs(const std::vector<std::string>& kwargs) const {
// First check if any of the kwargs are unknown, i.e. don't match the name of
// any argument in the schema.
for (const auto& kwarg : kwargs) {
if (!std::count_if(
arguments().begin(),
arguments().end(),
[&kwarg](const Argument& argument) {
return argument.name() == kwarg;
})) {
return c10::str(
"Unknown keyword argument '",
kwarg,
"' for operator '",
name(),
"'. Schema: ",
*this);
}
}
// If there are unconsumed kwargs but none of them were unknown, the first
// positional argument present in the kwargs is duplicated.
for (const auto& argument : arguments()) {
if (std::find(kwargs.begin(), kwargs.end(), argument.name()) != kwargs.end()) {
AT_ASSERT(!argument.default_value());
return c10::str(
"Argument '",
argument.name(),
"' specified both as positional and ",
"keyword argument. Schema: ",
*this);
}
}
return "";
}
FunctionSchema FunctionSchema::cloneWithRemappedTypes(
const std::function<TypePtr(TypePtr)> type_map) const {
auto update_args = [&](const std::vector<Argument>& args) {
std::vector<Argument> new_args;
new_args.reserve(args.size());
for(const Argument& arg : args) {
new_args.emplace_back(arg.cloneWithType(type_map(arg.type())));
}
return new_args;
};
return FunctionSchema(
name(),
overload_name(),
update_args(arguments()),
update_args(returns()),
is_vararg(),
is_varret());
}
// covariant subtyping of list of Arguments
static bool isSubtypeOfList(
ArrayRef<Argument> child,
ArrayRef<Argument> parent,
std::ostream* why_not) {
if (child.size() != parent.size()) {
return false;
}
for (const auto i : c10::irange(child.size())) {
const Argument& c = child[i];
const Argument& p = parent[i];
if (c.name() != p.name()) {
return false;
}
if (!c.type()->isSubtypeOfExt(*p.type(), why_not)) {
return false;
}
}
return true;
}
bool FunctionSchema::isSubtypeOf(
const FunctionSchema& rhs,
bool as_method,
std::ostream* why_not) const {
size_t start = as_method ? 1 : 0;
// functions are contravariant in arguments but covariant in returns
return isSubtypeOfList(
ArrayRef<Argument>(rhs.arguments()).slice(start),
ArrayRef<Argument>(arguments()).slice(start),
why_not) &&
isSubtypeOfList(returns(), rhs.returns(), why_not);
}
} // namespace c10

View File

@ -25,7 +25,7 @@ using AliasTypeSet = std::vector<TypePtr>;
bool operator==(const Argument& lhs, const Argument& rhs);
struct TORCH_API Argument {
struct Argument {
Argument(
std::string name = "",
const TypePtr& type = nullptr,
@ -622,7 +622,7 @@ inline std::ostream& operator<<(std::ostream& out, const Argument& arg) {
return out;
}
TORCH_API std::ostream& operator<<(std::ostream& out, const FunctionSchema& schema);
inline std::ostream& operator<<(std::ostream& out, const FunctionSchema& schema);
inline std::string toString(const FunctionSchema& schema) {
std::ostringstream str;

View File

@ -2,8 +2,328 @@
#include <ostream>
#include <sstream>
// note: windows build doesn't find symbols in operator files unless
// this is a header file
namespace c10 {
inline std::ostream& operator<<(std::ostream& out, const FunctionSchema& schema) {
// eventually this should look almost identical to python arg parser, but
// it is simpler for now to work directly on this schema
out << schema.name();
if (!schema.overload_name().empty()) {
out << "." << schema.overload_name();
}
out << "(";
bool seen_kwarg_only = false;
for (const auto i : c10::irange(schema.arguments().size())) {
if (i > 0) out << ", ";
if (schema.arguments()[i].kwarg_only() && !seen_kwarg_only) {
out << "*, ";
seen_kwarg_only = true;
}
out << schema.arguments()[i];
}
if(schema.is_vararg()) {
if(!schema.arguments().empty())
out << ", ";
out << "...";
}
out << ") -> ";
const auto& returns = schema.returns();
/*
* We should skip parenthesis if we return a single item and it's not varret,
* or we return nothing but varret.
*
* Need special handling for schema
* aten::items.str(Dict(str, t) self) -> (str,t)[]
* Even though this schema returns a single item, we need add parenthesis.
* The is necessary so the printed schema can be parsed by the C++ SchemaParser
* Without the extra parenthesis, the parser sees the first parenthesis in '(str,t)' and mistakenly
* treat the return type as a tuple. An alternative is to enhance the Lexer
* to lookahead multiple tokens to accurately decide if the return type is
* a tuple.
*/
bool need_paren = !(
(returns.size() == 1 && !schema.is_varret()) ||
(returns.empty() && schema.is_varret()));
if (returns.size() == 1 && !schema.is_varret()) {
std::stringstream return_ss;
return_ss << returns.at(0);
auto return_str = return_ss.str();
// enclosing the single return item with parenthesis if the return type
// starts with a left parenthesis.
//
// There are 2 cases
// 1. something like 'aten::items.str(Dict(str, t) self) -> ((str, t)[])'.
// without the extra parenthesis, the c++ schem parser can not parse it.
// 2. something like '-> ((str, str))'. Need extra parenthesis so the return
// type is a single tuple rather than two strings.
// PR (https://github.com/pytorch/pytorch/pull/23204) has more context about
// this. test_serialize_and_deserialize (https://github.com/pytorch/pytorch/blob/master/test/test_function_schema.py#L15)
// also covers this case.
if (!return_str.empty() && return_str.front() == '(') {
need_paren = true;
}
}
if (need_paren) {
out << "(";
}
for (const auto i : c10::irange(returns.size())) {
if (i > 0) {
out << ", ";
}
out << returns.at(i);
}
if (schema.is_varret()) {
if (!returns.empty()) {
out << ", ";
}
out << "...";
}
if (need_paren) {
out << ")";
}
return out;
}
inline size_t findFirstOutArg(const std::vector<Argument>& args) {
// find the start of out args in the schema
for (const auto out_start_idx : c10::irange(args.size())) {
if (args.at(out_start_idx).is_out()) {
return out_start_idx;
}
}
return args.size();
}
inline bool Argument::isBackwardCompatibleWith(
const Argument& old,
std::ostream* why_not) const {
const Argument* lhs = this;
const Argument* rhs = &old;
if (!(lhs->name() == rhs->name()
&& lhs->N() == rhs->N()
&& (lhs->alias_info() == rhs->alias_info()
|| (lhs->alias_info() != nullptr && rhs->alias_info() != nullptr
&& *lhs->alias_info() == *rhs->alias_info())))) {
return false;
}
if (lhs->kwarg_only() && !rhs->kwarg_only()) {
return false;
}
if (!rhs->type()->isSubtypeOfExt(*lhs->type(), why_not)) {
return false;
}
if (rhs->default_value().has_value() &&
lhs->default_value() != rhs->default_value()) {
return false;
}
return true;
}
inline bool Argument::isForwardCompatibleWith(
const Argument& old,
std::ostream* why_not) const {
const Argument* lhs = this;
const Argument* rhs = &old;
if (!(lhs->name() == rhs->name()
&& lhs->N() == rhs->N()
&& (lhs->alias_info() == rhs->alias_info()
|| (lhs->alias_info() != nullptr && rhs->alias_info() != nullptr
&& *lhs->alias_info() == *rhs->alias_info())))) {
return false;
}
if (lhs->kwarg_only() && !rhs->kwarg_only()) {
return false;
}
if (!lhs->type()->isSubtypeOfExt(rhs->type(), why_not)) {
return false;
}
if (rhs->default_value().has_value() &&
lhs->default_value() != rhs->default_value()) {
return false;
}
if (lhs->default_value().has_value() && !rhs->default_value().has_value()) {
return false;
}
return true;
}
inline std::string FunctionSchema::formatTypeMismatchMsg(
const Argument& expected,
const std::string& actual_type,
std::optional<size_t> position,
std::optional<std::string> value) const {
std::string position_str;
if (position) {
position_str = c10::str("Position: ", *position, "\n");
}
std::string value_str;
if (value) {
value_str = c10::str("Value: ", *value, "\n");
}
return c10::str(
name(),
"() ",
expected.formatTypeMismatchMsg(actual_type),
position_str,
value_str,
"Declaration: ",
*this);
}
inline bool FunctionSchema::isBackwardCompatibleWith(
const FunctionSchema& old,
std::ostream* why_not) const {
if (!(name() == old.name()
&& overload_name() == old.overload_name()
// we are conservative on is_vararg and is_varret,
// since they are only used by internal operators
&& is_vararg() == old.is_vararg()
&& is_varret() == old.is_varret()
&& returns().size() == old.returns().size()
&& arguments().size() >= old.arguments().size())) {
return false;
}
for (const auto i : c10::irange(returns().size())) {
// Backwards compatibility requires covariance on argument types
// (i.e. more generic), and contravariance on return types (i.e.
// more specific).
if (!old.returns().at(i).isBackwardCompatibleWith(
returns().at(i),
why_not)) {
return false;
}
}
// we want to test both out and default args separately
size_t old_out_start_idx = findFirstOutArg(old.arguments());
size_t new_out_start_idx = findFirstOutArg(arguments());
// make sure among the default args, they are backward compatible
for (const auto i : c10::irange(old_out_start_idx)) {
if (!arguments().at(i).isBackwardCompatibleWith(
old.arguments().at(i), why_not)) {
return false;
}
}
// Validate that all new arguments provided has a default value
for (const auto i : c10::irange(old_out_start_idx, new_out_start_idx)) {
if (!arguments().at(i).default_value()) {
if (why_not) {
*why_not
<< "Function schema not backward compatible since the new argument '"
<< arguments().at(i).name() << "' of type "
<< arguments().at(i).type()->str()
<< " did not provide a default value.";
}
return false;
}
}
// now compare the out args
for (const auto i : c10::irange(old_out_start_idx, old.arguments().size())) {
if (!arguments()
.at(i - old_out_start_idx + new_out_start_idx)
.isBackwardCompatibleWith(old.arguments().at(i), why_not)) {
return false;
}
}
return true;
}
inline bool FunctionSchema::isForwardCompatibleWith(
const FunctionSchema& old,
std::ostringstream& why_not) const {
if (!(name() == old.name() &&
overload_name() == old.overload_name()
// we are conservative on is_vararg and is_varret,
// since they are only used by internal operators
&& is_vararg() == old.is_vararg() && is_varret() == old.is_varret() &&
returns().size() == old.returns().size())) {
return false;
}
// we want to test both out and default args separately
size_t old_out_start_idx = findFirstOutArg(old.arguments());
size_t new_out_start_idx = findFirstOutArg(arguments());
if (old.arguments().size() - old_out_start_idx !=
arguments().size() - new_out_start_idx) {
if (why_not) {
why_not << "Function schema should have the "
<< "same number of out arguments";
}
return false;
}
// make sure among the default args, they are forward compatible
for (size_t i = 0; i < std::min(old_out_start_idx, new_out_start_idx); i++) {
if (!arguments().at(i).isForwardCompatibleWith(old.arguments().at(i))) {
if (why_not) {
why_not
<< "'" << arguments().at(i).name() << "'"
<< " is not forward compatible with the older version of the schema";
}
return false;
}
}
// Validate that all new arguments provided has a default value
for (size_t i = old_out_start_idx; i < new_out_start_idx; ++i) {
if (!arguments().at(i).default_value()) {
if (why_not) {
why_not
<< "Function schema is not forward compatible since the new argument '"
<< arguments().at(i).name() << "' of type "
<< arguments().at(i).type()->str()
<< " did not provide a default value.";
}
return false;
}
auto default_val = arguments().at(i).default_value().value();
if (default_val.isList() || default_val.isGenericDict()) {
if (why_not) {
why_not
<< "Function schema is not forward compatible since the new argument '"
<< arguments().at(i).name() << "' of type "
<< arguments().at(i).type()->str() << " has a container type "
<< "as its default value.";
}
return false;
}
}
// now compare the out args
for (size_t i = old_out_start_idx; i < old.arguments().size(); i++) {
if (!arguments()
.at(i - old_out_start_idx + new_out_start_idx)
.isForwardCompatibleWith(old.arguments().at(i))) {
if (why_not) {
why_not << "Out argument '"
<< "'" << arguments().at(i).name()
<< " is not FC with the older version of the schema";
}
return false;
}
}
return true;
}
template<typename T>
inline void FunctionSchema::checkArg(
const IValue& value,
@ -21,6 +341,41 @@ inline void FunctionSchema::checkArg(
}
}
inline std::string FunctionSchema::findErrorInKwargs(const std::vector<std::string>& kwargs) const {
// First check if any of the kwargs are unknown, i.e. don't match the name of
// any argument in the schema.
for (const auto& kwarg : kwargs) {
if (!std::count_if(
arguments().begin(),
arguments().end(),
[&kwarg](const Argument& argument) {
return argument.name() == kwarg;
})) {
return c10::str(
"Unknown keyword argument '",
kwarg,
"' for operator '",
name(),
"'. Schema: ",
*this);
}
}
// If there are unconsumed kwargs but none of them were unknown, the first
// positional argument present in the kwargs is duplicated.
for (const auto& argument : arguments()) {
if (std::find(kwargs.begin(), kwargs.end(), argument.name()) != kwargs.end()) {
AT_ASSERT(!argument.default_value());
return c10::str(
"Argument '",
argument.name(),
"' specified both as positional and ",
"keyword argument. Schema: ",
*this);
}
}
return "";
}
template <typename T>
inline void FunctionSchema::checkAndNormalizeInputs(
std::vector<IValue>& inputs,
@ -72,4 +427,57 @@ inline void FunctionSchema::checkAndNormalizeInputs(
}
}
inline FunctionSchema FunctionSchema::cloneWithRemappedTypes(
const std::function<TypePtr(TypePtr)> type_map) const {
auto update_args = [&](const std::vector<Argument>& args) {
std::vector<Argument> new_args;
new_args.reserve(args.size());
for(const Argument& arg : args) {
new_args.emplace_back(arg.cloneWithType(type_map(arg.type())));
}
return new_args;
};
return FunctionSchema(
name(),
overload_name(),
update_args(arguments()),
update_args(returns()),
is_vararg(),
is_varret());
}
// covariant subtyping of list of Arguments
inline bool isSubtypeOfList(
ArrayRef<Argument> child,
ArrayRef<Argument> parent,
std::ostream* why_not) {
if (child.size() != parent.size()) {
return false;
}
for (const auto i : c10::irange(child.size())) {
const Argument& c = child[i];
const Argument& p = parent[i];
if (c.name() != p.name()) {
return false;
}
if (!c.type()->isSubtypeOfExt(*p.type(), why_not)) {
return false;
}
}
return true;
}
inline bool FunctionSchema::isSubtypeOf(
const FunctionSchema& rhs,
bool as_method,
std::ostream* why_not) const {
size_t start = as_method ? 1 : 0;
// functions are contravariant in arguments but covariant in returns
return isSubtypeOfList(
ArrayRef<Argument>(rhs.arguments()).slice(start),
ArrayRef<Argument>(arguments()).slice(start),
why_not) &&
isSubtypeOfList(returns(), rhs.returns(), why_not);
}
} // namespace c10

View File

@ -228,7 +228,6 @@ namespace c10 {
_(aten, is_autocast_cpu_enabled) \
_(aten, is_autocast_xla_enabled) \
_(aten, get_autocast_dtype) \
_(aten, is_autocast_mps_enabled) \
FORALL_ATEN_BASE_SYMBOLS(_) \
_(onnx, Add) \
_(onnx, Concat) \

View File

@ -9,7 +9,7 @@
#endif
namespace at::cpu {
bool is_avx2_supported() {
bool is_cpu_support_avx2() {
#if !defined(__s390x__) && !defined(__powerpc__)
return cpuinfo_initialize() && cpuinfo_has_x86_avx2();
#else
@ -17,7 +17,7 @@ bool is_avx2_supported() {
#endif
}
bool is_avx512_supported() {
bool is_cpu_support_avx512() {
#if !defined(__s390x__) && !defined(__powerpc__)
return cpuinfo_initialize() && cpuinfo_has_x86_avx512f() && cpuinfo_has_x86_avx512vl() && cpuinfo_has_x86_avx512bw() && cpuinfo_has_x86_avx512dq();
#else
@ -25,7 +25,7 @@ bool is_avx512_supported() {
#endif
}
bool is_avx512_vnni_supported() {
bool is_cpu_support_avx512_vnni() {
#if !defined(__s390x__) && !defined(__powerpc__)
return cpuinfo_initialize() && cpuinfo_has_x86_avx512vnni();
#else
@ -33,15 +33,7 @@ bool is_avx512_vnni_supported() {
#endif
}
bool is_avx512_bf16_supported() {
#if !defined(__s390x__) && !defined(__powerpc__)
return cpuinfo_initialize() && cpuinfo_has_x86_avx512bf16();
#else
return false;
#endif
}
bool is_amx_tile_supported() {
bool is_cpu_support_amx_tile() {
#if !defined(__s390x__) && !defined(__powerpc__)
return cpuinfo_initialize() && cpuinfo_has_x86_amx_tile();
#else
@ -50,7 +42,7 @@ bool is_amx_tile_supported() {
}
bool init_amx() {
if (!is_amx_tile_supported()) {
if (!is_cpu_support_amx_tile()) {
return false;
}

View File

@ -6,17 +6,14 @@
namespace at::cpu {
TORCH_API bool is_avx2_supported();
TORCH_API bool is_avx512_supported();
TORCH_API bool is_cpu_support_avx2();
TORCH_API bool is_cpu_support_avx512();
// Detect if CPU support Vector Neural Network Instruction.
TORCH_API bool is_avx512_vnni_supported();
// Detect if CPU supports AVX512_BF16 ISA
TORCH_API bool is_avx512_bf16_supported();
TORCH_API bool is_cpu_support_avx512_vnni();
// Detect if CPU support Advanced Matrix Extension.
TORCH_API bool is_amx_tile_supported();
TORCH_API bool is_cpu_support_amx_tile();
// Enable the system to use AMX instructions.
TORCH_API bool init_amx();

View File

@ -43,26 +43,6 @@ struct VecConvert<BFloat16, 1, float, 1> {
}
};
template <>
struct VecConvert<BFloat16, 1, float, 2> {
static inline VectorizedN<BFloat16, 1> apply(
const VectorizedN<float, 2>& src) {
VectorizedN<BFloat16, 1> result;
result[0] = convert_float_bfloat16(src[0], src[1]);
return result;
}
};
template <>
struct VecConvert<float, 2, BFloat16, 1> {
static inline VectorizedN<float, 2> apply(
const VectorizedN<BFloat16, 1>& src) {
VectorizedN<float, 2> result;
std::tie(result[0], result[1]) = convert_bfloat16_float(src[0]);
return result;
}
};
template <>
struct VecConvert<Half, 1, float, 1> {
static inline VectorizedN<Half, 1> apply(const VectorizedN<float, 1>& src) {
@ -72,24 +52,6 @@ struct VecConvert<Half, 1, float, 1> {
}
};
template <>
struct VecConvert<Half, 1, float, 2> {
static inline VectorizedN<Half, 1> apply(const VectorizedN<float, 2>& src) {
VectorizedN<Half, 1> result;
result[0] = convert_float_half(src[0], src[1]);
return result;
}
};
template <>
struct VecConvert<float, 2, Half, 1> {
static inline VectorizedN<float, 2> apply(const VectorizedN<Half, 1>& src) {
VectorizedN<float, 2> result;
std::tie(result[0], result[1]) = convert_half_float(src[0]);
return result;
}
};
template <>
inline Vectorized<double> convert_to_fp_of_same_size<double>(
const Vectorized<int64_t>& src);

View File

@ -636,21 +636,6 @@ inline void transpose_mxn<float, 8, 8>(
_mm256_storeu_ps(&dst[7 * ld_dst], th);
}
template<>
inline void transpose_mxn<float, 16, 16>(
const float* src,
int64_t ld_src,
float* dst,
int64_t ld_dst) {
transpose_mxn<float, 8, 8>(
src , ld_src, dst, ld_dst);
transpose_mxn<float, 8, 8>(
src + 8, ld_src, dst + 8 * ld_dst, ld_dst);
transpose_mxn<float, 8, 8>(
src + 8 * ld_src, ld_src, dst + 8, ld_dst);
transpose_mxn<float, 8, 8>(
src + 8 * ld_src + 8, ld_src, dst + 8 * ld_dst + 8, ld_dst);
}
#endif
}} // namespace at::vec::CPU_CAPABILITY

View File

@ -9,218 +9,49 @@ inline namespace CPU_CAPABILITY {
#if defined(CPU_CAPABILITY_AVX2) && !defined(_MSC_VER)
template <typename T, int dst_n, typename mask_t, int mask_n>
struct VecMaskLoad<
T,
dst_n,
mask_t,
mask_n,
typename std::enable_if_t<
(mask_n == dst_n * 2 && dst_n >= 1) &&
(std::is_same_v<T, float> || std::is_same_v<T, int32_t>),
void>> {
static inline VectorizedN<T, dst_n> apply(
const T* ptr,
const VecMask<mask_t, mask_n>& vec_mask) {
VectorizedN<mask_t, 2> tmp_vec;
VectorizedN<T, dst_n> result;
for (int i = 0; i < dst_n; i++) {
tmp_vec[0] = vec_mask[2 * i];
tmp_vec[1] = vec_mask[2 * i + 1];
auto int64_mask = VecMask<mask_t, 2>(tmp_vec).template cast<int64_t, 2>();
auto int_mask = int64_mask.template cast<int, 1>()[0];
if constexpr (std::is_same_v<T, float>) {
result[i] = Vectorized<T>(
_mm256_maskload_ps(ptr + i * Vectorized<T>::size(), int_mask));
} else {
result[i] = Vectorized<T>(
_mm256_maskload_epi32(ptr + i * Vectorized<T>::size(), int_mask));
}
}
return result;
}
};
template <typename T, int dst_n, typename mask_t>
struct VecMaskLoad<
T,
dst_n,
mask_t,
dst_n,
typename std::enable_if_t<
std::is_same_v<T, float> || std::is_same_v<T, int32_t>,
void>> {
static inline VectorizedN<T, dst_n> apply(
const T* ptr,
const VecMask<mask_t, dst_n>& vec_mask) {
VectorizedN<T, dst_n> result;
#ifndef _MSC_VER
#pragma unroll
#endif
for (int i = 0; i < dst_n; i++) {
auto tmp_mask = VecMask<mask_t, 1>(vec_mask[i]);
auto int_mask = tmp_mask.template cast<int, 1>()[0];
if constexpr (std::is_same_v<T, float>) {
result[i] = Vectorized<T>(
_mm256_maskload_ps(ptr + i * Vectorized<T>::size(), int_mask));
} else {
result[i] = Vectorized<T>(
_mm256_maskload_epi32(ptr + i * Vectorized<T>::size(), int_mask));
}
}
return result;
}
};
template <typename T, typename mask_t>
struct VecMaskLoad<
T,
2,
1,
mask_t,
1,
typename std::enable_if_t<
std::is_same_v<T, int64_t> || std::is_same_v<T, double>>> {
static inline VectorizedN<T, 2> apply(
std::is_same_v<T, float> || std::is_same_v<T, int32_t> ||
std::is_same_v<T, uint32_t>,
void>> {
static inline VectorizedN<T, 1> apply(
const T* ptr,
const VecMask<mask_t, 1>& vec_mask) {
auto int64_mask = vec_mask.template cast<int64_t, 2>();
auto result = at::vec::VectorizedN<T, 2>();
if constexpr (std::is_same_v<T, double>) {
result[0] = _mm256_maskload_pd(ptr, int64_mask[0]);
result[1] = _mm256_maskload_pd(
ptr + at::vec::Vectorized<T>::size(), int64_mask[1]);
auto int_mask = vec_mask.template cast<int, 1>()[0];
if constexpr (std::is_same_v<T, float>) {
return Vectorized<T>(_mm256_maskload_ps(ptr, int_mask));
} else {
result[0] = _mm256_maskload_epi64(
reinterpret_cast<const long long*>(ptr), int64_mask[0]);
result[1] = _mm256_maskload_epi64(
reinterpret_cast<const long long*>(
ptr + at::vec::Vectorized<T>::size()),
int64_mask[1]);
return Vectorized<T>(_mm256_maskload_epi32(ptr, int_mask));
}
return result;
}
};
// TODO: add specialization of VecMaskLoad for bfloat16/half and int8/uint8
template <int N>
struct VecMaskCast<float, N, int, N> {
static inline VecMask<float, N> apply(const VecMask<int, N>& vec_mask) {
VectorizedN<float, N> result;
#ifndef _MSC_VER
#pragma unroll
#endif
for (int i = 0; i < N; ++i) {
result[i] = _mm256_castsi256_ps(vec_mask[i]);
}
return result;
}
};
template <int N>
struct VecMaskCast<int, N, float, N> {
static inline VecMask<int, N> apply(const VecMask<float, N>& vec_mask) {
VectorizedN<int, N> result;
#ifndef _MSC_VER
#pragma unroll
#endif
for (int i = 0; i < N; ++i) {
result[i] = _mm256_castps_si256(vec_mask[i]);
}
return result;
}
};
template <int N>
struct VecMaskCast<int64_t, N, double, N> {
static inline VecMask<int64_t, N> apply(const VecMask<double, N>& vec_mask) {
VectorizedN<int64_t, N> result;
#ifndef _MSC_VER
#pragma unroll
#endif
for (int i = 0; i < N; ++i) {
result[i] = _mm256_castpd_si256(vec_mask[i]);
}
return result;
}
};
template <int N>
struct VecMaskCast<double, N, int64_t, N> {
static inline VecMask<double, N> apply(const VecMask<int64_t, N>& vec_mask) {
VectorizedN<double, N> result;
#ifndef _MSC_VER
#pragma unroll
#endif
for (int i = 0; i < N; ++i) {
result[i] = _mm256_castsi256_pd(vec_mask[i]);
}
return result;
}
};
template <int dst_n, typename mask_t, int mask_n>
struct VecMaskCast<
int64_t,
dst_n,
mask_t,
mask_n,
typename std::enable_if_t<
(dst_n == 2 * mask_n) &&
(std::is_same_v<mask_t, float> || std::is_same_v<mask_t, int>),
void>> {
static inline VecMask<int64_t, dst_n> apply(
const VecMask<mask_t, mask_n>& vec_mask) {
VectorizedN<int64_t, dst_n> result;
auto int_mask = vec_mask.template cast<int, mask_n>();
#ifndef _MSC_VER
#pragma unroll
#endif
for (int i = 0; i < mask_n; ++i) {
auto int64_vec =
convert<int64_t, 2, int, 1>(VectorizedN<int, 1>(int_mask[i]));
result[2 * i] = int64_vec[0];
result[2 * i + 1] = int64_vec[1];
}
return VecMask<int64_t, dst_n>(result);
}
};
template <typename dst_t, int dst_n, int mask_n>
struct VecMaskCast<
dst_t,
dst_n,
int64_t,
mask_n,
typename std::enable_if_t<
(mask_n == 2 * dst_n) &&
(std::is_same_v<dst_t, float> || std::is_same_v<dst_t, int>),
void>> {
static inline VecMask<dst_t, dst_n> apply(
const VecMask<int64_t, mask_n>& vec_mask) {
VectorizedN<int, dst_n> result;
VectorizedN<int64_t, 2> int64_vec;
for (int i = 0; i < dst_n; ++i) {
int64_vec[0] = vec_mask[2 * i];
int64_vec[1] = vec_mask[2 * i + 1];
result[i] = convert<int, 1, int64_t, 2>(int64_vec);
}
return VecMask<int, dst_n>(result).template cast<dst_t, dst_n>();
template <>
struct VecMaskCast<float, 1, int, 1> {
static inline VecMask<float, 1> apply(const VecMask<int, 1>& vec_mask) {
return Vectorized<float>(_mm256_castsi256_ps(vec_mask[0]));
}
};
template <>
struct VecMaskCast<double, 2, float, 1> {
static inline VecMask<double, 2> apply(const VecMask<float, 1>& vec_mask) {
auto int64_mask = VecMaskCast<int64_t, 2, float, 1>::apply(vec_mask);
return VecMaskCast<double, 2, int64_t, 2>::apply(int64_mask);
struct VecMaskCast<int, 1, float, 1> {
static inline VecMask<int, 1> apply(const VecMask<float, 1>& vec_mask) {
return Vectorized<int>(_mm256_castps_si256(vec_mask[0]));
}
};
template <>
struct VecMaskCast<float, 1, double, 2> {
static inline VecMask<float, 1> apply(const VecMask<double, 2>& vec_mask) {
auto int64_mask = VecMaskCast<int64_t, 2, double, 2>::apply(vec_mask);
return VecMaskCast<float, 1, int64_t, 2>::apply(int64_mask);
template <typename dst_t>
struct VecMaskCast<dst_t, 1, int64_t, 2> {
static inline VecMask<dst_t, 1> apply(const VecMask<int64_t, 2>& vec_mask) {
auto int_vec = convert<int, 1, int64_t, 2>(VectorizedN<int64_t, 2>(vec_mask));
return VecMask<int, 1>(int_vec).cast<dst_t, 1>();
}
};
@ -240,42 +71,6 @@ inline bool VecMask<int, 1>::all_masked() const {
return mask == 0xff;
}
template <int N>
struct VecMaskCheck<int64_t, N> {
static inline bool all_zero(const VectorizedN<int64_t, N>& vec_mask) {
bool all_zero = true;
for (int i = 0; i < N; ++i) {
all_zero = all_zero && (_mm256_testz_si256(vec_mask[i], vec_mask[i]) > 0);
if (!all_zero) {
return all_zero;
}
}
return all_zero;
}
static inline bool is_masked(const VectorizedN<int64_t, N>& vec_mask, int i) {
for (int j = 0; j < N; ++j) {
if (i < (j + 1) * 4) {
return _mm256_movemask_pd(_mm256_castsi256_pd(vec_mask[j])) &
(1 << (i - j * 4));
}
}
return false;
}
static inline bool all_masked(const VectorizedN<int64_t, N>& vec_mask) {
bool all_masked = true;
for (int i = 0; i < N; ++i) {
all_masked = all_masked &&
(_mm256_movemask_pd(_mm256_castsi256_pd(vec_mask[i])) == 0x0f);
if (!all_masked) {
return all_masked;
}
}
return all_masked;
}
};
#define VEC_MASK_METHOD_WITH_CAST_TO_INT( \
T, N, return_type, method, args_def, args) \
template <> \

View File

@ -1348,20 +1348,41 @@ static inline void _transpose_mxn_half_32_32(__m512i r[], __m512i d[]) {
// Code referred to FBGEMM:
// https://github.com/pytorch/FBGEMM/blob/39a423e4ad1a04b77fea81c7d09c3e6f8984fae9/src/UtilsAvx512.cc#LL19C6-L19C6
template<>
inline void transpose_mxn<BFloat16>(const BFloat16* src, int64_t ld_src, BFloat16* dst, int64_t ld_dst, int M, int N) {
inline void transpose_mxn<BFloat16, 32, 32>(
const BFloat16* src,
int64_t ld_src,
BFloat16* dst,
int64_t ld_dst) {
// Load from memory
__m512i r[32];
#ifndef __msvc_cl__
#pragma unroll(32)
#endif
for (int i = 0; i < 32; ++i) {
r[i] = _mm512_loadu_si512(reinterpret_cast<const __m512i*>(src + i* ld_src));
}
__m512i d[32];
_transpose_mxn_half_32_32(r, d);
// Store to dst
#ifndef __msvc_cl__
#pragma unroll(32)
#endif
for (int i = 0; i < 32; ++i) {
_mm512_storeu_si512(dst + i* ld_dst, d[i]);
}
}
template <typename T, int M, int N,
typename std::enable_if_t<std::is_same<T, BFloat16>::value && ((M < 32 && M != 16) || (N < 32 && N != 16)), int> = 0>
inline void transpose_mxn(const BFloat16* src, int64_t ld_src, BFloat16* dst, int64_t ld_dst) {
// load from src
TORCH_CHECK(M <= 32 && N <= 32, "transpose_mxn<BFloat16> expects M, N <= 32.");
__mmask32 src_mask = (1 << N) - 1;
__m512i r[32];
int i;
if (N == 32) {
for (i = 0; i < M; ++i) {
r[i] = _mm512_loadu_si512(&src[i * ld_src]);
}
} else {
__mmask32 src_mask = (1 << N) - 1;
for (i = 0; i < M; ++i) {
r[i] = _mm512_maskz_loadu_epi16(src_mask, &src[i * ld_src]);
}
for (i = 0; i < M; ++i) {
r[i] = _mm512_maskz_loadu_epi16(src_mask, &src[i * ld_src]);
}
for (; i < 32; ++i) {
r[i] = _mm512_setzero_si512();
@ -1371,39 +1392,48 @@ inline void transpose_mxn<BFloat16>(const BFloat16* src, int64_t ld_src, BFloat1
_transpose_mxn_half_32_32(r, d);
// store to dst
if (M == 32) {
for (i = 0; i < N; ++i) {
_mm512_storeu_si512(&dst[i * ld_dst], d[i]);
}
} else {
__mmask32 dst_mask = (1 << M) - 1;
for (i = 0; i < N; ++i) {
_mm512_mask_storeu_epi16(&dst[i * ld_dst], dst_mask, d[i]);
}
__mmask32 dst_mask = (1 << M) - 1;
for (i = 0; i < N; ++i) {
_mm512_mask_storeu_epi16(&dst[i * ld_dst], dst_mask, d[i]);
}
}
template <typename T, int M, int N,
typename std::enable_if_t<std::is_same<T, BFloat16>::value && ((M <= 32 && M != 16) || (N <= 32 && N != 16)), int> = 0>
inline void transpose_mxn(const BFloat16* src, int64_t ld_src, BFloat16* dst, int64_t ld_dst) {
transpose_mxn<BFloat16>(src, ld_src, dst, ld_dst, M, N);
}
template<>
inline void transpose_mxn<Half>(const Half* src, int64_t ld_src, Half* dst, int64_t ld_dst, int M, int N) {
TORCH_CHECK(M <= 32 && N <= 32, "transpose_mxn<Half> expects M, N <= 32.");
inline void transpose_mxn<Half, 32, 32>(
const Half* src,
int64_t ld_src,
Half* dst,
int64_t ld_dst) {
// Load from memory
__m512i r[32];
#ifndef __msvc_cl__
#pragma unroll(32)
#endif
for (int i = 0; i < 32; ++i) {
r[i] = _mm512_loadu_si512(reinterpret_cast<const __m512i*>(src + i* ld_src));
}
__m512i d[32];
_transpose_mxn_half_32_32(r, d);
// Store to dst
#ifndef __msvc_cl__
#pragma unroll(32)
#endif
for (int i = 0; i < 32; ++i) {
_mm512_storeu_si512(dst + i* ld_dst, d[i]);
}
}
template <typename T, int M, int N,
typename std::enable_if_t<std::is_same<T, Half>::value && ((M < 32 && M != 16) || (N < 32 && N != 16)), int> = 0>
inline void transpose_mxn(const Half* src, int64_t ld_src, Half* dst, int64_t ld_dst) {
// load from src
__mmask32 src_mask = (1 << N) - 1;
__m512i r[32];
int i;
if (N == 32) {
for (i = 0; i < M; ++i) {
r[i] = _mm512_loadu_si512(&src[i * ld_src]);
}
} else {
__mmask32 src_mask = (1 << N) - 1;
for (i = 0; i < M; ++i) {
r[i] = _mm512_maskz_loadu_epi16(src_mask, &src[i * ld_src]);
}
for (i = 0; i < M; ++i) {
r[i] = _mm512_maskz_loadu_epi16(src_mask, &src[i * ld_src]);
}
for (; i < 32; ++i) {
r[i] = _mm512_setzero_si512();
@ -1413,24 +1443,12 @@ inline void transpose_mxn<Half>(const Half* src, int64_t ld_src, Half* dst, int6
_transpose_mxn_half_32_32(r, d);
// store to dst
if (M == 32) {
for (i = 0; i < N; ++i) {
_mm512_storeu_si512(&dst[i * ld_dst], d[i]);
}
} else {
__mmask32 dst_mask = (1 << M) - 1;
for (i = 0; i < N; ++i) {
_mm512_mask_storeu_epi16(&dst[i * ld_dst], dst_mask, d[i]);
}
__mmask32 dst_mask = (1 << M) - 1;
for (i = 0; i < N; ++i) {
_mm512_mask_storeu_epi16(&dst[i * ld_dst], dst_mask, d[i]);
}
}
template <typename T, int M, int N,
typename std::enable_if_t<std::is_same<T, Half>::value && ((M <= 32 && M != 16) || (N <= 32 && N != 16)), int> = 0>
inline void transpose_mxn(const Half* src, int64_t ld_src, Half* dst, int64_t ld_dst) {
transpose_mxn<Half>(src, ld_src, dst, ld_dst, M, N);
}
template <>
class Vectorized<Half>: public Vectorized16<Half> {
public:

Some files were not shown because too many files have changed in this diff Show More