Horovod
Conditional Complexity

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 1,322 units with 13,276 lines of code in units (49.0% of code).
    • 1 very complex units (258 lines of code)
    • 2 complex units (218 lines of code)
    • 52 medium complex units (2,368 lines of code)
    • 100 simple units (2,473 lines of code)
    • 1,167 very simple units (7,959 lines of code)
1% | 1% | 17% | 18% | 59%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
py2% | <1% | 20% | 17% | 59%
cc0% | 8% | 6% | 27% | 57%
h0% | 0% | 16% | 13% | 70%
Legend:
51+
26-50
11-25
6-10
1-5
Conditional Complexity per Logical Component
primary logical decomposition
horovod/spark7% | 0% | 27% | 15% | 48%
horovod/common0% | 5% | 11% | 17% | 65%
horovod/torch0% | 6% | 11% | 9% | 72%
horovod/runner0% | 0% | 22% | 20% | 57%
examples0% | 0% | 22% | 15% | 62%
horovod/tensorflow0% | 0% | 11% | 10% | 78%
horovod/mxnet0% | 0% | 0% | 53% | 46%
horovod/_keras0% | 0% | 0% | 41% | 58%
horovod/ray0% | 0% | 0% | 29% | 70%
cmake0% | 0% | 0% | 84% | 15%
ROOT0% | 0% | 0% | 60% | 40%
examples/elastic0% | 0% | 0% | 13% | 86%
horovod/keras0% | 0% | 0% | 0% | 100%
Legend:
51+
26-50
11-25
6-10
1-5
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
def RemoteTrainer()
in horovod/spark/torch/remote.py
258 65 5
def broadcast_optimizer_state()
in horovod/torch/functions.py
64 31 2
void BackgroundThreadLoop()
in horovod/common/operations.cc
154 28 1
def RemoteTrainer()
in horovod/spark/keras/remote.py
140 25 5
def _task_fn()
in horovod/spark/runner.py
38 22 6
def _batch_generator_fn()
in horovod/spark/keras/util.py
43 21 7
def allreduce()
in horovod/tensorflow/__init__.py
59 20 8
def get_common_interfaces()
in horovod/runner/driver/driver_service.py
45 19 4
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
void PerformOperation()
in horovod/common/operations.cc
67 19 2
def train_gluon()
in examples/mxnet_imagenet_resnet50.py
66 19 0
def _run_static()
in horovod/runner/launch.py
74 18 1
void FusedAllreduce()
in horovod/common/ops/adasum/adasum.h
128 18 10
def check_shape_compatibility()
in horovod/spark/common/util.py
42 18 6
def train_module()
in examples/mxnet_imagenet_resnet50.py
62 18 0
def __init__()
in horovod/torch/optimizer.py
41 17 7
def _transform()
in horovod/spark/keras/estimator.py
59 17 2
def save_bare_keras_optimizer()
in horovod/spark/keras/bare.py
54 17 2
def execute()
in horovod/runner/common/util/safe_shell_exec.py
39 16 6
def __init__()
in horovod/torch/optimizer.py
41 16 5
def _get_or_create_dataset()
in horovod/spark/common/util.py
70 16 11
def _driver_fn()
in horovod/runner/driver/driver_service.py
41 15 3
bool Verify()
in horovod/common/wire/message_generated.h
17 15 1
def set_args_from_config()
in horovod/runner/common/util/config_parser.py
44 14 3
def _run()
in horovod/runner/launch.py
16 14 1
def js_run()
in horovod/runner/js_run.py
40 14 6
def _allreduce_async()
in horovod/torch/mpi_ops.py
38 14 6
def _get_keras_utils()
in horovod/spark/keras/estimator.py
35 14 1
def run()
in horovod/spark/runner.py
59 14 2
def execute_function_multithreaded()
in horovod/runner/util/threads.py
41 13 4
def _on_workers_recorded()
in horovod/runner/elastic/registration.py
28 13 1
def terminate_executor_shell_and_children()
in horovod/runner/common/util/safe_shell_exec.py
36 13 1
def run_controller()
in horovod/runner/launch.py
32 13 7
bool Verify()
in horovod/common/wire/message_generated.h
15 13 1
def run_elastic()
in horovod/spark/runner.py
63 13 2
def _handle()
in horovod/spark/driver/driver_service.py
29 13 3
def _transform()
in horovod/spark/torch/estimator.py
47 13 2
def main()
in examples/tensorflow_mnist_estimator.py
43 13 1
def main()
in examples/tensorflow_mnist.py
45 13 1
void parse_and_set_affinity()
in horovod/common/common.cc
44 12 3
def data_type_to_numpy()
in horovod/spark/common/util.py
21 12 1
def _get_metadata()
in horovod/spark/common/util.py
24 12 1
def prepare_data()
in horovod/spark/common/util.py
27 12 10
def cnn_model_fn()
in examples/tensorflow_mnist_estimator.py
45 12 3
def forward_stream()
in horovod/runner/common/util/safe_shell_exec.py
31 11 4
def _handle()
in horovod/runner/common/service/driver_service.py
33 11 3
def generate_jsrun_rankfile()
in horovod/runner/js_run.py
37 11 2
inline void Float2HalfBits()
in horovod/common/half.h
44 11 2
def DistributedOptimizer()
in horovod/tensorflow/__init__.py
31 11 10