pytorch / 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 2,524 units with 29,612 lines of code in units (53.4% of code).
    • 1 very complex units (308 lines of code)
    • 13 complex units (1,391 lines of code)
    • 116 medium complex units (4,798 lines of code)
    • 210 simple units (4,978 lines of code)
    • 2,184 very simple units (18,137 lines of code)
1% | 4% | 16% | 16% | 61%
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
py1% | 4% | 16% | 16% | 61%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
torchbenchmark/models/yolov311% | 20% | 18% | 19% | 29%
torchbenchmark/models/moco0% | 36% | 0% | 22% | 40%
torchbenchmark/models/pytorch_stargan0% | 34% | 7% | 9% | 48%
torchbenchmark/util/framework0% | 18% | 12% | 13% | 55%
torchbenchmark/models/demucs0% | 9% | 24% | 13% | 52%
torchbenchmark/models/dlrm0% | 2% | 23% | 24% | 49%
torchbenchmark/models/nvidia_deeprecommender0% | 0% | 58% | 12% | 29%
torchbenchmark/models/tacotron20% | 0% | 12% | 10% | 76%
torchbenchmark/models/attention_is_all_you_need_pytorch0% | 0% | 20% | 23% | 56%
torchbenchmark/util/torchtext_legacy0% | 0% | 21% | 37% | 40%
torchbenchmark/models/speech_transformer0% | 0% | 21% | 2% | 76%
torchbenchmark/e2e_models/hf_bert0% | 0% | 66% | 9% | 24%
ROOT0% | 0% | 16% | 30% | 53%
torchbenchmark/models/LearningToPaint0% | 0% | 9% | 6% | 84%
torchbenchmark/models/pytorch_CycleGAN_and_pix2pix0% | 0% | 9% | 18% | 72%
torchbenchmark/models/maml0% | 0% | 42% | 29% | 27%
torchbenchmark/models/timm_efficientdet0% | 0% | 33% | 10% | 55%
torchbenchmark/models/Background_Matting0% | 0% | 13% | 11% | 74%
torchbenchmark/util0% | 0% | 12% | 24% | 63%
torchbenchmark/models/Super_SloMo0% | 0% | 15% | 25% | 59%
torchbenchmark/models/tts_angular0% | 0% | 21% | 9% | 69%
components/_impl/workers0% | 0% | 21% | 5% | 73%
torchbenchmark0% | 0% | 19% | 17% | 62%
torchbenchmark/models/vision_maskrcnn0% | 0% | 39% | 7% | 53%
torchbenchmark/models/dcgan0% | 0% | 22% | 0% | 77%
torchbenchmark/models/BERT_pytorch0% | 0% | 5% | 28% | 65%
torchbenchmark/score0% | 0% | 4% | 17% | 77%
components/_impl/tasks0% | 0% | 36% | 59% | 3%
torchbenchmark/models/pytorch_unet0% | 0% | 3% | 30% | 65%
torchbenchmark/models/soft_actor_critic0% | 0% | 0% | 13% | 86%
torchbenchmark/models/fastNLP_Bert0% | 0% | 0% | 27% | 72%
torchbenchmark/models/pyhpc_isoneutral_mixing0% | 0% | 0% | 30% | 69%
torchbenchmark/models/pyhpc_turbulent_kinetic_energy0% | 0% | 0% | 19% | 80%
torchbenchmark/models/drq0% | 0% | 0% | 7% | 92%
scripts0% | 0% | 0% | 4% | 95%
torchbenchmark/microbenchmarks/nvfuser0% | 0% | 0% | 13% | 86%
torchbenchmark/models/resnet50_quantized_qat0% | 0% | 0% | 30% | 69%
torchbenchmark/models/mobilenet_v2_quantized_qat0% | 0% | 0% | 32% | 67%
torchbenchmark/models/pyhpc_equation_of_state0% | 0% | 0% | 0% | 100%
torchbenchmark/models/pytorch_struct0% | 0% | 0% | 0% | 100%
torchbenchmark/util/backends0% | 0% | 0% | 0% | 100%
torchbenchmark/models/maml_omniglot0% | 0% | 0% | 0% | 100%
torchbenchmark/models/detectron2_maskrcnn0% | 0% | 0% | 0% | 100%
torchbenchmark/models/opacus_cifar100% | 0% | 0% | 0% | 100%
torchbenchmark/e2e_models/fambench_xlmr0% | 0% | 0% | 0% | 100%
torchbenchmark/models/squeezenet1_10% | 0% | 0% | 0% | 100%
install_utils0% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_BigBird0% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_Albert0% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_Bart0% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_Bert0% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_T50% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_GPT20% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_DistilBert0% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_Reformer0% | 0% | 0% | 0% | 100%
torchbenchmark/models/hf_Longformer0% | 0% | 0% | 0% | 100%
torchbenchmark/models/timm_regnet0% | 0% | 0% | 0% | 100%
torchbenchmark/models/resnet500% | 0% | 0% | 0% | 100%
torchbenchmark/models/timm_vision_transformer0% | 0% | 0% | 0% | 100%
torchbenchmark/models/timm_nfnet0% | 0% | 0% | 0% | 100%
torchbenchmark/models/mobilenet_v3_large0% | 0% | 0% | 0% | 100%
torchbenchmark/models/timm_efficientnet0% | 0% | 0% | 0% | 100%
torchbenchmark/models/densenet1210% | 0% | 0% | 0% | 100%
torchbenchmark/models/shufflenet_v2_x1_00% | 0% | 0% | 0% | 100%
torchbenchmark/models/resnet180% | 0% | 0% | 0% | 100%
torchbenchmark/models/mnasnet1_00% | 0% | 0% | 0% | 100%
torchbenchmark/models/resnext50_32x4d0% | 0% | 0% | 0% | 100%
torchbenchmark/models/vgg160% | 0% | 0% | 0% | 100%
torchbenchmark/models/mobilenet_v20% | 0% | 0% | 0% | 100%
torchbenchmark/models/alexnet0% | 0% | 0% | 0% | 100%
torchbenchmark/models/timm_vovnet0% | 0% | 0% | 0% | 100%
torchbenchmark/models/timm_resnest0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
308 107 1
153 49 13
106 45 1
135 44 11
101 41 3
132 41 3
121 35 1
54 31 13
161 31 0
114 31 3
120 30 1
102 30 2
39 29 1
53 26 5
56 25 9
58 25 7
40 24 4
101 22 5
38 22 4
52 22 4
40 21 1
37 21 12
40 21 9
75 21 8
65 21 4
86 20 0
36 19 3
53 19 4
66 19 13
76 19 8
47 18 4
38 18 5
71 18 1
50 18 2
44 18 4
40 18 2
40 18 2
32 17 6
67 17 5
37 17 6
30 17 2
43 17 1
42 17 1
63 17 4
20 16 1
42 16 3
22 16 3
57 16 3
57 16 3
58 16 2