From eaa74f071656b61f257883f392311b734ce4524d Mon Sep 17 00:00:00 2001 From: ausimian Date: Sat, 6 Jun 2026 12:24:09 +1000 Subject: [PATCH] fix: strip :native_compiled before the evaluator fallback `drop_native_opts/1` removes the Emily-only native knobs before the graceful `native_fallback: :eval` path delegates to `Nx.Defn.Evaluator`, but it missed `:native_compiled` (added in CM14). Drop it too so the function matches its own comment and no Emily-only option leaks into the evaluator's option list. --- lib/emily/compiler.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/emily/compiler.ex b/lib/emily/compiler.ex index 2712263..88507d3 100644 --- a/lib/emily/compiler.ex +++ b/lib/emily/compiler.ex @@ -271,7 +271,8 @@ defmodule Emily.Compiler do # Strip the Emily-only native knobs before delegating to the Evaluator # — it ignores keys it doesn't consume, but handing it `native: true` # when we've decided *not* to compile natively would be misleading. - defp drop_native_opts(opts), do: Keyword.drop(opts, [:native, :native_fallback]) + defp drop_native_opts(opts), + do: Keyword.drop(opts, [:native, :native_fallback, :native_compiled]) defp native_ref(%T{data: %B{ref: r}}), do: r defp native_ref(%T{} = t), do: Nx.backend_transfer(t, B).data.ref