fix: set EXLA make_args via config.exs instead of mix run -e
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.
This commit is contained in:
parent
07dbcbc428
commit
a0aa6f0986
1 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue