Horovod
Unit Size

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,322 units with 13,276 lines of code in units (49.0% of code).
    • 5 very long units (922 lines of code)
    • 23 long units (1,395 lines of code)
    • 130 medium size units (4,129 lines of code)
    • 187 small units (2,781 lines of code)
    • 977 very small units (4,049 lines of code)
6% | 10% | 31% | 20% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
py6% | 10% | 30% | 20% | 32%
cc8% | 12% | 40% | 19% | 18%
h10% | 9% | 25% | 24% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Logical Component
primary logical decomposition
horovod/spark12% | 11% | 25% | 20% | 30%
horovod/common10% | 8% | 28% | 21% | 31%
horovod/runner8% | 6% | 40% | 17% | 28%
examples0% | 22% | 40% | 15% | 22%
horovod/torch0% | 11% | 32% | 25% | 30%
horovod/_keras0% | 25% | 0% | 25% | 49%
horovod/tensorflow0% | 7% | 23% | 25% | 43%
horovod/mxnet0% | 13% | 33% | 40% | 13%
horovod/ray0% | 0% | 40% | 19% | 40%
ROOT0% | 0% | 60% | 0% | 40%
cmake0% | 0% | 32% | 67% | 0%
examples/elastic0% | 0% | 13% | 29% | 56%
horovod/keras0% | 0% | 0% | 21% | 78%
Legend:
101+
51-100
21-50
11-20
1-10
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
def RemoteTrainer()
in horovod/spark/torch/remote.py
258 65 5
def parse_args()
in horovod/runner/launch.py
242 3 0
void BackgroundThreadLoop()
in horovod/common/operations.cc
154 28 1
def RemoteTrainer()
in horovod/spark/keras/remote.py
140 25 5
void FusedAllreduce()
in horovod/common/ops/adasum/adasum.h
128 18 10
def _run_static()
in horovod/runner/launch.py
74 18 1
def _get_or_create_dataset()
in horovod/spark/common/util.py
70 16 11
void PerformOperation()
in horovod/common/operations.cc
67 19 2
def train_gluon()
in examples/mxnet_imagenet_resnet50.py
66 19 0
def broadcast_optimizer_state()
in horovod/torch/functions.py
64 31 2
def create_distributed_optimizer()
in horovod/_keras/__init__.py
64 10 8
def run_elastic()
in horovod/spark/runner.py
63 13 2
def _handle()
in horovod/runner/common/service/task_service.py
62 19 3
def mpi_run()
in horovod/runner/mpi_run.py
62 19 6
def train_module()
in examples/mxnet_imagenet_resnet50.py
62 18 0
def train_fn()
in examples/keras_spark3_rossmann.py
61 1 1
def train_fn()
in examples/keras_spark_rossmann_run.py
60 1 1
def allreduce()
in horovod/tensorflow/__init__.py
59 20 8
def _transform()
in horovod/spark/keras/estimator.py
59 17 2
def run()
in horovod/spark/runner.py
59 14 2
void DoHorovodOperation()
in horovod/mxnet/mpi_ops.cc
58 7 3
Status EnqueueTensorAlltoall()
in horovod/common/operations.cc
57 10 7
Status EnqueueTensorAllreduce()
in horovod/common/operations.cc
56 9 10
void FusedPairwiseReduceWithComm()
in horovod/common/ops/adasum/adasum.h
56 7 10
static void ResizeNd()
in horovod/torch/tensor_util.h
55 1 4
def save_bare_keras_optimizer()
in horovod/spark/keras/bare.py
54 17 2
def get_simple_meta_from_parquet()
in horovod/spark/common/util.py
54 10 5
def get_data_rec()
in examples/mxnet_imagenet_resnet50.py
53 1 6
void DoHorovodOperationCudaOnCPU()
in horovod/mxnet/mpi_ops.cc
50 6 3
def __init__()
in horovod/runner/__init__.py
50 1 1
def run()
in horovod/runner/__init__.py
50 6 2
inline void PushHorovodOperationCudaOnCPU()
in horovod/mxnet/mpi_ops.cc
49 6 10
inline void PushHorovodOperation()
in horovod/mxnet/mpi_ops.cc
48 6 10
def _get_col_info()
in horovod/spark/common/util.py
48 11 1
def _transform()
in horovod/spark/torch/estimator.py
47 13 2
def get_common_interfaces()
in horovod/runner/driver/driver_service.py
45 19 4
def cnn_model_fn()
in examples/tensorflow_mnist_estimator.py
45 12 3
def main()
in examples/tensorflow_mnist.py
45 13 1
def set_args_from_config()
in horovod/runner/common/util/config_parser.py
44 14 3
inline void Float2HalfBits()
in horovod/common/half.h
44 11 2
void parse_and_set_affinity()
in horovod/common/common.cc
44 12 3
virtual Status Execute()
in horovod/common/ops/collective_operations.h
44 5 2
def train()
in examples/tensorflow2_mnist_ray.py
44 8 1
def _probe_one()
in horovod/runner/common/util/network.py
43 9 4
def _batch_generator_fn()
in horovod/spark/keras/util.py
43 21 7
def main()
in examples/tensorflow_mnist_estimator.py
43 13 1
def backward()
in horovod/torch/sync_batch_norm.py
42 9 2
def check_shape_compatibility()
in horovod/spark/common/util.py
42 18 6
def execute_function_multithreaded()
in horovod/runner/util/threads.py
41 13 4
def _driver_fn()
in horovod/runner/driver/driver_service.py
41 15 3