mixle.inference.mpi_executor module¶
MPI distributed EM transport: comm.reduce (a real tree fold) over the verified combine-tree.
The MPI fabric over the same sharded-E-step + tree-reduce algorithm: each rank scores its shard to a
fixed-size (count, sufficient-stat) payload, and comm.reduce(payload, op=combine, root=0) folds
them – mpi4py’s lowercase object-mode reduce performs a genuine reduction tree (O(log W)), not a
gather-to-root. The combine operates on freshly-deserialized payloads (MPI ships them between ranks), so
the in-place combine() is safe. combine is associative + commutative, as MPI reduce requires.
Run under mpirun -n W python your_script.py; each rank slices its contiguous portion of the data.
- mpi_em_step(comm, estimator, model, data)[source]
One EM step across MPI ranks: each scores its shard,
comm.reducefolds, rank 0 estimates.Returns the new model on rank 0 and
Noneon the others (usempi_fit()for the broadcast loop).