From 41eda31bf0ed1dd36d1398993bdfb960d20cd780 Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Wed, 7 Oct 2026 17:19:53 -0700 Subject: [PATCH] Run the device output pybindings test in the CUDA job test_unplanned_device_output_is_device_memory, added in #23547, needs the CUDA backend and a visible GPU. The CPU unittest jobs have neither, so it skips there, and no job ran it. The unittest-cuda job already runs one pybindings device test by name, and treats a skip as a failure. Run the new test in the same command. Test plan: on a Jetson AGX Thor with a wheel that includes #23547, the new test passes through this exact command. --- .github/workflows/cuda.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 5f9ca36f8e7..8c3f3b38064 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -496,25 +496,28 @@ jobs: export LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH # The pybindings loader only asks for device memory on a build that has - # a device allocator registered, so this test cannot run in the CPU - # jobs. It needs the install above and nothing built below, so run it + # a device allocator registered, so these tests cannot run in the CPU + # jobs. They need the install above and nothing built below, so run them # here and fail before the long builds. # - # unittest exits 0 when a test skips, and this test skips when the CUDA + # unittest exits 0 when a test skips, and these tests skip when the CUDA # backend is missing or no GPU is visible. Both are the prerequisites # this job exists to provide, so treat a skip as a failure rather than # let a packaging regression pass silently. `tee` would otherwise hide # the real exit status behind its own, so read it back explicitly. set +e - python -m unittest -v executorch.extension.pybindings.test.test_pybindings.PybindingsTest.test_device_planned_method_allocates_on_the_device 2>&1 | tee /tmp/pybindings_device_test.log + python -m unittest -v \ + executorch.extension.pybindings.test.test_pybindings.PybindingsTest.test_device_planned_method_allocates_on_the_device \ + executorch.extension.pybindings.test.test_pybindings.PybindingsTest.test_unplanned_device_output_is_device_memory \ + 2>&1 | tee /tmp/pybindings_device_test.log pybindings_device_status=${PIPESTATUS[0]} set -e if [ "${pybindings_device_status}" -ne 0 ]; then - echo "::error::the pybindings device test failed" + echo "::error::a pybindings device test failed" exit "${pybindings_device_status}" fi if grep -qE "^OK \(skipped=|skipped=[1-9]" /tmp/pybindings_device_test.log; then - echo "::error::the pybindings device test skipped in the CUDA job, which means the CUDA backend or a visible GPU is missing" + echo "::error::a pybindings device test skipped in the CUDA job, which means the CUDA backend or a visible GPU is missing" exit 1 fi