awslabs / deeplearning-benchmark
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

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 616 units with 9,355 lines of code in units (78.4% of code).
    • 2 very complex units (327 lines of code)
    • 3 complex units (365 lines of code)
    • 25 medium complex units (1,139 lines of code)
    • 75 simple units (2,328 lines of code)
    • 511 very simple units (5,196 lines of code)
3% | 3% | 12% | 24% | 55%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py3% | 4% | 13% | 25% | 53%
scala0% | 0% | 0% | 22% | 77%
java0% | 0% | 0% | 26% | 73%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_benchmark11% | 0% | 13% | 18% | 56%
tensorflow0% | 10% | 5% | 40% | 44%
image_classification0% | 6% | 13% | 19% | 59%
benchmark0% | 0% | 62% | 0% | 37%
word_language_model0% | 0% | 33% | 16% | 49%
djl0% | 0% | 54% | 14% | 30%
utils0% | 0% | 21% | 34% | 43%
reporting0% | 0% | 15% | 16% | 67%
scala-mxnet0% | 0% | 0% | 15% | 84%
end_to_end_model_benchmark0% | 0% | 0% | 37% | 62%
dawnbench0% | 0% | 0% | 45% | 54%
onnx_benchmark0% | 0% | 0% | 100% | 0%
ssd0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
dependency_update0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __init__()
in tensorflow_benchmark/tf_cnn_benchmarks/benchmark_cnn.py
162 62 2
def _benchmark_cnn()
in tensorflow_benchmark/tf_cnn_benchmarks/benchmark_cnn.py
165 53 1
def fit()
in image_classification/common/fit.py
126 40 4
def train()
in tensorflow/inception/inception/inception_distributed_train.py
145 39 3
def train()
in tensorflow/inception/inception/inception_train.py
94 27 1
def get_model_config()
in tensorflow_benchmark/tf_cnn_benchmarks/models/model_config.py
33 18 2
def generate_cfg()
in utils/cfg_process.py
26 17 3
def main()
in benchmark/tensorflow/generate_runner.py
28 17 1
def conv()
in tensorflow_benchmark/tf_cnn_benchmarks/convnet_builder.py
83 17 13
def get_symbol()
in image_classification/symbols/resnet-v1.py
48 16 6
def main()
in benchmark/plotgraph.py
47 15 1
def get_cifar10_model_config()
in tensorflow_benchmark/tf_cnn_benchmarks/models/model_config.py
22 15 1
def get_symbol()
in image_classification/symbols/resnet.py
48 15 6
def get_symbol()
in image_classification/symbols/resnext.py
49 15 7
def getImagenetData()
in utils/data_manager.py
25 14 1
def fetch_metrics_()
in reporting/utils/benchmarks.py
32 13 1
def train()
in word_language_model/word_language_model.py
51 13 2
def train()
in word_language_model/word_language_model_train.py
53 13 2
def inception_module()
in tensorflow_benchmark/tf_cnn_benchmarks/convnet_builder.py
37 13 5
def _get_lr_scheduler()
in image_classification/common/fit.py
27 13 2