Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,6 @@ checked in alongside the goldens.
macOS (CPU) or Linux+CUDA. Emits a complete `ExlaGoldenData` module:
`elixir bench/exla_golden_gen.exs`.

**Known issue (pre-existing, not M13):**
`test/emily/quantization/transform_test.exs:105` ("round-trip quantized
2-layer MLP predicts close to dense") is seed-dependent flaky — the
relative-error threshold (15 %) sits right at the boundary for some
random inputs. Needs either a wider tolerance or a fixed seed.

### M14 — Serving concurrency cookbook + pooled-serving helper

`Emily.Compiler.__partitions_options__/1` raises on
Expand Down
9 changes: 7 additions & 2 deletions test/emily/quantization/transform_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ defmodule Emily.Quantization.TransformTest do
# Per-element int4 error accumulates across layers and activations;
# dense-model predictions are typically O(1) after glorot_uniform
# init, so a 15% relative tolerance catches drift without flaking.
# A fixed seed keeps the test deterministic — without it, some seeds
# push the relative error right to the boundary.
@rel_tol 0.15
@fixed_seed 42

test "quantized 2-layer MLP predicts close to dense (Nx.Defn.Evaluator)" do
model =
Expand All @@ -123,7 +126,9 @@ defmodule Emily.Quantization.TransformTest do
end

defp assert_roundtrip_close(model, input_shape, compiler: compiler) do
{init_fn, predict_fn} = Axon.build(model, compiler: compiler)
# Init with Evaluator + fixed seed for determinism; predict with target compiler.
{init_fn, _} = Axon.build(model, seed: @fixed_seed)
{_, predict_fn} = Axon.build(model, compiler: compiler)

x =
input_shape
Expand All @@ -137,7 +142,7 @@ defmodule Emily.Quantization.TransformTest do
{qmodel, qstate} =
Transform.quantize(model, state, bits: 4, group_size: 64, transpose: true)

{_qinit_fn, qpredict_fn} = Axon.build(qmodel, compiler: compiler)
{_, qpredict_fn} = Axon.build(qmodel, compiler: compiler)
actual = qpredict_fn.(qstate, x)

assert Nx.shape(actual) == Nx.shape(expected)
Expand Down
Loading