facebookresearch / DLRM-FlexFlow
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 1,462 units with 17,686 lines of code in units (39.5% of code).
    • 3 very complex units (556 lines of code)
    • 12 complex units (1,861 lines of code)
    • 58 medium complex units (3,087 lines of code)
    • 72 simple units (2,122 lines of code)
    • 1,317 very simple units (10,060 lines of code)
3% | 10% | 17% | 11% | 56%
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
cc7% | 9% | 15% | 17% | 50%
py0% | 12% | 19% | 7% | 61%
inc0% | 0% | 100% | 0% | 0%
h0% | 0% | 0% | 24% | 75%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src10% | 10% | 18% | 19% | 42%
python0% | 10% | 17% | 7% | 64%
flexflow0% | 12% | 19% | 7% | 60%
scripts0% | 8% | 6% | 20% | 64%
config0% | 0% | 100% | 0% | 0%
nmt0% | 0% | 11% | 9% | 79%
include0% | 0% | 0% | 18% | 81%
bootcamp_demo0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
67 63 1
cc
float Simulator::simulate_runtime()
in src/runtime/simulator.cc
265 56 4
cc
void FFModel::compile()
in src/runtime/model.cc
224 52 3
def apply()
in python/flexflow/torch/model.py
268 49 3
def torch_to_flexflow_str()
in python/flexflow/torch/fx.py
156 49 1
def apply()
in flexflow/torch/model.py
268 49 3
def torch_to_flexflow_str()
in flexflow/torch/fx.py
156 49 1
293 46 10
cc
void FFConfig::parse_args()
in src/runtime/model.cc
118 38 2
def convert_op_handle_to_op()
in python/flexflow/core/flexflow_cffi.py
68 33 4
def convert_op_handle_to_op()
in flexflow/core/flexflow_cffi.py
68 33 4
cc
void FFMapper::map_task()
in src/mapper/mapper.cc
148 32 4
def update()
in python/flexflow/keras/utils/generic_utils.py
96 31 3
def update()
in flexflow/keras/utils/generic_utils.py
96 31 3
cc
float simulate_time()
in scripts/simulator.cc
126 30 2
def get_file()
in python/flexflow/keras/utils/data_utils.py
71 24 10
def get_file()
in flexflow/keras/utils/data_utils.py
71 24 10
120 24 6
def _train()
in python/flexflow/keras/models/base_model.py
52 23 4
def _train()
in python/flexflow/keras_exp/models/model.py
52 23 4