@@ -88,9 +88,14 @@ defmodule Emily.Compiler do
8888 the decode loop host-controlled but fuses each loop **body** under
8989 `mx::compile`, replaying the cached fused callable every token. Defaults
9090 to `false`; a non-boolean raises `ArgumentError`. Opt-in because the
91- fusion reassociates f32 to within a few ULP — greedy token ids still
92- match the evaluator, but logits are not bit-identical. Only the native
93- path consults it, so it is ignored unless `native: true`.
91+ fusion reassociates f32 to within a few ULP — logits are not
92+ bit-identical to the evaluator. Greedy argmax is robust to that drift
93+ (greedy token ids matched the evaluator in our tests), but the match is
94+ empirical, not guaranteed: any discrete decision the drift can tip —
95+ argmax on a near-tie, or a `while` trip count whose condition reads a
96+ reassociated reduction — diverges once it flips. **Sampling strategies
97+ diverge from the evaluator under fusion** even with a fixed seed. Only
98+ the native path consults it, so it is ignored unless `native: true`.
9499
95100 Any other option is silently dropped. This matches how
96101 `Nx.Defn.Evaluator` and EXLA handle their own option lists, and is
@@ -228,7 +233,7 @@ defmodule Emily.Compiler do
228233 # guarded step: it raises `ArgumentError` on an op or construct it can't
229234 # lower yet, which we turn into a graceful `:fallback` (or re-raise in
230235 # `:raise` mode). `Program.compile/1` is deliberately kept outside the
231- # rescue (in `replay_closure/2 `) — it raises only on malformed IR, i.e. a
236+ # rescue (in `replay_closure/3 `) — it raises only on malformed IR, i.e. a
232237 # compiler bug, which must surface loudly rather than be masked as an
233238 # "unsupported op" fallback.
234239 defp lower ( leaves , mode , key ) do
0 commit comments