facebookresearch / param
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 12% duplication:
    • 6,751 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 819 duplicated lines
  • 84 duplicates
system12% (819 lines)
Duplication per Extension
py12% (819 lines)
Duplication per Component (primary)
train/comms/pt8% (354 lines)
train/compute/pt22% (154 lines)
inference/compute/pt47% (110 lines)
train/compute/python/lib/pytorch14% (104 lines)
train/compute/python/lib13% (71 lines)
train/compute/python/pytorch6% (12 lines)
train/compute/python/tools14% (8 lines)
train/compute/python/workloads/pytorch1% (6 lines)
train/compute/python0% (0 lines)
train/compute/python/workloads0% (0 lines)

Duplication Between Components (50+ lines)

G inference/compute/pt inference/compute/pt train/compute/pt train/compute/pt inference/compute/pt--train/compute/pt 184

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 84 duplicates...
Size#FoldersFilesLinesCode
18 x 2 inference/compute/pt
train/compute/pt
pytorch_linear.py
pytorch_linear.py
13:31 (7%)
13:31 (7%)
view
17 x 2 train/compute/python/lib/pytorch
train/compute/python/lib/pytorch
operator_impl.py
operator_impl.py
57:76 (23%)
99:118 (23%)
view
15 x 2 train/compute/python/lib/pytorch
train/compute/python/lib/pytorch
build_executor.py
build_executor.py
146:166 (5%)
326:347 (5%)
view
15 x 2 inference/compute/pt
train/compute/pt
pytorch_linear.py
pytorch_linear.py
265:285 (6%)
264:284 (6%)
view
12 x 2 inference/compute/pt
train/compute/pt
pytorch_linear.py
pytorch_linear.py
239:252 (5%)
237:250 (5%)
view
11 x 2 train/comms/pt
train/comms/pt
comms.py
comms.py
446:456 (1%)
482:492 (1%)
view
11 x 2 train/comms/pt
train/comms/pt
dlrm_data.py
dlrm_data.py
129:139 (5%)
246:256 (5%)
view
11 x 2 train/comms/pt
train/comms/pt
commsTraceReplay.py
commsTraceReplay.py
198:208 (2%)
215:225 (2%)
view
10 x 2 train/compute/python/lib
train/compute/python/lib
iterator.py
iterator.py
134:143 (4%)
146:155 (4%)
view
10 x 2 train/comms/pt
train/comms/pt
comms.py
comms.py
376:385 (<1%)
408:417 (<1%)
view
10 x 2 train/comms/pt
train/comms/pt
comms.py
commsTraceReplay.py
584:593 (<1%)
621:630 (1%)
view
9 x 2 train/compute/pt
train/compute/pt
pytorch_linear.py
pytorch_linear.py
150:158 (3%)
162:170 (3%)
view
9 x 2 train/comms/pt
train/comms/pt
comms.py
comms.py
384:392 (<1%)
419:427 (<1%)
view
9 x 2 train/compute/pt
train/compute/pt
pytorch_cutlass.py
pytorch_gemm.py
41:52 (11%)
60:71 (9%)
view
9 x 2 train/compute/pt
train/compute/pt
pytorch_linear.py
pytorch_linear.py
138:146 (3%)
162:170 (3%)
view
9 x 2 train/compute/pt
train/compute/pt
pytorch_linear.py
pytorch_linear.py
138:146 (3%)
150:158 (3%)
view
9 x 2 train/comms/pt
train/comms/pt
comms.py
comms.py
901:909 (<1%)
922:930 (<1%)
view
8 x 2 train/comms/pt
train/comms/pt
comms.py
comms.py
762:769 (<1%)
776:783 (<1%)
view
8 x 2 inference/compute/pt
inference/compute/pt
pytorch_linear.py
pytorch_linear.py
160:167 (3%)
182:189 (3%)
view
8 x 2 inference/compute/pt
inference/compute/pt
pytorch_linear.py
pytorch_linear.py
171:178 (3%)
182:189 (3%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
8 x 2 train/compute/pt
inference/compute/pt
pytorch_linear.py
pytorch_linear.py
0:0 
0:0 
view
7 x 2 train/compute/pt
inference/compute/pt
pytorch_linear.py
pytorch_linear.py
0:0 
0:0 
view
6 x 2 train/comms/pt
train/comms/pt
comms.py
comms.py
0:0 
0:0 
view