From 92ca9e49c70d6d3cacf8f0455c64c5385fbd7db7 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Sun, 10 Dec 2023 12:18:03 -0800 Subject: [PATCH 1/6] [BE] Add some test automation for check_binary.sh Make sure latest nightly passes the testing for: - Linux CPU --- .github/workflows/test-check-binary.yml | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/test-check-binary.yml diff --git a/.github/workflows/test-check-binary.yml b/.github/workflows/test-check-binary.yml new file mode 100644 index 000000000..2dec25d58 --- /dev/null +++ b/.github/workflows/test-check-binary.yml @@ -0,0 +1,36 @@ +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: + name: Test check binary + + 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 latest nightly + run: | + pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu + lintrunner init + - name: Run check_binary.sh + run: | + set +e + DESIRED_PYTHON=3.11 DESIRED_CUDA=cpu PACKAGE_TYPE=manywheel ./check_binary.sh From cd6af55ec67c11ecac8cabea2c455373c8e4808e Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Sun, 10 Dec 2023 12:25:43 -0800 Subject: [PATCH 2/6] That is like that --- .github/workflows/test-check-binary.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-check-binary.yml b/.github/workflows/test-check-binary.yml index 2dec25d58..f1ee4b5a6 100644 --- a/.github/workflows/test-check-binary.yml +++ b/.github/workflows/test-check-binary.yml @@ -29,7 +29,6 @@ jobs: - name: Install latest nightly run: | pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu - lintrunner init - name: Run check_binary.sh run: | set +e From 22a0e493637fb912714d904389dbcdf474865a1c Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Sun, 10 Dec 2023 12:42:20 -0800 Subject: [PATCH 3/6] Will it work like that --- .github/workflows/test-check-binary.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-check-binary.yml b/.github/workflows/test-check-binary.yml index f1ee4b5a6..6e6093cbe 100644 --- a/.github/workflows/test-check-binary.yml +++ b/.github/workflows/test-check-binary.yml @@ -17,19 +17,10 @@ concurrency: jobs: check_binary: name: Test check binary - - 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 latest nightly - run: | + 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 - - name: Run check_binary.sh - run: | - set +e DESIRED_PYTHON=3.11 DESIRED_CUDA=cpu PACKAGE_TYPE=manywheel ./check_binary.sh From bc90f7c62452f056175c43f26a6d59445c7694c0 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Sun, 10 Dec 2023 12:47:21 -0800 Subject: [PATCH 4/6] And test on CUDA as well --- .github/workflows/test-check-binary.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-check-binary.yml b/.github/workflows/test-check-binary.yml index 6e6093cbe..1709c341b 100644 --- a/.github/workflows/test-check-binary.yml +++ b/.github/workflows/test-check-binary.yml @@ -15,12 +15,23 @@ concurrency: cancel-in-progress: true jobs: - check_binary: - name: Test check binary + 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 + 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-type: 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 From 324a6b167fc7c5e29cf62bbf020db69fad196554 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Sun, 10 Dec 2023 12:48:48 -0800 Subject: [PATCH 5/6] And another fix --- .github/workflows/test-check-binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-check-binary.yml b/.github/workflows/test-check-binary.yml index 1709c341b..e29ee7ba9 100644 --- a/.github/workflows/test-check-binary.yml +++ b/.github/workflows/test-check-binary.yml @@ -30,7 +30,7 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: "pytorch/builder" - runner-type: linux.4xlarge.nvidia.gpu + runner: linux.4xlarge.nvidia.gpu docker-image: python:3.11 script: | pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 From e4fb930e24d28e7575c9de83a4b75d86830f9405 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Sun, 10 Dec 2023 13:31:25 -0800 Subject: [PATCH 6/6] Better handling for relative paths --- check_binary.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_binary.sh b/check_binary.sh index 2b5f228d6..9a2cf065b 100755 --- a/check_binary.sh +++ b/check_binary.sh @@ -261,7 +261,7 @@ setup_link_flags () { fi } -TEST_CODE_DIR="$(dirname ${BASH_SOURCE[0]})/test_example_code" +TEST_CODE_DIR="$(dirname $(realpath ${BASH_SOURCE[0]}))/test_example_code" build_and_run_example_cpp () { if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then GLIBCXX_USE_CXX11_ABI=1