facebookresearch / fairscale
File Size

The distribution of size of files (measured in lines of code).

Intro
  • File size measurements show the distribution of size of files.
  • Files are classified in four categories based on their size (lines of code): 1-100 (very small files), 101-200 (small files), 201-500 (medium size files), 501-1000 (long files), 1001+(very long files).
  • It is a good practice to keep files small. Long files may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
File Size Overall
  • There are 192 files with 18,003 lines of code.
    • 2 very long files (3,116 lines of code)
    • 2 long files (1,355 lines of code)
    • 17 medium size files (5,205 lines of codeclsfd_ftr_w_mp_ins)
    • 34 small files (4,788 lines of code)
    • 137 very small files (3,539 lines of code)
17% | 7% | 28% | 26% | 19%
Legend:
1001+
501-1000
201-500
101-200
1-100


explore: zoomable circles | sunburst | 3D view
File Size per Extension
1001+
501-1000
201-500
101-200
1-100
pyi51% | 0% | 0% | 12% | 36%
py9% | 9% | 35% | 30% | 15%
cu0% | 0% | 100% | 0% | 0%
cuh0% | 0% | 0% | 100% | 0%
cfg0% | 0% | 0% | 0% | 100%
toml0% | 0% | 0% | 0% | 100%
yml0% | 0% | 0% | 0% | 100%
cpp0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
in0% | 0% | 0% | 0% | 100%
File Size per Logical Decomposition
primary
1001+
501-1000
201-500
101-200
1-100
stubs/torch51% | 0% | 0% | 12% | 36%
fairscale/nn21% | 0% | 25% | 33% | 19%
fairscale/experimental0% | 19% | 35% | 35% | 8%
benchmarks/experimental0% | 54% | 29% | 9% | 6%
fairscale/optim0% | 0% | 69% | 29% | 1%
fairscale/utils0% | 0% | 58% | 12% | 29%
benchmarks0% | 0% | 68% | 17% | 13%
fairscale/clib0% | 0% | 67% | 30% | 2%
benchmarks/models0% | 0% | 0% | 99% | <1%
benchmarks/golden_configs0% | 0% | 0% | 91% | 8%
ROOT0% | 0% | 0% | 0% | 100%
benchmarks/datasets0% | 0% | 0% | 0% | 100%
fairscale0% | 0% | 0% | 0% | 100%
Longest Files (Top 50)
File# lines# units
pyi
__init__.pyi
in stubs/torch
1856 1232
fully_sharded_data_parallel.py
in fairscale/nn/data_parallel
1260 74
distributed.py
in fairscale/experimental/nn/data_parallel/gossip
758 47
experimental_async_approaches.py
in benchmarks/experimental
597 48
testing.py
in fairscale/utils
495 35
layer_memory_tracker.py
in fairscale/experimental/tooling
465 49
async_schedule.py
in fairscale/nn/pipe
364 24
sharded_ddp.py
in fairscale/nn/data_parallel
352 20
oss.py
in fairscale/optim
339 19
offload.py
in benchmarks/experimental
328 20
mevo.py
in fairscale/experimental/nn
317 24
ampnet.py
in fairscale/experimental/nn/ampnet_pipe
303 13
flatten_params_wrapper.py
in fairscale/nn/misc
303 29
offload.py
in fairscale/experimental/nn
281 18
oss.py
in benchmarks
254 6
grad_scaler.py
in fairscale/optim
247 12
cu
fused_adam_cuda_kernel.cu
in fairscale/clib/fused_adam_cuda
246 -
pipe.py
in benchmarks
235 13
adascale.py
in fairscale/optim
226 23
async_pipe.py
in fairscale/nn/pipe
225 15
layers.py
in fairscale/nn/model_parallel
225 11
rpc.py
in fairscale/nn/pipe
200 18
graph_manager.py
in fairscale/experimental/nn/data_parallel/gossip
197 45
ssd_offload.py
in fairscale/experimental/nn
197 24
adam.py
in fairscale/optim
192 10
pipe.py
in fairscale/nn/pipe
182 13
gossiper.py
in fairscale/experimental/nn/data_parallel/gossip
181 13
skippable.py
in fairscale/nn/pipe/skip
179 13
partition_handler.py
in fairscale/experimental/nn/distributed_pipeline
178 15
pyi
functional.pyi
in stubs/torch/nn
177 80
checkpoint_activations.py
in fairscale/nn/checkpoint
167 14
checkpoint.py
in fairscale/nn/pipe
165 16
pyi
pooling.pyi
in stubs/torch/nn/modules
147 50
param_bucket.py
in fairscale/nn/misc
145 19
layerwise_gradient_scaler.py
in fairscale/optim
145 13
pipeline.py
in fairscale/nn/pipe
143 11
fsdp_optim_utils.py
in fairscale/nn/data_parallel
137 6
sync_batchnorm.py
in fairscale/experimental/nn
133 8
dynamic_loss_scaler.py
in fairscale/experimental/optim
124 11
utils.py
in benchmarks
124 10
auto_shard.py
in fairscale/experimental/nn
121 7
portal.py
in fairscale/nn/pipe/skip
119 16
pyi
activation.pyi
in stubs/torch/nn/modules
117 62
pipeline.py
in fairscale/experimental/nn/distributed_pipeline
117 8
messages.py
in fairscale/nn/pipe
115 16
transformer_lm.py
in benchmarks/models
115 15
graph.py
in fairscale/experimental/nn/distributed_pipeline
114 13
random.py
in fairscale/nn/model_parallel
114 12
cuh
multi_tensor_apply.cuh
in fairscale/clib/fused_adam_cuda
111 -
auto_wrap.py
in fairscale/nn/wrap
108 11
Files With Most Units (Top 20)
File# lines# units
pyi
__init__.pyi
in stubs/torch
1856 1232
pyi
functional.pyi
in stubs/torch/nn
177 80
fully_sharded_data_parallel.py
in fairscale/nn/data_parallel
1260 74
pyi
activation.pyi
in stubs/torch/nn/modules
117 62
pyi
container.pyi
in stubs/torch/nn/modules
81 59
pyi
loss.pyi
in stubs/torch/nn/modules
100 57
pyi
pooling.pyi
in stubs/torch/nn/modules
147 50
layer_memory_tracker.py
in fairscale/experimental/tooling
465 49
experimental_async_approaches.py
in benchmarks/experimental
597 48
distributed.py
in fairscale/experimental/nn/data_parallel/gossip
758 47
graph_manager.py
in fairscale/experimental/nn/data_parallel/gossip
197 45
pyi
__init__.pyi
in stubs/torch/cuda
69 43
pyi
rnn.pyi
in stubs/torch/nn/modules
81 40
pyi
module.pyi
in stubs/torch/nn/modules
57 38
testing.py
in fairscale/utils
495 35
flatten_params_wrapper.py
in fairscale/nn/misc
303 29
pyi
__init__.pyi
in stubs/torch/distributed
68 28
mevo.py
in fairscale/experimental/nn
317 24
ssd_offload.py
in fairscale/experimental/nn
197 24
async_schedule.py
in fairscale/nn/pipe
364 24
Files With Long Lines (Top 20)

There are 30 files with lines longer than 120 characters. In total, there are 275 long lines.

File# lines# units# long lines
pyi
__init__.pyi
in stubs/torch
1856 1232 225
pyi
__init__.pyi
in stubs/torch/distributed
68 28 6
pyi
lr_scheduler.pyi
in stubs/torch/optim
31 17 5
pyi
__init__.pyi
in stubs/torch/autograd
37 21 4
fully_sharded_data_parallel.py
in fairscale/nn/data_parallel
1260 74 4
pyi
module.pyi
in stubs/torch/nn/modules
57 38 3
pyi
loss.pyi
in stubs/torch/nn/modules
100 57 2
pyi
rnn.pyi
in stubs/torch/nn/modules
81 40 2
pyi
grad_scaler.pyi
in stubs/torch/cuda/amp
12 5 2
ssd_offload.py
in fairscale/experimental/nn
197 24 2
pyi
data_parallel.pyi
in stubs/torch/nn/parallel
18 4 1
pyi
functional.pyi
in stubs/torch/nn
177 80 1
pyi
__init__.pyi
in stubs/torch/nn/modules
48 - 1
pyi
linear.pyi
in stubs/torch/nn/modules
28 11 1
pyi
activation.pyi
in stubs/torch/nn/modules
117 62 1
pyi
adam.pyi
in stubs/torch/optim
4 1 1
pyi
sgd.pyi
in stubs/torch/optim
3 1 1
pyi
__init__.pyi
in stubs/torch/utils/data
6 - 1
pyi
__init__.pyi
in stubs/torch/testing
2 1 1
pyi
functional.pyi
in stubs/torch
5 3 1