Implement a 1F1B pipeline-schedule simulator reporting the bubble fraction for given (stag

Infrastructure, Distributed Training & Scaling3 / 4

Chapter 233 / 4

Infrastructure, Distributed Training & Scaling

Implement a 1F1B pipeline-schedule simulator reporting the bubble fraction for given (stag

Hard

Implement a 1F1B pipeline-schedule simulator reporting the bubble fraction for given (stages, micro-batches).

Target interface
simulate_1f1b(p, m, f_cost=1, b_cost=1)

Implement the function/class skeleton in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.