From a0aa6f0986330961e3bd39a9c5c72d9acd62eaaa Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 5 Aug 2026 13:34:07 -0500 Subject: [PATCH] fix: set EXLA make_args via config.exs instead of mix run -e MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mix run -e starts the full OTP application which requires hackney for Swoosh. Instead, put config :exla, :make_args, [-j1] in the temp config.exs — EXLA reads it at compile time via Application.get_env. --- Dockerfile.ci | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index 785cfd81..d73fd2a6 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -31,16 +31,16 @@ WORKDIR /tmp/exla_warm COPY mix.exs mix.lock /tmp/exla_warm/ COPY vendor /tmp/exla_warm/vendor +# Minimal config — nx needs :default_backend to exist. +# Set :exla make_args to -j1 so C++ compiles serially (the default +# nproc-2 can cause parallel OOM kills on CI runners). RUN mkdir -p /tmp/exla_warm/config && \ - printf 'import Config\nconfig :nx, :default_backend, EXLA.Backend\n' > /tmp/exla_warm/config/config.exs + 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. -# Also override make_args to -j1 (EXLA defaults to nproc-2 parallel jobs) -# since elixir_make's sanitized env blocks MAKEFLAGS/DEBUG from reaching make. RUN mix deps.get && \ sed -i 's/-O3/-O0/g' deps/exla/Makefile && \ - mix run -e 'Application.put_env(:exla, :make_args, ["-j1"])' && \ mix deps.compile # Save the full build cache (libexla.so + .o files + xla_extension lib)