Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d459910
Benchmarks: run mlx, and compare two backends in one A/B
jtravs Nov 5, 2026
79fa910
Size a single-precision run's grid for MLX's transforms
jtravs Nov 5, 2026
7d3fda8
mlx: compile each stage, and form a propagator pair in one kernel
jtravs Nov 5, 2026
4eb92e5
mlx: score the quadrature alarm on the device
jtravs Nov 5, 2026
ec70787
mlx: widen the doubling scan's threadgroups
jtravs Nov 5, 2026
9fdb451
mlx: start each compiled stage as soon as it is built
jtravs Nov 5, 2026
4b667f9
mlx: an exponential Adams history on the device (MlxAdams)
jtravs Nov 5, 2026
01002ff
mlx: form an Adams trial's moments and compensation on the device
jtravs Nov 5, 2026
3e0cc82
mlx: one pass over the terms for an Adams trial's flow, moments and f…
jtravs Nov 5, 2026
ef65841
mlx: an Adams trial's formulas in one kernel each
jtravs Nov 5, 2026
a4b585d
Admit the Adams integrator under single precision
jtravs Nov 5, 2026
a045b1a
Design doc: the mlx Adams engine
jtravs Nov 5, 2026
6410c0c
Tests: mlx Adams against the oracle, its trial kernel, its refusal
jtravs Nov 5, 2026
5ccdc90
mlx: the field-grid plasma statistics on the device
jtravs Nov 5, 2026
10ef488
Ledger: mlx against native on an Apple M5 Max
jtravs Nov 5, 2026
52450e1
Single precision takes free space's binary64 tolerance, 1e-4
jtravs Nov 5, 2026
20fd30a
Tests: type the grid case's precisions, and the poisoned source's values
jtravs Nov 5, 2026
0a544df
Ledger: the final mlx A/B
jtravs Nov 5, 2026
86da72f
mlx: keep the fused switch private, list population_parameters
jtravs Nov 6, 2026
0fdcefa
Single precision takes each route's own default integrator
jtravs Nov 6, 2026
0c748fa
mlx: reuse an accepted DOPRI5 step's last stage as the next first
jtravs Nov 6, 2026
d3d7013
Ledger: the Kerr beam's refusal is the operator's damping, not the te…
jtravs Nov 6, 2026
584bb21
Single precision: forward-only marches past the damping limit; mlx ed…
jtravs Nov 6, 2026
935617b
mlx: combine a DOPRI5 trial past binary32's range in the lab frame
jtravs Nov 6, 2026
293901e
Fix CI: native helpers optional on mlx, recipe transforms, figure, bu…
jtravs Nov 6, 2026
3a5ecae
Merge remote-tracking branch 'origin/main' into claude/mlx-backend-pe…
jtravs Nov 6, 2026
0c4d07e
Tests: skip the mlx resume cases off macOS by the reason check_skips …
jtravs Nov 6, 2026
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
2 changes: 2 additions & 0 deletions benchmarks/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def main(argv: list[str] | None = None) -> int:
args.threads,
args.production or physical_cores(),
backend=args.backend,
noise=args.noise,
fft_size=args.fft_size,
)
show_plan(rows, skipped, args.repeats)
return 0
Expand Down
41 changes: 37 additions & 4 deletions benchmarks/ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
receipt,
)
from benchmarks.system import eligible_cpus, guard, physical_cores, thread_environment
from benchmarks.track import selection_options, steppers
from benchmarks.track import BACKENDS, selection_options, steppers

__all__ = [
"ARMS",
"ab",
"ab_options",
"arm_configuration",
"arm_order",
"field_difference",
"show_summary",
Expand Down Expand Up @@ -66,6 +67,25 @@ def ab_options(parser: argparse.ArgumentParser) -> None:
"--timeout", type=float, default=3600.0, help="per-worker limit, seconds"
)
parser.add_argument("--json", action="store_true")
parser.add_argument(
"--baseline-backend",
choices=BACKENDS,
help="the baseline arm's backend; default: --backend",
)
parser.add_argument(
"--candidate-backend",
choices=BACKENDS,
help="the candidate arm's backend; default: --backend",
)


def arm_configuration(configuration: Record, backend: str) -> Record:
"""Return one arm's configuration: its backend and that backend's precision."""
return {
**configuration,
"backend": backend,
"precision": "single" if backend == "mlx" else "double",
}


def arm_order(round_index: int) -> tuple[str, ...]:
Expand Down Expand Up @@ -184,14 +204,21 @@ def ab(args: argparse.Namespace) -> int:
if args.rounds < 1 or args.repeats < 1 or args.timeout <= 0:
raise SuiteError("rounds, repeats and timeout must be positive")
started = time.perf_counter()
backends = {
"baseline": args.baseline_backend or args.backend,
"candidate": args.candidate_backend or args.backend,
}
rows, skipped = plan_rows(
select(tuple(args.case), tuple(args.set), all_cases=args.all),
steppers(args.stepper),
args.threads,
args.production or physical_cores(),
backend=args.backend,
# A configuration either arm cannot run is left out for both.
backend="mlx" if "mlx" in backends.values() else args.backend,
fraction=args.length,
device=args.device,
noise=args.noise,
fft_size=args.fft_size,
)
for reason in skipped:
print(f"skipped {reason}")
Expand All @@ -211,6 +238,7 @@ def ab(args: argparse.Namespace) -> int:
"created": now(),
"purpose": "exploratory A/B",
"pythons": pythons,
"backends": backends,
"rounds": args.rounds,
"repeats": args.repeats,
"length": args.length,
Expand All @@ -236,7 +264,9 @@ def ab(args: argparse.Namespace) -> int:
events, elapsed = launch_worker(
pythons[arm],
{
"configuration": row["configuration"],
"configuration": arm_configuration(
row["configuration"], backends[arm]
),
"repeats": args.repeats,
"fields": str(
(output / "fields" / arm / f"{row['id']}.npy").resolve()
Expand Down Expand Up @@ -282,7 +312,10 @@ def ab(args: argparse.Namespace) -> int:
print(canonical(summary))
else:
show_summary(summary)
same = pythons["baseline"] == pythons["candidate"]
same = (
pythons["baseline"] == pythons["candidate"]
and backends["baseline"] == backends["candidate"]
)
print(
("A/A control: the same interpreter for both arms. " if same else "")
+ (f"Results: {output.resolve()} ({time.perf_counter() - started:.0f} s)")
Expand Down
Loading
Loading