Fix numba-cuda CPU import crash after base image upgrade#1548
Merged
stevemessick merged 5 commits intomainfrom Apr 30, 2026
Merged
Fix numba-cuda CPU import crash after base image upgrade#1548stevemessick merged 5 commits intomainfrom
stevemessick merged 5 commits intomainfrom
Conversation
numba-cuda v0.30.0 depends on cuda-bindings which requires libcudart.so at import time. This crashes on the CPU image where no CUDA runtime is installed. Move numba-cuda install into the GPU-only section while keeping the numba upgrade for both CPU and GPU. b/485275559
Move 'from numba import cuda' from module level into the @gpu_test method. numba-cuda v0.30.0 requires libcudart.so at import time, which is not available on the CPU image.
tsfresh -> stumpy -> numba.cuda, which requires libcudart.so. Guard the import so the test is skipped on CPU rather than crashing.
rosbo
reviewed
Apr 30, 2026
|
|
||
| from tsfresh import extract_features | ||
| try: | ||
| from tsfresh import extract_features |
Contributor
There was a problem hiding this comment.
tsfresh should also work without a GPU.
Instead of just skipping tsfresh tests on CPU, uninstall numba-cuda from the Colab base image on CPU builds. This lets tsfresh/stumpy work correctly on CPU without CUDA dependencies. On GPU, numba-cuda is upgraded to v0.30.0 for NumPy 2.4 support.
Now that numba-cuda is uninstalled on the CPU image, tsfresh/stumpy imports work without requiring libcudart.so. No need for the skip guard.
Contributor
Author
|
Good point — fixed. Instead of skipping the tsfresh test on CPU, I now uninstall On GPU, |
rosbo
approved these changes
Apr 30, 2026
Contributor
rosbo
left a comment
There was a problem hiding this comment.
LGTM assuming build & tests are passing.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After merging #1547 (Colab base image upgrade), the main branch CI is failing on the Test CPU Image stage (build #1924). The upgraded
numba-cudav0.30.0 now depends oncuda-bindingswhich requireslibcudart.soat import time — this crashes on the CPU image where no CUDA runtime is installed.Two tests fail:
test_numba—from numba import cudaat module level triggers the crashtest_tsfresh—tsfresh→stumpy→from numba import cuda→ same crashFix
Dockerfile.tmpl
numbaupgrade for both CPU and GPU images (needed for NumPy 2.4)numba-cudainstall into the GPU-only section ({{ if eq .Accelerator "gpu" }})test_numba.py
from numba import cudafrom module-level into the@gpu_testmethod (lazy import)test_tsfresh.py
tsfreshimport with try/except and skip the test if it fails on CPUb/485275559