From 845f23b093a27e1557452c4aa796493af5afc11d Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 5 Aug 2026 14:00:27 -0500 Subject: [PATCH] fix(ci): use DEBUG=1 instead of sed to avoid EXLA OOM 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. --- Dockerfile.ci | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index d73fd2a6..cd7d6d1b 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -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.