fix(ci): use DEBUG=1 instead of sed to avoid EXLA OOM
Some checks failed
Build base image / Build and push base image (push) Successful in 15s
Build and Push / Build CI test image (push) Successful in 5m17s
Build and Push / Build and Push Docker Image (push) Failing after 6m9s

Replace fragile sed -i s/-O3/-O0/g with DEBUG=1 env var. EXLA's Makefile
natively checks ifdef DEBUG and uses -g (debug symbols) instead of -O3
(heavy optimization), avoiding the g++ OOM kill on CI runners.

Also set EXLA_CPU_ONLY=1 to skip unnecessary nvcc probing.
This commit is contained in:
Graham McIntire 2026-08-05 14:00:27 -05:00
parent a0aa6f0986
commit 845f23b093

View file

@ -38,10 +38,11 @@ RUN mkdir -p /tmp/exla_warm/config && \
printf 'import Config\nconfig :nx, :default_backend, EXLA.Backend\nconfig :exla, :make_args, ["-j1"]\n' > /tmp/exla_warm/config/config.exs
# Compile all deps. EXLA's Makefile defaults to -O3 which OOM-kills g++
# on low-memory CI runners. Patch it to -O0 before compilation.
# on low-memory CI runners. Set DEBUG=1 so the Makefile uses -g
# (debug symbols, low compile-time memory) instead of -O3 (heavy
# optimization passes). Also set EXLA_CPU_ONLY=1 to skip nvcc probing.
RUN mix deps.get && \
sed -i 's/-O3/-O0/g' deps/exla/Makefile && \
mix deps.compile
DEBUG=1 EXLA_CPU_ONLY=1 mix deps.compile
# Save the full build cache (libexla.so + .o files + xla_extension lib)
# so Make finds all targets already built when restored in the test step.