TensorTonic
Study Plans
Study Plan
Calculate Collective Effective Bandwidth
Distributed Computing
Easy

Calculate effective communication bandwidth under the supplied ring-equivalent model. Let SSS be payload_bytes, RRR be world_size, and ttt be duration_seconds. The pass count ccc is two for all_reduce and one for all_gather, reduce_scatter, or all_to_all. The modeled bytes per rank AAA and bandwidth BBB are:

A=cSR−1R.A=cS\frac{R-1}{R}.A=cSRR−1​. B=At.B=\frac{A}{t}.B=tA​.

A single rank requires no communication. Return a Python dictionary with algorithm_bytes and bandwidth_bytes_per_second, both finite Python floats.

Loading visualization...

Examples

Input: payload_bytes = 1024, world_size = 4, duration_seconds = 0.001, collective = "all_reduce"

Output: {"algorithm_bytes":1536,"bandwidth_bytes_per_second":1536000}

Explanation: Two ring passes move three quarters of the payload each, and dividing 1536 bytes by 0.001 seconds gives the bandwidth.

Input: payload_bytes = 1200, world_size = 3, duration_seconds = 0.002, collective = "all_gather"

Output: {"algorithm_bytes":800,"bandwidth_bytes_per_second":400000}

Input: payload_bytes = 2048, world_size = 2, duration_seconds = 0.004, collective = "reduce_scatter"

Output: {"algorithm_bytes":1024,"bandwidth_bytes_per_second":256000}

Hint 1

Python / performs floating-point division.

Hint 2

float converts a numeric value to a Python float.

Requirements

  • Use the stated ring-equivalent model with bytes and seconds as the units.
  • Return both modeled communication volume and bandwidth as Python floats.

Constraints

  • payload_bytes is a nonnegative Python integer.
  • world_size is a positive Python integer.
  • duration_seconds is a positive finite Python number.
  • collective is all_reduce, all_gather, reduce_scatter, or all_to_all.
  • Calculations use bytes and seconds without unit conversion.
Try Similar Problems
Synchronize Data-Parallel GradientsMediumSimulate Distributed CollectivesMediumReconstruct a Column-Parallel MLP LayerMediumAccount for ZeRO Memory by StageEasyMeasure Pipeline Bubble UtilizationMediumChoose a Topology-Aware Parallel PlanHardShared-Memory Bank Conflict AnalyzerEasyOrthogonalize a Muon Momentum UpdateEasyEstimate Model Memory and Minimum GPU CountEasyCalculate Tensor Parallel Communication CostHardSimulate Disaggregated Prefill and Decode ServingHardImplement Expert Parallel Routing Across GPUsHard

Accepts: number

Accepts: number

Accepts: number

Accepts: string

You must run your code first.

Calculate Collective Effective Bandwidth

Distributed Computing
Easy

Calculate effective communication bandwidth under the supplied ring-equivalent model. Let SSS be payload_bytes, RRR be world_size, and ttt be duration_seconds. The pass count ccc is two for all_reduce and one for all_gather, reduce_scatter, or all_to_all. The modeled bytes per rank AAA and bandwidth BBB are:

A=cSR−1R.A=cS\frac{R-1}{R}.A=cSRR−1​. B=At.B=\frac{A}{t}.B=tA​.

A single rank requires no communication. Return a Python dictionary with algorithm_bytes and bandwidth_bytes_per_second, both finite Python floats.

Loading visualization...

Examples

Input: payload_bytes = 1024, world_size = 4, duration_seconds = 0.001, collective = "all_reduce"

Output: {"algorithm_bytes":1536,"bandwidth_bytes_per_second":1536000}

Explanation: Two ring passes move three quarters of the payload each, and dividing 1536 bytes by 0.001 seconds gives the bandwidth.

Input: payload_bytes = 1200, world_size = 3, duration_seconds = 0.002, collective = "all_gather"

Output: {"algorithm_bytes":800,"bandwidth_bytes_per_second":400000}

Input: payload_bytes = 2048, world_size = 2, duration_seconds = 0.004, collective = "reduce_scatter"

Output: {"algorithm_bytes":1024,"bandwidth_bytes_per_second":256000}

Hint 1

Python / performs floating-point division.

Hint 2

float converts a numeric value to a Python float.

Requirements

  • Use the stated ring-equivalent model with bytes and seconds as the units.
  • Return both modeled communication volume and bandwidth as Python floats.

Constraints

  • payload_bytes is a nonnegative Python integer.
  • world_size is a positive Python integer.
  • duration_seconds is a positive finite Python number.
  • collective is all_reduce, all_gather, reduce_scatter, or all_to_all.
  • Calculations use bytes and seconds without unit conversion.
Try Similar Problems
Synchronize Data-Parallel GradientsMediumSimulate Distributed CollectivesMediumReconstruct a Column-Parallel MLP LayerMediumAccount for ZeRO Memory by StageEasyMeasure Pipeline Bubble UtilizationMediumChoose a Topology-Aware Parallel PlanHardShared-Memory Bank Conflict AnalyzerEasyOrthogonalize a Muon Momentum UpdateEasyEstimate Model Memory and Minimum GPU CountEasyCalculate Tensor Parallel Communication CostHardSimulate Disaggregated Prefill and Decode ServingHardImplement Expert Parallel Routing Across GPUsHard

Accepts: number

Accepts: number

Accepts: number

Accepts: string

You must run your code first.