Expand description
Orchestrator for the Phase 6b probe → judge → dispatch pipeline.
Wraps the three pieces so callers get a ready-to-query
DispatchTable from one call. Does the right thing re: reuse
across restarts: if the persisted probe matches the current
hardware and a persisted profile is present, the Judge is
skipped entirely.
§One-call API
use fuel_tensor::scheduling::{prepare_dispatch_table, ScheduleOptions};
let (table, _report) = prepare_dispatch_table(ScheduleOptions::default())
.expect("prepare_dispatch_table");
// `table` is now queryable with `.pick(op, dtype, size, criterion)`.§Reuse rules
- Probe the current hardware.
- If a persisted
ProbeReportexists andprobe.diff(&prior)isHardwareChange::Unchanged, look for a persistedProfileReport. - If a persisted profile is present and its schema version matches, skip the Judge and build the dispatch table from the persisted profile. Save cost on every startup.
- Otherwise re-run the Judge and persist both reports.
§Where the reports live
By default, both reports live under the OS cache dir
(%LOCALAPPDATA%\fuel\ on Windows, $XDG_CACHE_HOME/fuel/ on
Linux). Callers that want explicit paths (for CI, containers,
per-user config) can override via ScheduleOptions.
Structs§
- Schedule
Options - Options for
prepare_dispatch_tableand the Phase 6cprepare_dp_inputs/auto_place_and_route_with_transfer_cost— lets callers override paths, force re-measurement, and tune dispatch-table construction.
Functions§
- apply_
placement_ plan - Apply a placement plan to a
Graph— set per-node placement hints for every entry that doesn’t already have one. Skipping pre-set hints is the safe default: a user who explicitly pinned a node to a device shouldn’t have that overridden by the dispatch table’s recommendation. Useforce_apply_placement_planwhen the override is intentional. - auto_
place_ and_ route - One-call Phase 6b auto-router: runs
recommend_placement, applies the resulting hints (skip-existing semantics), and runsfuel_graph::opt::insert_copiesto materialise the cross- device transfers. Returns the new root IDs frominsert_copies(which may have been remapped if any ofroots’s ops were rewritten as part of inserting Copy nodes). - auto_
place_ and_ route_ with_ transfer_ cost - One-call Phase 6c auto-router: probe → load-or-judge → load-or-
measure-bandwidth → DP-plan → apply hints → insert_copies. Returns
the new root IDs after
Op::Copyinsertion. - dp_plan
- Phase 6c DP-based placement planner. Produces a per-node placement that minimises total cost = compute + transfer, via forward dynamic programming over the topo-sorted graph.
- force_
apply_ placement_ plan - Like
apply_placement_planbut overwrites existing hints. Useful when a re-Judge produces fresher recommendations or when a user wants to dispatch-route a graph that’s been hand-pinned in an earlier pass. - prepare_
dispatch_ table - Probe → [load / re-Judge] → build dispatch. Persists both reports on a fresh Judge run. Returns the dispatch table paired with the profile report it was built from (callers often want the raw measurements too — for logging, debugging, or a custom secondary dispatch table).
- prepare_
dp_ inputs - Probe → load-or-judge → load-or-measure-bandwidth, returning all
three Phase 6c inputs in one call. Reuses persisted reports when
the current probe matches the prior one (same hardware-change
rule the Judge uses); re-measures any piece marked
force_*in the options or that’s missing a persisted file. - recommend_
for_ node - Single-node recommendation. Public so callers that already have a node in hand (e.g. during a custom graph rewrite pass) can ask the dispatch table directly without building the full plan.
- recommend_
placement - Walk every node in
graphand produce a recommendedDeviceLocationper node. Ops the Judge profiled produce a dispatch-table-driven recommendation; ops it didn’t profile fall back tofallback_device(typically the router’s default).