facebookresearch / param
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 405 units with 5,633 lines of code in units (80.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 18 medium complex units (1,078 lines of code)
    • 52 simple units (1,914 lines of code)
    • 335 very simple units (2,641 lines of code)
0% | 0% | 19% | 33% | 46%
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
py0% | 0% | 19% | 33% | 46%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
train/comms/pt0% | 0% | 19% | 35% | 44%
train/compute/python/lib0% | 0% | 27% | 16% | 55%
train/compute/python/pytorch0% | 0% | 71% | 28% | 0%
train/compute/python/workloads/pytorch0% | 0% | 43% | 16% | 39%
train/compute/pt0% | 0% | 0% | 52% | 47%
train/compute/python/lib/pytorch0% | 0% | 0% | 40% | 59%
train/compute/python/tools0% | 0% | 0% | 59% | 40%
inference/compute/pt0% | 0% | 0% | 0% | 100%
train/compute/python0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def prepComm()
in train/comms/pt/comms_utils.py
101 25 3
def runColl()
in train/comms/pt/comms.py
78 24 4
def create_range_iter()
in train/compute/python/lib/iterator.py
97 23 2
def benchTime()
in train/comms/pt/commsTraceReplay.py
59 22 2
def dcheck()
in train/comms/pt/comms_utils.py
33 22 4
def prepComms()
in train/comms/pt/commsTraceReplay.py
45 19 3
def reportBenchTime()
in train/comms/pt/dlrm.py
84 18 6
def benchTime()
in train/comms/pt/comms.py
123 17 4
def get_data()
in train/compute/python/workloads/pytorch/split_table_batched_embeddings_ops.py
78 17 3
def checkArgs()
in train/comms/pt/comms_utils.py
54 16 2
def checkPt2PtRanks()
in train/comms/pt/comms.py
36 14 1
def parseRankList()
in train/comms/pt/comms_utils.py
18 13 3
def checkArgs()
in train/comms/pt/comms.py
40 12 2
def all_reduce()
in train/comms/pt/pytorch_dist_backend.py
37 12 4
def all_to_allv()
in train/comms/pt/pytorch_dist_backend.py
28 12 4
def _generate()
in train/compute/python/lib/iterator.py
27 12 1
def __getitem__()
in train/comms/pt/dlrm_data.py
20 11 2
def main()
in train/compute/python/pytorch/run_benchmark.py
120 11 0
def checkCollectiveRanks()
in train/comms/pt/comms.py
15 10 1
def initCollectiveArgs()
in train/comms/pt/comms.py
111 10 2