mixle.engines.heterogeneous module¶
Precision-aware planning for distributed EM across heterogeneous compute.
Large worker pools are rarely uniform: some workers may have GPU tensor cores,
while others are CPU-only or accuracy-oriented. This module chooses, per
worker, how many E-step rows to assign and which precision band to run. The
selected precision is the fastest supported band that still satisfies the
requested error budget. The plan also sizes the k-way reduction depth so
fixed-size sufficient-statistic payloads fold in O(log W) instead of a
single-root fan-in.
This module is the pure-Python planning layer. Spark, MPI, or other distributed dispatchers consume the returned plan from the inference layer.
- class Worker(name, device, precisions, base_throughput=1.0)[source]
Bases:
objectA compute worker: its device, the precisions it can run (any order), and a base throughput.
- class WorkerAssignment(name, rows, precision, effective_throughput)[source]
Bases:
objectOne worker’s row allocation, precision, and effective throughput.
- class HeterogeneousPlan(assignments, reduce_depth)[source]
Bases:
objectAssignments and reduction depth for heterogeneous execution.
- plan_heterogeneous(workers, n_rows, allowed_precisions=('fp8', 'bfloat16', 'float16', 'float32', 'float64', 'dd'), target_rel_error=None, op_count=1000)[source]
Assign rows + a precision band to each worker, balanced by precision-adjusted throughput.
Each worker runs the fastest precision its hardware supports that stays within
target_rel_error(None= no accuracy constraint); rows are split proportionally to the resulting throughput so all workers finish together.reduce_depthis the k-way tree depth for folding the sufficient-statistic payloads (~ceil(log2(W)/2)), avoiding the single-root fan-in.