forked from pytorch/builder
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into IFU-main-2024-02-22
- Loading branch information
Showing
87 changed files
with
2,581 additions
and
2,150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg | ||
conda create -yn ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg | ||
conda activate ${ENV_NAME}_pypi | ||
|
||
if [[ ${MATRIX_CHANNEL} != "release" ]]; then | ||
conda run -p ${ENV_NAME}_pypi pip3 install --pre torch --index-url "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}_pypi_cudnn" | ||
conda run -p ${ENV_NAME}_pypi pip3 install --pre torchvision torchaudio --index-url "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}" | ||
TEST_SUFFIX="" | ||
RELEASE_SUFFIX="" | ||
# if RELESE version is passed as parameter - install speific version | ||
if [[ ! -z ${RELEASE_VERSION} ]]; then | ||
RELEASE_SUFFIX="==${RELEASE_VERSION}" | ||
fi | ||
|
||
if [[ ${TORCH_ONLY} == 'true' ]]; then | ||
TEST_SUFFIX=" --package torchonly" | ||
pip3 install torch${RELEASE_SUFFIX} | ||
else | ||
conda run -p ${ENV_NAME}_pypi pip3 install torch torchvision torchaudio | ||
pip3 install torch${RELEASE_SUFFIX} torchvision torchaudio | ||
fi | ||
|
||
conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py | ||
python ./test/smoke_test/smoke_test.py ${TEST_SUFFIX} --runtime-error-check disabled | ||
conda deactivate | ||
conda env remove -p ${ENV_NAME}_pypi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
|
||
retry () { | ||
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*) | ||
} | ||
|
||
BRANCH="" | ||
if [[ ${MATRIX_CHANNEL} == "test" || ${MATRIX_CHANNEL} == "release" ]]; then | ||
SHORT_VERSION=${MATRIX_STABLE_VERSION%.*} | ||
BRANCH="--branch release/${SHORT_VERSION}" | ||
fi | ||
|
||
|
||
# Clone the Pytorch branch | ||
retry git clone ${BRANCH} --depth 1 https://github.com/pytorch/pytorch.git | ||
retry git submodule update --init --recursive | ||
pushd pytorch | ||
|
||
pip install expecttest numpy pyyaml jinja2 packaging hypothesis unittest-xml-reporting scipy | ||
|
||
# Run pytorch cuda wheels validation | ||
# Detect ReduceLogicKernel (ReduceOp and kernel) IMA | ||
python test/test_ops.py -k test_dtypes_all_cuda | ||
# Detect BinaryMulKernel (elementwise binary functor internal mul) IMA | ||
python test/test_torch.py -k test_index_reduce_reduce_prod_cuda_int32 | ||
# Detect BinaryBitwiseOpsKernels (at::native::BitwiseAndFunctor) IMA | ||
python test/test_binary_ufuncs.py -k test_contig_vs_every_other___rand___cuda_int32 | ||
# Detect MaxMinElementwiseKernel (maximum) IMA | ||
python test/test_schema_check.py -k test_schema_correctness_clamp_cuda_int8 | ||
|
||
pushd /tmp | ||
# Detect StepKernel (nextafter) IMA | ||
python -c "import torch; print(torch.nextafter(torch.tensor([-4.5149, -5.9053, -0.9516, -2.3615, 1.5591], device='cuda:0'), torch.tensor(3.8075, device='cuda:0')))" | ||
# Detect BinaryGeometricKernels (atan2) IMA | ||
python -c "import torch; x = (torch.randn((2,1,1), dtype=torch.float, device='cuda')*5).to(torch.float32); y=(torch.randn((), dtype=torch.float, device='cuda')*5).to(torch.float32); print(torch.atan2(x,y))" | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lintrunner: | ||
name: lintrunner | ||
|
||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install Lintrunner | ||
run: | | ||
pip install lintrunner | ||
lintrunner init | ||
- name: Run lintrunner on all files - Linux | ||
run: | | ||
set +e | ||
if ! lintrunner -v --force-color --all-files --tee-json=lint.json; then | ||
echo "" | ||
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner -m main\`.\e[0m" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Test check_binary | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- .github/workflows/test-check-binary.yml | ||
- check_binary.sh | ||
- test/smoke_test/smoke_test.py | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check_binary_linux_cpu: | ||
name: Test check_binary.sh for Linux CPU | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
repository: "pytorch/builder" | ||
docker-image: python:3.11 | ||
script: | | ||
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu | ||
DESIRED_PYTHON=3.11 DESIRED_CUDA=cpu PACKAGE_TYPE=manywheel ./check_binary.sh | ||
check_binary_linux_cuda: | ||
name: Test check_binary.sh for Linux CUDA | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
repository: "pytorch/builder" | ||
runner: linux.4xlarge.nvidia.gpu | ||
docker-image: python:3.11 | ||
script: | | ||
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 | ||
DESIRED_PYTHON=3.11 DESIRED_CUDA=cu121 PACKAGE_TYPE=manywheel ./check_binary.sh |
Oops, something went wrong.