[CI] Switch Docker base image to CPU-only ubuntu base - #260
Merged
Conversation
YWHyuk
force-pushed
the
claude/lucid-cerf-d0wvoh
branch
from
June 17, 2026 06:54
d49de48 to
c7c27ab
Compare
PyTorchSim never executes CUDA: the npu PrivateUse1 backend (third_party/openreg) simulates CUDA on the CPU and forces math-only SDPA, and flash-attn is never imported. The only thing that required CUDA was find_package(Torch) inheriting it from the CUDA-built torch wheel; installing the CPU wheels removes it, so the whole CUDA base image can go. Dockerfile.base: - Base image ubuntu:22.04 instead of the cuda-cudnn-devel image, kept on 22.04 to match the prebuilt gem5/llvm/spike ABIs (libpython3.11, libprotobuf.so.23). - Python 3.11 via deadsnakes and CPU torch/torchvision wheels. - Remove flash-attn (unused, needed CUDA/nvcc to build). - Install psutil and the other yolov5 hub runtime deps (pyyaml, requests, tqdm, py-cpuinfo) that the old fat base provided implicitly; ultralytics is installed with --no-deps. - Remove duplicate onnx/matplotlib/conan/ninja installs. - Fix the RISC-V toolchain step to download and extract the elf toolchain once (the glibc tarball was downloaded but unused, the elf tarball was extracted twice). - Drop conda/nvidia paths from LD_LIBRARY_PATH. thirdparty/github-releases.json: pytorch_image -> ubuntu:22.04. DeepSeek: its remote modeling file (trust_remote_code) imports flash_attn, which transformers check_imports requires installed even though flash attention is never executed on the npu. Register an import shim in tests/models/DeepSeek/test_deepseek_v3_base.py that satisfies the static import check while leaving is_flash_attn_2_available() False. CI runners: the CPU-only image (~3.7 GB compressed) is small enough to pull on GitHub-hosted runners, so the base build, app build, and the op/model test jobs run on ubuntu-latest. Only test_deepseek (largest model), test_diffusion (UNet2D simulation OOMs the hosted runner), and test_accuracy (accuracy + speedup) stay on self-hosted.
YWHyuk
force-pushed
the
claude/lucid-cerf-d0wvoh
branch
from
June 17, 2026 07:21
c7c27ab to
5ead5b8
Compare
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.
Why
The CI image was built on a CUDA
develPyTorch base (pytorch/pytorch:2.8.0-cuda12.6-cudnn9-devel), which is large and pulls in CUDA/cuDNN that PyTorchSim never uses. The npuPrivateUse1backend (third_party/openreg) simulates CUDA on the CPU and forces math-only SDPA, andflash_attnis never imported anywhere in the repo.The only thing that actually required CUDA was
pip install -e .forPyTorchSimDevice:find_package(Torch REQUIRED)inherits a CUDA requirement from a CUDA-built torch wheel (Caffe2Config.cmakehard-errors when CUDA libs are absent). Installing the CPU torch wheels removes that requirement entirely, so the whole CUDA base image can go.Local verification
On a CPU-only machine (no nvcc), reproduced both states with the device package:
Caffe2Config.cmake:90viaCMakeLists.txt:31 find_package(Torch)(the observed failure).openreg,torch_openreg,torch_bindingsall compile, link, and install.ldd libtorch_bindings.soshows onlytorch_cpu/c10/torch_python— zero CUDA libraries.Changes
Dockerfile.base:ubuntu:22.04instead of the cuda-cudnn-devel image. Kept on ubuntu 22.04 deliberately to match the prebuilt gem5/llvm/spike release ABIs (libpython3.11,libprotobuf.so.23).torch==2.8.0/torchvision==0.23.0from thedownload.pytorch.org/whl/cpuindex.flash-attn(unused; required CUDA/nvcc to build).onnx/matplotlib/conan/ninjainstalls.LD_LIBRARY_PATH.thirdparty/github-releases.json:pytorch_image->ubuntu:22.04. This changes the base pin froma1c21b0fdd36toa2861275228a, soCheck base image existsmisses and CI builds a fresh base image (no skip).What CI still needs to confirm (couldn't run Docker locally)
ubuntu:22.04(soname compat — the reason the distro was kept at 22.04).riscv-pkbuilds (elf toolchain providesriscv64-unknown-elf-gcc).Follow-up (not in this PR)
tutorial/jupyterhub/Dockerfile.tutorialshares the samepytorch_imagemanifest value but assumes a PyTorch/conda base (it does not install torch itself). It only triggers on pushes toispass2026, so it does not affect this PR's CI, but it will need the same CPU treatment or its own pinned base before that workflow is run again.🤖 Generated with Claude Code
Generated by Claude Code