tensorflow / runtime
Unit Size

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

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 3,749 units with 38,277 lines of code in units (25.6% of code).
    • 14 very long units (1,893 lines of code)
    • 69 long units (4,466 lines of code)
    • 347 medium size units (10,763 lines of code)
    • 681 small units (9,531 lines of code)
    • 2,638 very small units (11,624 lines of code)
4% | 11% | 28% | 24% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc4% | 12% | 31% | 26% | 24%
h6% | 8% | 16% | 17% | 50%
py0% | 18% | 24% | 25% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/distributed_runtime24% | 23% | 24% | 13% | 14%
backends/common18% | 11% | 33% | 18% | 17%
backends/gpu2% | 6% | 23% | 37% | 30%
lib/bef_executor_driver52% | 0% | 38% | 5% | 3%
lib/bef_converter6% | 18% | 30% | 25% | 19%
lib/core_runtime4% | 34% | 29% | 16% | 15%
lib/bef_executor0% | 32% | 42% | 9% | 15%
lib/data0% | 14% | 36% | 17% | 30%
backends/cpu0% | 12% | 49% | 18% | 19%
backends/jitrt0% | 12% | 35% | 19% | 32%
include/tfrt0% | 5% | 9% | 19% | 66%
lib/basic_kernels0% | 17% | 46% | 18% | 17%
lib/compiler0% | 21% | 40% | 16% | 20%
tools/code_size_test_app0% | 90% | 0% | 0% | 9%
lib/tensor0% | 0% | 32% | 28% | 39%
lib/support0% | 0% | 68% | 12% | 18%
lib/host_context0% | 0% | 31% | 20% | 47%
tools/btf_info_tool0% | 0% | 65% | 29% | 4%
lib/bef0% | 0% | 73% | 18% | 8%
lib/io0% | 0% | 41% | 33% | 25%
mlir_tests/bef_perf0% | 0% | 22% | 37% | 40%
lib/utils0% | 0% | 35% | 50% | 15%
cpp_tests/core_runtime0% | 0% | 0% | 53% | 46%
lib/tracing0% | 0% | 0% | 29% | 70%
tools/bef_executor0% | 0% | 0% | 100% | 0%
lib0% | 0% | 0% | 60% | 40%
cpp_tests/tracing0% | 0% | 0% | 0% | 100%
lib/dtype0% | 0% | 0% | 0% | 100%
mlir_tests0% | 0% | 0% | 0% | 100%
lib/metrics0% | 0% | 0% | 0% | 100%
cpp_tests/include0% | 0% | 0% | 0% | 100%
tools/tfrt_opt0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static llvm::Expected ComputeConvGpuOp()
in backends/gpu/lib/ops/tf/dnn_ops.cc
201 31 5
Expected DnnBuildFusedConvolution()
in backends/gpu/lib/kernels/dnn_kernels.cc
168 19 24
EIGEN_DONT_INLINE void operator()
in backends/common/include/tfrt/common/compat/eigen/spatial_convolution_data_mapper.h
145 39 0
int RunBefExecutor()
in lib/bef_executor_driver/bef_executor_driver.cc
140 25 3
void RequestHandler::HandleRemoteExecute()
in lib/distributed_runtime/request_handler_impl.cc
138 20 3
EIGEN_DONT_INLINE void operator()
in backends/common/include/tfrt/common/compat/eigen/spatial_convolution_data_mapper.h
138 39 0
static AsyncValueRef MaxPoolImpl()
in backends/common/lib/compat/eigen/kernels/max_pooling.h
133 17 6
EIGEN_ALWAYS_INLINE void packStandardPatches()
in backends/common/include/tfrt/common/compat/eigen/spatial_convolution_data_mapper.h
129 31 4
LogicalResult EntityTable::Collect()
in lib/bef_converter/mlir_to_bef/mlir_to_bef.cc
128 35 2
void RequestHandler::HandleRemoteExecuteOp()
in lib/distributed_runtime/request_handler_impl.cc
126 12 3
void DoAllReduce()
in lib/distributed_runtime/kernels.cc
125 9 9
void RemoteExecute()
in lib/distributed_runtime/kernels.cc
111 13 10
Expected CoreRuntime::MakeCompositeOp()
in lib/core_runtime/core_runtime.cc
107 17 1
void DoAllGatherAnyShape()
in lib/distributed_runtime/kernels.cc
104 14 13
void RemoteOpHandler::Execute()
in lib/distributed_runtime/remote_op_handler.cc
100 11 2
BEFAttributeType BefAttrEmitter::GetBefAttributeType()
in lib/bef_converter/mlir_to_bef/bef_attr_emitter.cc
97 63 1
void AllGatherFixedShape()
in lib/distributed_runtime/kernels.cc
94 11 9
mlir::Attribute BefAttrReader::ReadAttribute()
in lib/bef_converter/bef_to_mlir/bef_attr_reader.cc
92 22 2
static void BatchNormGrad()
in backends/common/lib/compat/eigen/kernels/batch_norm_grad.cc
92 1 16
91 20 3