From 4bf007ad64f5907d17c1708f414e42d1329fe99a Mon Sep 17 00:00:00 2001 From: Orion Martin <40585662+95-martin-orion@users.noreply.github.com> Date: Tue, 16 Nov 2021 09:17:53 -0800 Subject: [PATCH 01/41] GPU in wheels, attempt 1 --- .github/workflows/testing_wheels.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index eeb4d741..c64b811d 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -52,6 +52,11 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v2 + # Install NVCC on Ubuntu to include GPU in the wheel. + - name: cuda-toolkit + if: ${{ matrix.os == 'ubuntu-20.04' }} + uses: Jimver/cuda-toolkit@v0.2.4 + - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==1.11.0 From 2b230f72d511768d9eb906fdf3de9e16dff19a37 Mon Sep 17 00:00:00 2001 From: Orion Martin <40585662+95-martin-orion@users.noreply.github.com> Date: Tue, 16 Nov 2021 09:55:12 -0800 Subject: [PATCH 02/41] Checking for nvcc binary --- .github/workflows/testing_wheels.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index c64b811d..89ea34f6 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -53,10 +53,16 @@ jobs: - uses: actions/setup-python@v2 # Install NVCC on Ubuntu to include GPU in the wheel. + # TODO: open issues + # - `which nvcc` finds nothing? (need to add to path?) + # - testing GPU on non-GPU machine will fail - name: cuda-toolkit if: ${{ matrix.os == 'ubuntu-20.04' }} uses: Jimver/cuda-toolkit@v0.2.4 + - name: Check for NVCC + run: which nvcc + - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==1.11.0 From 0c57285b9a19ce7eda6d319b17d27fbdc3b91ae7 Mon Sep 17 00:00:00 2001 From: Orion Martin <40585662+95-martin-orion@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:45:08 -0800 Subject: [PATCH 03/41] PATH testing --- .github/workflows/testing_wheels.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index 89ea34f6..58dc0180 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -55,13 +55,25 @@ jobs: # Install NVCC on Ubuntu to include GPU in the wheel. # TODO: open issues # - `which nvcc` finds nothing? (need to add to path?) + # - nope, confirmed working at workflow level + # - might still be unavailable lower down? seems unlikely + # - still skipping GPU-based tests # - testing GPU on non-GPU machine will fail - name: cuda-toolkit if: ${{ matrix.os == 'ubuntu-20.04' }} uses: Jimver/cuda-toolkit@v0.2.4 - - name: Check for NVCC - run: which nvcc + - name: First check + if: ${{ matrix.os == 'ubuntu-20.04' }} + run: echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}" + + - name: Second check + if: ${{ matrix.os == 'ubuntu-20.04' }} + run: echo $PATH + + - name: Third check + if: ${{ matrix.os == 'ubuntu-20.04' }} + run: PATH="${PATH}:${{steps.cuda-toolkit.outputs.CUDA_PATH}}" - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==1.11.0 From 9d6eac36d47b02520ff5d34475ae4f5ac66acd67 Mon Sep 17 00:00:00 2001 From: Orion Martin <40585662+95-martin-orion@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:50:20 -0800 Subject: [PATCH 04/41] Appease YAML --- .github/workflows/testing_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index 58dc0180..3316acc3 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -65,7 +65,7 @@ jobs: - name: First check if: ${{ matrix.os == 'ubuntu-20.04' }} - run: echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}" + run: echo "Cuda install location ${{steps.cuda-toolkit.outputs.CUDA_PATH}}" - name: Second check if: ${{ matrix.os == 'ubuntu-20.04' }} From d2c2c0066e10a8e9c7ff179e3165e6ff624b31ae Mon Sep 17 00:00:00 2001 From: Orion Martin <40585662+95-martin-orion@users.noreply.github.com> Date: Tue, 16 Nov 2021 13:07:32 -0800 Subject: [PATCH 05/41] CIBW PATH --- .github/workflows/testing_wheels.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index 3316acc3..ad5b29c6 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -58,6 +58,8 @@ jobs: # - nope, confirmed working at workflow level # - might still be unavailable lower down? seems unlikely # - still skipping GPU-based tests + # - checks suggest CUDA is on the path...what now? + # - might not be getting to CIBW # - testing GPU on non-GPU machine will fail - name: cuda-toolkit if: ${{ matrix.os == 'ubuntu-20.04' }} @@ -73,7 +75,8 @@ jobs: - name: Third check if: ${{ matrix.os == 'ubuntu-20.04' }} - run: PATH="${PATH}:${{steps.cuda-toolkit.outputs.CUDA_PATH}}" + env: + CIBW_ENVIRONMENT: PATH=$PATH - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==1.11.0 From bbb7a50bd7530d91b57b669a8c0fb89570b62f0e Mon Sep 17 00:00:00 2001 From: Orion Martin <40585662+95-martin-orion@users.noreply.github.com> Date: Tue, 16 Nov 2021 13:09:06 -0800 Subject: [PATCH 06/41] jumping YAML hoops --- .github/workflows/testing_wheels.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index ad5b29c6..e5ee2002 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -73,11 +73,6 @@ jobs: if: ${{ matrix.os == 'ubuntu-20.04' }} run: echo $PATH - - name: Third check - if: ${{ matrix.os == 'ubuntu-20.04' }} - env: - CIBW_ENVIRONMENT: PATH=$PATH - - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==1.11.0 @@ -85,6 +80,8 @@ jobs: run: bash build_tools/test_libs.sh - name: Build wheels + env: + CIBW_ENVIRONMENT: PATH=$PATH run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From 85220a760f2e6fbd459893d6a279817e4c0809af Mon Sep 17 00:00:00 2001 From: Orion Martin <40585662+95-martin-orion@users.noreply.github.com> Date: Tue, 16 Nov 2021 13:32:21 -0800 Subject: [PATCH 07/41] CIBW which nvcc --- .github/workflows/testing_wheels.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index e5ee2002..42052214 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -45,6 +45,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" # due to package and module name conflict have to temporarily move it away to run tests CIBW_BEFORE_TEST: "mv {package}/qsimcirq /tmp" + CIBW_TEST_COMMAND_LINUX: "which nvcc" CIBW_TEST_COMMAND: "pytest {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}" steps: - uses: actions/checkout@v2 @@ -53,13 +54,15 @@ jobs: - uses: actions/setup-python@v2 # Install NVCC on Ubuntu to include GPU in the wheel. - # TODO: open issues + # TODO: some remaining issues # - `which nvcc` finds nothing? (need to add to path?) # - nope, confirmed working at workflow level # - might still be unavailable lower down? seems unlikely # - still skipping GPU-based tests # - checks suggest CUDA is on the path...what now? # - might not be getting to CIBW + # - tested CIBW_ENVIRONMENT: PATH=$PATH, no visible change + # - new test: `which nvcc` in CIBW # - testing GPU on non-GPU machine will fail - name: cuda-toolkit if: ${{ matrix.os == 'ubuntu-20.04' }} @@ -81,7 +84,7 @@ jobs: - name: Build wheels env: - CIBW_ENVIRONMENT: PATH=$PATH + CIBW_ENVIRONMENT: "PATH=$PATH" run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From 033d67f7c52aba1c8a5e050edd2590ab469e7b98 Mon Sep 17 00:00:00 2001 From: Orion Martin <40585662+95-martin-orion@users.noreply.github.com> Date: Fri, 19 Nov 2021 11:19:16 -0800 Subject: [PATCH 08/41] hardcoded PATH --- .github/workflows/testing_wheels.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index 42052214..dafda644 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -45,6 +45,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" # due to package and module name conflict have to temporarily move it away to run tests CIBW_BEFORE_TEST: "mv {package}/qsimcirq /tmp" + CIBW_TEST_COMMAND_LINUX: "echo $PATH" CIBW_TEST_COMMAND_LINUX: "which nvcc" CIBW_TEST_COMMAND: "pytest {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}" steps: @@ -62,7 +63,10 @@ jobs: # - checks suggest CUDA is on the path...what now? # - might not be getting to CIBW # - tested CIBW_ENVIRONMENT: PATH=$PATH, no visible change - # - new test: `which nvcc` in CIBW + # - new test: `which nvcc` in CIBW (FAILED) + # - next up: + # - try https://github.com/OpenNMT/CTranslate2/blob/master/.github/workflows/ci.yml + # - CIBW_BEFORE_ALL_LINUX: