Skip to content

Instantly share code, notes, and snippets.

@ezyang
Created March 31, 2024 20:27
Show Gist options
  • Save ezyang/6c10a63d5795cbd7787beeea94497948 to your computer and use it in GitHub Desktop.
Save ezyang/6c10a63d5795cbd7787beeea94497948 to your computer and use it in GitHub Desktop.
import re
import sys
import pprint
from collections import defaultdict
import matplotlib.pyplot as plt
# Sample output from git diff --stat
output = '''
0 1556 .lintrunner.toml
5 2 test/_test_bazel.py
87 58 test/ao/sparsity/test_activation_sparsifier.py
89 42 test/ao/sparsity/test_composability.py
51 25 test/ao/sparsity/test_data_scheduler.py
376 173 test/ao/sparsity/test_data_sparsifier.py
29 12 test/ao/sparsity/test_kernels.py
84 58 test/ao/sparsity/test_parametrization.py
80 54 test/ao/sparsity/test_qlinear_packed_params.py
66 51 test/ao/sparsity/test_scheduler.py
187 151 test/ao/sparsity/test_sparsifier.py
106 52 test/ao/sparsity/test_structured_sparsifier.py
8 4 test/autograd/test_complex.py
473 150 test/autograd/test_functional.py
29 4 test/backends/xeon/test_launch.py
130 101 test/benchmark_utils/test_benchmark_utils.py
4 3 test/bottleneck_test/test_args.py
1 1 test/bottleneck_test/test_cuda.py
27 22 test/conftest.py
33 19 test/cpp/aot_inductor/test.py
5 3 test/cpp/api/init_baseline.py
32 16 test/cpp/api/optim_baseline.py
12 7 test/cpp/jit/tests_setup.py
141 61 test/cpp_api_parity/functional_impl_check.py
135 63 test/cpp_api_parity/module_impl_check.py
19 11 test/cpp_api_parity/parity_table_parser.py
10 8 test/cpp_api_parity/sample_functional.py
18 14 test/cpp_api_parity/sample_module.py
109 71 test/cpp_api_parity/utils.py
62 46 test/cpp_extensions/setup.py
2 2 test/create_dummy_torchscript_model.py
5 4 test/custom_backend/backend.py
3 2 test/custom_backend/test_custom_backend.py
21 11 test/custom_operator/test_custom_ops.py
19 27 test/distributed/_shard/sharded_optim/test_sharded_optim.py
18 17 test/distributed/_shard/sharded_tensor/ops/test_binary_cmp.py
36 21 test/distributed/_shard/sharded_tensor/ops/test_embedding.py
10 13 test/distributed/_shard/sharded_tensor/ops/test_embedding_bag.py
19 19 test/distributed/_shard/sharded_tensor/ops/test_init.py
4 11 test/distributed/_shard/sharded_tensor/ops/test_tensor_ops.py
1 4 test/distributed/_shard/sharded_tensor/test_logger.py
822 521 test/distributed/_shard/sharded_tensor/test_sharded_tensor.py
7 17 test/distributed/_shard/sharded_tensor/test_sharded_tensor_reshard.py
11 25 test/distributed/_shard/sharding_plan/test_sharding_plan.py
223 196 test/distributed/_shard/sharding_spec/test_sharding_spec.py
44 25 test/distributed/_shard/test_sharder.py
4 7 test/distributed/_tools/test_memory_tracker.py
4 7 test/distributed/algorithms/ddp_comm_hooks/test_ddp_hooks.py
8 7 test/distributed/algorithms/quantization/test_quantization.py
50 67 test/distributed/algorithms/test_join.py
128 44 test/distributed/elastic/agent/server/test/local_elastic_agent_test.py
6 4 test/distributed/elastic/events/lib_test.py
1 1 test/distributed/elastic/metrics/api_test.py
15 14 test/distributed/elastic/multiprocessing/api_test.py
0 1 test/distributed/elastic/multiprocessing/bin/echo3.py
3 2 test/distributed/elastic/multiprocessing/tail_log_test.py
7 3 test/distributed/elastic/rendezvous/api_test.py
38 22 test/distributed/elastic/rendezvous/c10d_rendezvous_backend_test.py
82 28 test/distributed/elastic/rendezvous/dynamic_rendezvous_test.py
17 8 test/distributed/elastic/rendezvous/etcd_rendezvous_backend_test.py
2 1 test/distributed/elastic/rendezvous/etcd_server_test.py
8 3 test/distributed/elastic/rendezvous/rendezvous_backend_test.py
19 11 test/distributed/elastic/rendezvous/utils_test.py
27 9 test/distributed/elastic/timer/file_based_local_timer_test.py
11 6 test/distributed/elastic/timer/local_timer_example.py
3 3 test/distributed/elastic/timer/local_timer_test.py
9 2 test/distributed/elastic/utils/distributed_test.py
22 10 test/distributed/launcher/api_test.py
1 1 test/distributed/launcher/launch_test.py
55 19 test/distributed/launcher/run_test.py
2 2 test/distributed/nn/jit/test_instantiator.py
4 2 test/distributed/optim/test_zero_redundancy_optimizer.py
5 1 test/distributed/pipeline/sync/conftest.py
14 4 test/distributed/pipeline/sync/skip/test_gpipe.py
4 2 test/distributed/pipeline/sync/skip/test_leak.py
14 4 test/distributed/pipeline/sync/skip/test_tracker.py
6 1 test/distributed/pipeline/sync/skip/test_verify_skippables.py
12 3 test/distributed/pipeline/sync/test_balance.py
2 2 test/distributed/pipeline/sync/test_bugs.py
15 3 test/distributed/pipeline/sync/test_checkpoint.py
11 2 test/distributed/pipeline/sync/test_copy.py
2 2 test/distributed/pipeline/sync/test_deferred_batch_norm.py
1 1 test/distributed/pipeline/sync/test_dependency.py
63 42 test/distributed/pipeline/sync/test_pipe.py
3 1 test/distributed/pipeline/sync/test_stream.py
6 1 test/distributed/pipeline/sync/test_transparency.py
2 1 test/distributed/pipeline/sync/test_worker.py
3 3 test/distributed/rpc/cuda/test_tensorpipe_agent.py
20 20 test/distributed/rpc/test_share_memory.py
1 1 test/distributed/rpc/test_tensorpipe_agent.py
6 2 test/distributed/tensor/parallel/test_ddp_2d_parallel.py
3 1 test/distributed/tensor/parallel/test_fsdp_2d_parallel.py
5 9 test/distributed/tensor/parallel/test_parallelize_api.py
61 28 test/distributed/tensor/parallel/test_tp_examples.py
6 2 test/distributed/tensor/parallel/test_tp_random_state.py
86 28 test/distributed/tensor/parallel/test_tp_style.py
185 98 test/distributed/test_c10d_common.py
98 60 test/distributed/test_c10d_gloo.py
448 264 test/distributed/test_c10d_nccl.py
19 20 test/distributed/test_c10d_object_collectives.py
20 16 test/distributed/test_c10d_pypg.py
14 13 test/distributed/test_c10d_spawn.py
88 35 test/distributed/test_c10d_spawn_gloo.py
55 23 test/distributed/test_c10d_spawn_nccl.py
34 15 test/distributed/test_c10d_spawn_ucc.py
29 31 test/distributed/test_c10d_ucc.py
10 4 test/distributed/test_collective_utils.py
171 99 test/distributed/test_data_parallel.py
14 5 test/distributed/test_distributed_spawn.py
206 110 test/distributed/test_dynamo_distributed.py
29 49 test/distributed/test_fake_pg.py
7 15 test/distributed/test_functional_api.py
242 175 test/distributed/test_inductor_collectives.py
1 1 test/distributed/test_launcher.py
34 18 test/distributed/test_multi_threaded_pg.py
12 11 test/distributed/test_nccl.py
97 32 test/distributed/test_store.py
90 41 test/distributions/test_constraints.py
3429 1854 test/distributions/test_distributions.py
197 139 test/distributions/test_transforms.py
10 6 test/distributions/test_utils.py
48 43 test/error_messages/storage.py
6 2 test/export/test_db.py
216 118 test/export/test_export.py
11 6 test/export/test_pass_infra.py
138 64 test/export/test_passes.py
84 40 test/export/test_serialize.py
38 22 test/export/test_unflatten.py
44 27 test/export/test_upgrade.py
10 11 test/export/test_verifier.py
15 6 test/forward_backward_compatibility/check_forward_backward_compatibility.py
10 9 test/forward_backward_compatibility/dump_all_function_schemas.py
30 12 test/functorch/attn_ft.py
44 16 test/functorch/attn_positional.py
205 90 test/functorch/common_utils.py
314 241 test/functorch/discover_coverage.py
562 319 test/functorch/functorch_additional_op_db.py
1278 562 test/functorch/test_aotdispatch.py
502 203 test/functorch/test_control_flow.py
167 60 test/functorch/test_dims.py
762 457 test/functorch/test_eager_transforms.py
8 10 test/functorch/test_logging.py
45 22 test/functorch/test_memory_efficient_fusion.py
7 5 test/functorch/test_minifier.py
1655 1008 test/functorch/test_ops.py
99 41 test/functorch/test_parsing.py
61 49 test/functorch/test_rearrange.py
1874 1024 test/functorch/test_vmap.py
21 17 test/functorch/test_vmap_registrations.py
38 38 test/functorch/xfail_suggester.py
3 2 test/fx/named_tup.py
112 44 test/fx/quantization.py
29 17 test/fx/test_common_passes.py
48 18 test/fx/test_cse_pass.py
1 0 test/fx/test_dce_pass.py
10 2 test/fx/test_future.py
18 11 test/fx/test_fx_param_shape_control_flow.py
3 1 test/fx/test_fx_split.py
328 159 test/fx/test_gradual_type.py
45 18 test/fx/test_matcher_utils.py
77 15 test/fx/test_source_matcher_utils.py
58 39 test/fx/test_subgraph_rewriter.py
495 231 test/fx/test_z3_gradual_types.py
1 0 test/jit/_imported_class_test/bar.py
2 0 test/jit/_imported_class_test/foo.py
1 0 test/jit/_imported_class_test/very/very/nested.py
22 3 test/jit/fixtures_srcs/fixtures_src.py
49 14 test/jit/fixtures_srcs/generate_models.py
5 3 test/jit/fixtures_srcs/test_upgrader_models_generation.py
2 0 test/jit/myexception.py
21 10 test/jit/test_alias_analysis.py
76 38 test/jit/test_async.py
39 30 test/jit/test_aten_pow.py
16 10 test/jit/test_attr.py
2 2 test/jit/test_autodiff.py
164 93 test/jit/test_autodiff_subgraph_slicing.py
20 14 test/jit/test_await.py
34 19 test/jit/test_backend_nnapi.py
176 104 test/jit/test_backends.py
0 1 test/jit/test_batch_mm.py
32 22 test/jit/test_builtins.py
193 70 test/jit/test_class_type.py
328 70 test/jit/test_complex.py
19 6 test/jit/test_complexity.py
43 15 test/jit/test_convert_activation.py
136 55 test/jit/test_cuda.py
37 25 test/jit/test_custom_operators.py
15 11 test/jit/test_data_parallel.py
21 13 test/jit/test_dataclasses.py
2 2 test/jit/test_device_analysis.py
14 10 test/jit/test_dtype_analysis.py
51 67 test/jit/test_enum.py
36 13 test/jit/test_exception.py
645 329 test/jit/test_freezing.py
20 9 test/jit/test_functional_blocks.py
2 0 test/jit/test_fuser_common.py
1 1 test/jit/test_graph_rewrite_passes.py
13 9 test/jit/test_hash.py
21 11 test/jit/test_hooks.py
2 1 test/jit/test_hooks_modules.py
12 5 test/jit/test_ignorable_args.py
18 6 test/jit/test_ignore_context_manager.py
47 16 test/jit/test_isinstance.py
42 30 test/jit/test_jit_utils.py
466 220 test/jit/test_list_dict.py
23 21 test/jit/test_logging.py
103 55 test/jit/test_misc.py
144 75 test/jit/test_models.py
36 22 test/jit/test_module_apis.py
115 52 test/jit/test_module_containers.py
74 36 test/jit/test_module_interface.py
9 5 test/jit/test_modules.py
10 5 test/jit/test_op_decompositions.py
11 14 test/jit/test_optimize_for_mobile_preserve_debug_info.py
12 10 test/jit/test_parametrization.py
557 104 test/jit/test_pdt.py
50 40 test/jit/test_peephole.py
21 11 test/jit/test_profiler.py
144 102 test/jit/test_python_builtins.py
17 9 test/jit/test_python_ir.py
85 62 test/jit/test_recursive_script.py
37 30 test/jit/test_remove_mutation.py
50 56 test/jit/test_save_load.py
171 55 test/jit/test_save_load_for_op_version.py
10 6 test/jit/test_script_profile.py
71 52 test/jit/test_scriptmod_ann.py
15 8 test/jit/test_slice.py
2 3 test/jit/test_sparse.py
68 33 test/jit/test_string_formatting.py
267 70 test/jit/test_symbolic_shape_analysis.py
9 6 test/jit/test_tensor_creation_ops.py
5 3 test/jit/test_tensor_methods.py
40 26 test/jit/test_torchbind.py
483 253 test/jit/test_tracer.py
41 17 test/jit/test_type_sharing.py
84 44 test/jit/test_types.py
108 63 test/jit/test_typing.py
366 310 test/jit/test_union.py
28 18 test/jit/test_unsupported_ops.py
80 31 test/jit/test_upgraders.py
34 53 test/jit/test_warn.py
22 6 test/jit/test_with.py
33 28 test/jit/xnnpack/test_xnnpack_delegate.py
44 15 test/jit_hooks/model.py
1 0 test/lazy/test_bindings.py
7 6 test/lazy/test_debug_util.py
41 11 test/lazy/test_extract_compiled_graph.py
5 5 test/lazy/test_meta_kernel.py
33 22 test/lazy/test_reuse_ir.py
132 85 test/lazy/test_ts_opinfo.py
3 0 test/linear.py
2 1 test/load_torchscript_model.py
4 1 test/mkl_verbose.py
5 1 test/mkldnn_verbose.py
2 2 test/mobile/custom_build/prepare_model.py
26 10 test/mobile/lightweight_dispatch/tests_setup.py
1 1 test/mobile/model_test/android_api_module.py
29 23 test/mobile/model_test/gen_test_model.py
34 28 test/mobile/model_test/nn_ops.py
17 15 test/mobile/model_test/quantization_ops.py
1 0 test/mobile/model_test/sampling_ops.py
3 3 test/mobile/model_test/torchvision_models.py
13 4 test/mobile/model_test/update_production_ops.py
1 0 test/mobile/nnc/aot_test_model.py
82 36 test/mobile/test_bytecode.py
120 75 test/mobile/test_lite_script_module.py
22 29 test/mobile/test_lite_script_type.py
5 12 test/mobile/test_quantize_fx_lite_script_module.py
24 14 test/mobile/test_upgrader_codegen.py
22 11 test/mobile/test_upgraders.py
2119 673 test/nn/test_convolution.py
61 26 test/nn/test_dropout.py
658 306 test/nn/test_embedding.py
135 53 test/nn/test_init.py
280 117 test/nn/test_lazy_modules.py
163 90 test/nn/test_load_state_dict.py
207 152 test/nn/test_module_hooks.py
416 147 test/nn/test_multihead_attention.py
133 63 test/nn/test_packed_sequence.py
198 112 test/nn/test_parametrization.py
626 264 test/nn/test_pooling.py
188 210 test/nn/test_pruning.py
0 1 test/onnx_caffe2/test_pytorch_onnx_caffe2.py
80 52 test/optim/test_lrscheduler.py
117 66 test/optim/test_optim.py
23 8 test/optim/test_swa_utils.py
4 1 test/package/package_a/long_name.py
0 1 test/package/package_d/imports_directly.py
0 1 test/package/package_d/imports_indirectly.py
4 1 test/package/test_directory_reader.py
0 1 test/package/test_load_bc_packages.py
12 4 test/package/test_misc.py
4 2 test/package/test_model.py
1 1 test/package/test_package_fx.py
3 1 test/package/test_save_load.py
16 10 test/profiler/test_memory_profiler.py
540 368 test/profiler/test_profiler.py
54 31 test/profiler/test_profiler_tree.py
29 19 test/quantization/ao_migration/common.py
215 204 test/quantization/ao_migration/test_ao_migration.py
99 100 test/quantization/ao_migration/test_quantization.py
99 110 test/quantization/ao_migration/test_quantization_fx.py
264 75 test/quantization/bc/test_backward_compatibility.py
44 18 test/quantization/core/experimental/apot_fx_graph_mode_ptq.py
28 10 test/quantization/core/experimental/apot_fx_graph_mode_qat.py
51 38 test/quantization/core/experimental/quantization_util.py
24 7 test/quantization/core/experimental/test_bits.py
32 12 test/quantization/core/experimental/test_fake_quantize.py
15 6 test/quantization/core/experimental/test_linear.py
46 18 test/quantization/core/experimental/test_nonuniform_observer.py
17 9 test/quantization/core/experimental/test_quantized_tensor.py
97 56 test/quantization/core/experimental/test_quantizer.py
98 47 test/quantization/core/test_backend_config.py
7 3 test/quantization/core/test_docs.py
294 140 test/quantization/core/test_quantized_functional.py
1011 454 test/quantization/core/test_quantized_module.py
4667 2560 test/quantization/core/test_quantized_op.py
560 242 test/quantization/core/test_quantized_tensor.py
15 8 test/quantization/core/test_top_level_apis.py
31 22 test/quantization/core/test_utils.py
438 222 test/quantization/core/test_workflow_module.py
686 282 test/quantization/core/test_workflow_ops.py
42 22 test/quantization/eager/test_bias_correction_eager.py
53 36 test/quantization/eager/test_equalize_eager.py
305 166 test/quantization/eager/test_fuse_eager.py
61 20 test/quantization/eager/test_model_numerics.py
52 26 test/quantization/eager/test_numeric_suite_eager.py
560 292 test/quantization/eager/test_quantize_eager_ptq.py
429 257 test/quantization/eager/test_quantize_eager_qat.py
376 219 test/quantization/fx/test_equalize_fx.py
482 205 test/quantization/fx/test_model_report_fx.py
930 529 test/quantization/fx/test_numeric_suite_fx.py
2777 1508 test/quantization/fx/test_quantize_fx.py
17 11 test/quantization/fx/test_subgraph_rewriter.py
75 47 test/quantization/jit/test_deprecated_jit_quant.py
32 34 test/quantization/jit/test_fusion_passes.py
85 75 test/quantization/jit/test_ondevice_quantization.py
104 92 test/quantization/jit/test_quantize_jit.py
11 9 test/quantization/pt2e/test_graph_utils.py
223 103 test/quantization/pt2e/test_quantize_pt2e.py
227 124 test/quantization/pt2e/test_x86inductor_quantizer.py
7 5 test/scripts/cuda_memcheck_common.py
80 38 test/scripts/run_cuda_memcheck.py
23 19 test/simulate_nccl_errors.py
38 25 test/test_ao_sparsity.py
98 36 test/test_autocast.py
2033 884 test/test_autograd.py
119 85 test/test_binary_ufuncs.py
13 3 test/test_bundled_images.py
57 57 test/test_bundled_inputs.py
3 2 test/test_comparison_utils.py
25 8 test/test_compile_benchmark_util.py
306 75 test/test_complex.py
42 13 test/test_cpp_api_parity.py
32 25 test/test_cpp_extensions_aot.py
100 66 test/test_cpp_extensions_jit.py
112 78 test/test_cpp_extensions_open_device_registration.py
1234 577 test/test_cuda.py
4 3 test/test_cuda_expandable_segments.py
275 148 test/test_cuda_multigpu.py
63 31 test/test_cuda_nvml_based_avail.py
26 15 test/test_cuda_primary_ctx.py
2 2 test/test_cuda_sanitizer.py
1 1 test/test_cuda_trace.py
1039 429 test/test_dataloader.py
1034 397 test/test_datapipe.py
290 178 test/test_decomp.py
2 1 test/test_deploy.py
10 7 test/test_determination.py
471 272 test/test_dispatch.py
59 9 test/test_dlpack.py
247 115 test/test_dynamic_shapes.py
544 169 test/test_expanded_weights.py
237 122 test/test_fake_tensor.py
155 45 test/test_flop_counter.py
576 165 test/test_foreach.py
171 81 test/test_function_schema.py
40 17 test/test_functional_autograd_benchmark.py
17 7 test/test_functional_optim.py
617 229 test/test_functionalization.py
24 27 test/test_functionalization_of_rng_ops.py
21 15 test/test_futures.py
863 572 test/test_fx.py
88 42 test/test_fx_experimental.py
281 129 test/test_fx_passes.py
63 28 test/test_fx_reinplace_pass.py
111 68 test/test_hub.py
1 1 test/test_import_stats.py
558 335 test/test_indexing.py
6 3 test/test_itt.py
3475 1815 test/test_jit.py
131 51 test/test_jit_autocast.py
9 11 test/test_jit_disabled.py
341 189 test/test_jit_fuser.py
2 1 test/test_jit_fuser_legacy.py
565 326 test/test_jit_fuser_te.py
2 1 test/test_jit_legacy.py
214 129 test/test_jit_llga_fuser.py
2 1 test/test_jit_profiling.py
2 1 test/test_jit_simple.py
184 45 test/test_jit_string.py
60 27 test/test_jiterator.py
25 9 test/test_kernel_launch_checks.py
624 280 test/test_legacy_vmap.py
16 12 test/test_license.py
3073 1302 test/test_linalg.py
5 3 test/test_logging.py
184 105 test/test_masked.py
100 53 test/test_maskedtensor.py
101 50 test/test_matmul_cuda.py
748 293 test/test_meta.py
101 49 test/test_metal.py
25 11 test/test_mkl_verbose.py
525 302 test/test_mkldnn.py
224 74 test/test_mkldnn_fusion.py
25 11 test/test_mkldnn_verbose.py
225 111 test/test_mobile_optimizer.py
44 26 test/test_model_dump.py
574 193 test/test_modules.py
16 13 test/test_monitor.py
5424 2838 test/test_mps.py
281 161 test/test_multiprocessing.py
47 12 test/test_multiprocessing_spawn.py
1140 850 test/test_namedtensor.py
309 84 test/test_namedtuple_return_api.py
32 13 test/test_native_functions.py
103 35 test/test_native_mha.py
1343 608 test/test_nestedtensor.py
6570 2887 test/test_nn.py
138 106 test/test_nnapi.py
54 20 test/test_numba_integration.py
125 54 test/test_numpy_interop.py
10 10 test/test_openmp.py
455 300 test/test_ops.py
50 21 test/test_ops_fwd_gradients.py
29 13 test/test_ops_gradients.py
131 59 test/test_ops_jit.py
300 142 test/test_optim.py
66 49 test/test_out_dtype_op.py
163 63 test/test_overrides.py
16 13 test/test_package.py
17 10 test/test_per_overload_api.py
81 51 test/test_prims.py
677 339 test/test_proxy_tensor.py
57 23 test/test_pruning_op.py
106 53 test/test_public_bindings.py
500 237 test/test_python_dispatch.py
153 81 test/test_quantization.py
1683 660 test/test_reductions.py
226 70 test/test_scatter_gather_ops.py
122 87 test/test_schema_check.py
117 89 test/test_segment_reductions.py
2110 1903 test/test_serialization.py
4 2 test/test_set_default_mobile_cpu_allocator.py
162 77 test/test_shape_ops.py
8 5 test/test_show_pickle.py
413 233 test/test_sort_and_select.py
2531 1126 test/test_sparse.py
2357 981 test/test_sparse_csr.py
156 78 test/test_sparse_semi_structured.py
734 398 test/test_spectral_ops.py
422 291 test/test_stateless.py
33 11 test/test_static_runtime.py
36 29 test/test_subclass.py
73 28 test/test_sympy_utils.py
1490 676 test/test_tensor_creation_ops.py
349 231 test/test_tensorboard.py
147 61 test/test_tensorexpr.py
3 2 test/test_tensorexpr_pybind.py
775 414 test/test_testing.py
5 3 test/test_throughput_benchmark.py
3267 1550 test/test_torch.py
2468 817 test/test_transformers.py
20 16 test/test_type_hints.py
39 11 test/test_type_info.py
434 172 test/test_type_promotion.py
56 44 test/test_unary_ufuncs.py
290 168 test/test_utils.py
380 171 test/test_view_ops.py
104 51 test/test_vulkan.py
875 490 test/test_xnnpack_integration.py
9 3 test/typing/fail/creation_ops.py
3 1 test/typing/fail/random.py
13 12 test/typing/pass/creation_ops.py
47 35 test/typing/pass/math_ops.py
3 0 test/typing/reveal/module_list.py
4 4 test/typing/reveal/namedtuple.py
1 0 test/typing/reveal/size.py
26 13 test/typing/reveal/tensor_constructors.py
1 0 test/typing/reveal/torch_optim.py
4 2 torch/_awaits/__init__.py
92 60 torch/_custom_op/autograd.py
40 21 torch/_custom_op/functional.py
71 31 torch/_custom_op/impl.py
27 19 torch/_export/__init__.py
1 1 torch/_export/db/case.py
2 1 torch/_export/db/examples/cond_branch_class_method.py
3 1 torch/_export/db/examples/cond_branch_nested_function.py
2 1 torch/_export/db/examples/cond_branch_nonlocal_variables.py
2 1 torch/_export/db/examples/cond_closed_over_variable.py
3 1 torch/_export/db/examples/cond_operands.py
2 1 torch/_export/db/examples/cond_predicate.py
1 0 torch/_export/db/examples/dictionary.py
1 0 torch/_export/db/examples/dynamic_shape_assert.py
1 0 torch/_export/db/examples/dynamic_shape_constructor.py
2 1 torch/_export/db/examples/dynamic_shape_map.py
1 0 torch/_export/db/examples/dynamic_shape_round.py
3 1 torch/_export/db/examples/fn_with_kwargs.py
1 0 torch/_export/db/examples/list_contains.py
1 0 torch/_export/db/examples/nested_function.py
1 0 torch/_export/db/examples/pytree_flatten.py
2 0 torch/_export/db/examples/scalar_output.py
1 0 torch/_export/db/examples/tensor_setattr.py
1 1 torch/_export/db/examples/type_reflection_method.py
3 9 torch/_export/exported_program.py
40 9 torch/_export/pass_base.py
45 24 torch/_export/passes/add_runtime_assertions_for_constraints_pass.py
6 2 torch/_export/passes/functionalize_side_effectful_ops_pass.py
4 4 torch/_export/passes/replace_view_ops_with_view_copy_ops_pass.py
1 2 torch/_export/serde/schema.py
65 44 torch/_export/serde/serialize.py
76 37 torch/_export/serde/upgrade.py
49 34 torch/_export/verifier.py
201 123 torch/_functorch/aot_autograd.py
58 23 torch/_functorch/apis.py
114 67 torch/_functorch/autograd_function.py
4 1 torch/_functorch/batch_norm_replacement.py
47 12 torch/_functorch/benchmark_utils.py
39 12 torch/_functorch/compile_utils.py
19 13 torch/_functorch/compilers.py
87 41 torch/_functorch/deprecated.py
327 168 torch/_functorch/eager_transforms.py
105 51 torch/_functorch/fx_minifier.py
396 119 torch/_functorch/partitioners.py
21 11 torch/_functorch/pyfunctorch.py
6 1 torch/_functorch/python_key.py
52 48 torch/_functorch/top_operators_github_usage.py
9 4 torch/_functorch/utils.py
165 83 torch/_functorch/vmap.py
25 29 torch/_higher_order_ops/out_dtype.py
25 8 torch/_higher_order_ops/wrap.py
0 2 torch/_vendor/packaging/version.py
2 0 torch/ao/__init__.py
1 0 torch/ao/nn/__init__.py
19 17 torch/ao/nn/intrinsic/__init__.py
37 35 torch/ao/nn/intrinsic/modules/__init__.py
141 40 torch/ao/nn/intrinsic/modules/fused.py
3 3 torch/ao/nn/intrinsic/qat/modules/__init__.py
367 152 torch/ao/nn/intrinsic/qat/modules/conv_fused.py
45 25 torch/ao/nn/intrinsic/qat/modules/linear_fused.py
6 4 torch/ao/nn/intrinsic/qat/modules/linear_relu.py
10 10 torch/ao/nn/intrinsic/quantized/__init__.py
1 1 torch/ao/nn/intrinsic/quantized/dynamic/modules/__init__.py
9 8 torch/ao/nn/intrinsic/quantized/dynamic/modules/linear_relu.py
12 12 torch/ao/nn/intrinsic/quantized/modules/__init__.py
29 13 torch/ao/nn/intrinsic/quantized/modules/bn_relu.py
69 23 torch/ao/nn/intrinsic/quantized/modules/conv_add.py
128 46 torch/ao/nn/intrinsic/quantized/modules/conv_relu.py
37 29 torch/ao/nn/intrinsic/quantized/modules/linear_relu.py
12 4 torch/ao/nn/qat/dynamic/modules/linear.py
2 4 torch/ao/nn/qat/modules/__init__.py
113 81 torch/ao/nn/qat/modules/conv.py
166 63 torch/ao/nn/qat/modules/embedding_ops.py
25 12 torch/ao/nn/qat/modules/linear.py
4 5 torch/ao/nn/quantizable/modules/__init__.py
218 138 torch/ao/nn/quantizable/modules/activation.py
181 96 torch/ao/nn/quantizable/modules/rnn.py
31 31 torch/ao/nn/quantized/__init__.py
21 15 torch/ao/nn/quantized/dynamic/modules/__init__.py
205 74 torch/ao/nn/quantized/dynamic/modules/conv.py
57 24 torch/ao/nn/quantized/dynamic/modules/linear.py
514 268 torch/ao/nn/quantized/dynamic/modules/rnn.py
199 67 torch/ao/nn/quantized/functional.py
79 48 torch/ao/nn/quantized/modules/__init__.py
83 44 torch/ao/nn/quantized/modules/activation.py
38 22 torch/ao/nn/quantized/modules/batchnorm.py
473 182 torch/ao/nn/quantized/modules/conv.py
3 2 torch/ao/nn/quantized/modules/dropout.py
182 71 torch/ao/nn/quantized/modules/embedding_ops.py
70 22 torch/ao/nn/quantized/modules/functional_modules.py
112 65 torch/ao/nn/quantized/modules/linear.py
214 69 torch/ao/nn/quantized/modules/normalization.py
10 6 torch/ao/nn/quantized/modules/rnn.py
43 18 torch/ao/nn/quantized/modules/utils.py
14 14 torch/ao/nn/quantized/reference/__init__.py
23 16 torch/ao/nn/quantized/reference/modules/__init__.py
286 96 torch/ao/nn/quantized/reference/modules/conv.py
21 13 torch/ao/nn/quantized/reference/modules/linear.py
360 132 torch/ao/nn/quantized/reference/modules/rnn.py
95 30 torch/ao/nn/quantized/reference/modules/sparse.py
205 97 torch/ao/nn/quantized/reference/modules/utils.py
1 2 torch/ao/nn/sparse/quantized/__init__.py
89 41 torch/ao/nn/sparse/quantized/dynamic/linear.py
142 66 torch/ao/nn/sparse/quantized/linear.py
22 10 torch/ao/nn/sparse/quantized/utils.py
52 45 torch/ao/ns/_numeric_suite.py
268 172 torch/ao/ns/_numeric_suite_fx.py
69 57 torch/ao/ns/fx/graph_matcher.py
404 223 torch/ao/ns/fx/graph_passes.py
62 63 torch/ao/ns/fx/mappings.py
276 205 torch/ao/ns/fx/n_shadows_utils.py
7 5 torch/ao/ns/fx/ns_types.py
28 19 torch/ao/ns/fx/pattern_utils.py
10 8 torch/ao/ns/fx/qconfig_multi_mapping.py
21 15 torch/ao/ns/fx/utils.py
65 60 torch/ao/ns/fx/weight_utils.py
16 12 torch/ao/pruning/__init__.py
152 101 torch/ao/pruning/_experimental/activation_sparsifier/activation_sparsifier.py
35 20 torch/ao/pruning/_experimental/data_scheduler/base_data_scheduler.py
72 52 torch/ao/pruning/_experimental/data_sparsifier/base_data_sparsifier.py
62 32 torch/ao/pruning/_experimental/data_sparsifier/benchmarks/dlrm_utils.py
49 29 torch/ao/pruning/_experimental/data_sparsifier/benchmarks/evaluate_disk_savings.py
28 22 torch/ao/pruning/_experimental/data_sparsifier/benchmarks/evaluate_forward_time.py
29 22 torch/ao/pruning/_experimental/data_sparsifier/benchmarks/evaluate_model_metrics.py
95 47 torch/ao/pruning/_experimental/data_sparsifier/data_norm_sparsifier.py
9 6 torch/ao/pruning/_experimental/data_sparsifier/lightning/callbacks/_data_sparstity_utils.py
21 8 torch/ao/pruning/_experimental/data_sparsifier/lightning/callbacks/data_sparsity.py
84 50 torch/ao/pruning/_experimental/data_sparsifier/lightning/tests/test_callbacks.py
49 31 torch/ao/pruning/_experimental/data_sparsifier/quantization_utils.py
3 6 torch/ao/pruning/_experimental/pruner/__init__.py
16 13 torch/ao/pruning/_experimental/pruner/base_structured_sparsifier.py
4 1 torch/ao/pruning/_experimental/pruner/lstm_saliency_pruner.py
8 5 torch/ao/pruning/_experimental/pruner/match_utils.py
0 1 torch/ao/pruning/_experimental/pruner/parametrization.py
3 2 torch/ao/pruning/_experimental/pruner/prune_functions.py
3 1 torch/ao/pruning/_experimental/pruner/saliency_pruner.py
4 0 torch/ao/pruning/_mappings.py
40 31 torch/ao/pruning/scheduler/base_scheduler.py
20 16 torch/ao/pruning/scheduler/cubic_scheduler.py
10 4 torch/ao/pruning/scheduler/lambda_scheduler.py
4 6 torch/ao/pruning/sparsifier/base_sparsifier.py
6 4 torch/ao/pruning/sparsifier/nearly_diagonal_sparsifier.py
5 5 torch/ao/pruning/sparsifier/utils.py
67 21 torch/ao/pruning/sparsifier/weight_norm_sparsifier.py
25 14 torch/ao/quantization/__init__.py
22 10 torch/ao/quantization/_correct_bias.py
36 11 torch/ao/quantization/_equalize.py
71 34 torch/ao/quantization/_learnable_fake_quantize.py
9 3 torch/ao/quantization/backend_config/__init__.py
354 199 torch/ao/quantization/backend_config/_common_operator_config_utils.py
28 8 torch/ao/quantization/backend_config/_qnnpack_pt2e.py
130 44 torch/ao/quantization/backend_config/backend_config.py
9 3 torch/ao/quantization/backend_config/executorch.py
23 12 torch/ao/quantization/backend_config/fbgemm.py
51 27 torch/ao/quantization/backend_config/native.py
234 127 torch/ao/quantization/backend_config/onednn.py
22 13 torch/ao/quantization/backend_config/qnnpack.py
39 25 torch/ao/quantization/backend_config/tensorrt.py
57 27 torch/ao/quantization/backend_config/utils.py
23 12 torch/ao/quantization/backend_config/x86.py
1 0 torch/ao/quantization/experimental/APoT_tensor.py
8 0 torch/ao/quantization/experimental/apot_utils.py
13 6 torch/ao/quantization/experimental/fake_quantize.py
13 8 torch/ao/quantization/experimental/fake_quantize_function.py
32 15 torch/ao/quantization/experimental/linear.py
24 13 torch/ao/quantization/experimental/observer.py
32 23 torch/ao/quantization/experimental/qconfig.py
55 16 torch/ao/quantization/experimental/quantizer.py
255 133 torch/ao/quantization/fake_quantize.py
60 17 torch/ao/quantization/fuse_modules.py
60 28 torch/ao/quantization/fuser_method_mappings.py
1 1 torch/ao/quantization/fx/__init__.py
351 212 torch/ao/quantization/fx/_decomposed.py
255 129 torch/ao/quantization/fx/_equalize.py
269 123 torch/ao/quantization/fx/_lower_to_native_backend.py
354 141 torch/ao/quantization/fx/_model_report/detector.py
95 47 torch/ao/quantization/fx/_model_report/model_report.py
28 9 torch/ao/quantization/fx/_model_report/model_report_observer.py
73 28 torch/ao/quantization/fx/_model_report/model_report_visualizer.py
352 252 torch/ao/quantization/fx/convert.py
176 77 torch/ao/quantization/fx/custom_config.py
72 47 torch/ao/quantization/fx/fuse.py
42 33 torch/ao/quantization/fx/fuse_handler.py
118 36 torch/ao/quantization/fx/graph_module.py
8 6 torch/ao/quantization/fx/lower_to_fbgemm.py
8 8 torch/ao/quantization/fx/lower_to_qnnpack.py
37 18 torch/ao/quantization/fx/lstm_utils.py
69 80 torch/ao/quantization/fx/match_utils.py
30 7 torch/ao/quantization/fx/pattern_utils.py
698 396 torch/ao/quantization/fx/prepare.py
156 101 torch/ao/quantization/fx/qconfig_mapping_utils.py
61 31 torch/ao/quantization/fx/quantize_handler.py
9 7 torch/ao/quantization/fx/tracer.py
231 143 torch/ao/quantization/fx/utils.py
103 45 torch/ao/quantization/observer.py
8 3 torch/ao/quantization/pt2e/graph_utils.py
127 57 torch/ao/quantization/pt2e/prepare.py
150 42 torch/ao/quantization/pt2e/qat_utils.py
330 104 torch/ao/quantization/pt2e/representation/rewrite.py
88 40 torch/ao/quantization/pt2e/utils.py
316 186 torch/ao/quantization/qconfig.py
72 42 torch/ao/quantization/qconfig_mapping.py
4 0 torch/ao/quantization/quant_type.py
91 72 torch/ao/quantization/quantization_mappings.py
232 117 torch/ao/quantization/quantize.py
72 60 torch/ao/quantization/quantize_fx.py
119 42 torch/ao/quantization/quantize_jit.py
22 24 torch/ao/quantization/quantize_pt2e.py
6 4 torch/ao/quantization/stubs.py
158 97 torch/ao/quantization/utils.py
13 1 torch/compiler/__init__.py
43 33 torch/contrib/_tensorboard_vis.py
1 3 torch/cuda/_gpu_trace.py
302 197 torch/cuda/_memory_viz.py
29 29 torch/distributed/__init__.py
1 6 torch/distributed/_shard/__init__.py
8 7 torch/distributed/_shard/_utils.py
60 46 torch/distributed/_shard/api.py
5 3 torch/distributed/_shard/checkpoint/__init__.py
6 3 torch/distributed/_shard/common_op_utils.py
10 8 torch/distributed/_shard/metadata.py
7 3 torch/distributed/_shard/op_registry_utils.py
5 7 torch/distributed/_shard/sharded_optim/__init__.py
9 7 torch/distributed/_shard/sharded_optim/api.py
100 81 torch/distributed/_shard/sharded_tensor/__init__.py
9 5 torch/distributed/_shard/sharded_tensor/_ops/__init__.py
7 2 torch/distributed/_shard/sharded_tensor/_ops/_common.py
21 11 torch/distributed/_shard/sharded_tensor/_ops/binary_cmp.py
19 12 torch/distributed/_shard/sharded_tensor/_ops/init.py
2 3 torch/distributed/_shard/sharded_tensor/_ops/misc_ops.py
5 4 torch/distributed/_shard/sharded_tensor/_ops/tensor_ops.py
184 131 torch/distributed/_shard/sharded_tensor/api.py
1 3 torch/distributed/_shard/sharded_tensor/logger.py
17 5 torch/distributed/_shard/sharded_tensor/metadata.py
8 11 torch/distributed/_shard/sharded_tensor/reshard.py
10 6 torch/distributed/_shard/sharded_tensor/shard.py
110 59 torch/distributed/_shard/sharded_tensor/utils.py
3 0 torch/distributed/_shard/sharder.py
1 4 torch/distributed/_shard/sharding_plan/__init__.py
5 1 torch/distributed/_shard/sharding_plan/api.py
3 6 torch/distributed/_shard/sharding_spec/__init__.py
16 9 torch/distributed/_shard/sharding_spec/_internals.py
45 27 torch/distributed/_shard/sharding_spec/api.py
42 34 torch/distributed/_shard/sharding_spec/chunk_sharding_spec.py
0 1 torch/distributed/_shard/sharding_spec/chunk_sharding_spec_ops/_common.py
0 1 torch/distributed/_shard/sharding_spec/chunk_sharding_spec_ops/embedding.py
0 1 torch/distributed/_shard/sharding_spec/chunk_sharding_spec_ops/embedding_bag.py
7 3 torch/distributed/_sharded_tensor/__init__.py
6 3 torch/distributed/_sharding_spec/__init__.py
4 11 torch/distributed/_tools/memory_tracker.py
1 3 torch/distributed/algorithms/__init__.py
10 3 torch/distributed/algorithms/_checkpoint/checkpoint_wrapper.py
0 1 torch/distributed/algorithms/_comm_hooks/__init__.py
26 13 torch/distributed/algorithms/_comm_hooks/default_hooks.py
13 9 torch/distributed/algorithms/_optimizer_overlap/optimizer_overlap.py
30 24 torch/distributed/algorithms/_quantization/quantization.py
6 6 torch/distributed/algorithms/ddp_comm_hooks/__init__.py
31 23 torch/distributed/algorithms/ddp_comm_hooks/ddp_zero_hook.py
14 11 torch/distributed/algorithms/ddp_comm_hooks/mixed_precision_hooks.py
18 14 torch/distributed/algorithms/ddp_comm_hooks/optimizer_overlap_hooks.py
2 3 torch/distributed/algorithms/ddp_comm_hooks/post_localSGD_hook.py
25 21 torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.py
14 11 torch/distributed/algorithms/join.py
11 9 torch/distributed/algorithms/model_averaging/averagers.py
16 5 torch/distributed/algorithms/model_averaging/hierarchical_model_averager.py
21 6 torch/distributed/algorithms/model_averaging/utils.py
10 9 torch/distributed/autograd/__init__.py
5 7 torch/distributed/benchmarks/benchmark_ddp_rpc.py
5 2 torch/distributed/c10d_logger.py
9 4 torch/distributed/collective_utils.py
4 2 torch/distributed/constants.py
353 122 torch/distributed/distributed_c10d.py
18 13 torch/distributed/elastic/agent/server/api.py
25 14 torch/distributed/elastic/agent/server/local_elastic_agent.py
2 0 torch/distributed/elastic/events/__init__.py
2 2 torch/distributed/elastic/events/api.py
3 3 torch/distributed/elastic/metrics/__init__.py
15 3 torch/distributed/elastic/metrics/api.py
1 1 torch/distributed/elastic/multiprocessing/__init__.py
54 19 torch/distributed/elastic/multiprocessing/api.py
10 4 torch/distributed/elastic/multiprocessing/errors/__init__.py
15 10 torch/distributed/elastic/multiprocessing/errors/error_handler.py
2 1 torch/distributed/elastic/multiprocessing/errors/handlers.py
4 3 torch/distributed/elastic/multiprocessing/tail_log.py
2 0 torch/distributed/elastic/rendezvous/api.py
8 7 torch/distributed/elastic/rendezvous/c10d_rendezvous_backend.py
32 13 torch/distributed/elastic/rendezvous/dynamic_rendezvous.py
19 11 torch/distributed/elastic/rendezvous/etcd_rendezvous.py
7 4 torch/distributed/elastic/rendezvous/etcd_rendezvous_backend.py
3 1 torch/distributed/elastic/rendezvous/etcd_store.py
7 3 torch/distributed/elastic/rendezvous/registry.py
2 2 torch/distributed/elastic/rendezvous/static_tcp_rendezvous.py
11 8 torch/distributed/elastic/rendezvous/utils.py
12 2 torch/distributed/elastic/timer/__init__.py
16 8 torch/distributed/elastic/timer/api.py
50 25 torch/distributed/elastic/timer/file_based_local_timer.py
3 2 torch/distributed/elastic/timer/local_timer.py
1 1 torch/distributed/elastic/utils/api.py
9 2 torch/distributed/elastic/utils/distributed.py
1 1 torch/distributed/launcher/__init__.py
8 4 torch/distributed/launcher/api.py
1 0 torch/distributed/nn/__init__.py
13 13 torch/distributed/nn/api/remote_module.py
16 5 torch/distributed/nn/functional.py
5 4 torch/distributed/optim/apply_optimizer_in_backward.py
2 1 torch/distributed/optim/functional_adadelta.py
1 0 torch/distributed/optim/functional_adagrad.py
1 0 torch/distributed/optim/functional_adam.py
1 0 torch/distributed/optim/functional_adamax.py
1 0 torch/distributed/optim/functional_adamw.py
1 0 torch/distributed/optim/functional_rmsprop.py
1 0 torch/distributed/optim/functional_rprop.py
1 0 torch/distributed/optim/functional_sgd.py
11 1 torch/distributed/optim/named_optimizer.py
1 1 torch/distributed/optim/optimizer.py
16 16 torch/distributed/optim/zero_redundancy_optimizer.py
1 0 torch/distributed/pipeline/__init__.py
1 1 torch/distributed/pipeline/sync/__init__.py
2 2 torch/distributed/pipeline/sync/_balance/__init__.py
3 1 torch/distributed/pipeline/sync/_balance/blockpartition.py
17 5 torch/distributed/pipeline/sync/_balance/profile.py
17 11 torch/distributed/pipeline/sync/batchnorm.py
66 17 torch/distributed/pipeline/sync/checkpoint.py
26 6 torch/distributed/pipeline/sync/copy.py
15 8 torch/distributed/pipeline/sync/microbatch.py
58 18 torch/distributed/pipeline/sync/pipe.py
45 11 torch/distributed/pipeline/sync/pipeline.py
6 1 torch/distributed/pipeline/sync/skip/layout.py
1 1 torch/distributed/pipeline/sync/skip/namespace.py
20 6 torch/distributed/pipeline/sync/skip/portal.py
14 8 torch/distributed/pipeline/sync/skip/skippable.py
19 5 torch/distributed/pipeline/sync/skip/tracker.py
14 4 torch/distributed/pipeline/sync/stream.py
5 4 torch/distributed/pipeline/sync/utils.py
30 6 torch/distributed/pipeline/sync/worker.py
7 10 torch/distributed/remote_device.py
22 10 torch/distributed/rendezvous.py
26 28 torch/distributed/rpc/__init__.py
4 4 torch/distributed/rpc/_testing/__init__.py
4 6 torch/distributed/rpc/_testing/faulty_agent_backend_registry.py
13 5 torch/distributed/rpc/_utils.py
68 52 torch/distributed/rpc/api.py
75 32 torch/distributed/rpc/backend_registry.py
2 1 torch/distributed/rpc/constants.py
2 0 torch/distributed/rpc/functions.py
3 1 torch/distributed/rpc/internal.py
1 0 torch/distributed/rpc/options.py
11 6 torch/distributed/rpc/rref_proxy.py
8 4 torch/distributed/rpc/server_process_global_profiler.py
31 16 torch/distributed/run.py
1 1 torch/distributed/tensor/parallel/__init__.py
10 3 torch/distributed/tensor/parallel/_utils.py
2 6 torch/distributed/tensor/parallel/api.py
2 2 torch/distributed/tensor/parallel/fsdp.py
9 3 torch/distributed/tensor/parallel/input_reshard.py
127 66 torch/distributed/tensor/parallel/style.py
28 12 torch/distributed/utils.py
178 55 torch/fft/__init__.py
8 9 torch/func/__init__.py
294 136 torch/functional.py
16 6 torch/futures/__init__.py
4 4 torch/fx/__init__.py
7 6 torch/fx/_compatibility.py
34 29 torch/fx/_symbolic_trace.py
10 7 torch/fx/annotate.py
10 8 torch/fx/experimental/accelerator_partitioner.py
6 1 torch/fx/experimental/const_fold.py
3 6 torch/fx/experimental/debug.py
133 68 torch/fx/experimental/graph_gradual_typechecker.py
14 6 torch/fx/experimental/merge_matmul.py
100 56 torch/fx/experimental/meta_tracer.py
170 85 torch/fx/experimental/migrate_gradual_types/constraint.py
378 150 torch/fx/experimental/migrate_gradual_types/constraint_generator.py
492 206 torch/fx/experimental/migrate_gradual_types/constraint_transformation.py
14 14 torch/fx/experimental/migrate_gradual_types/operation.py
147 51 torch/fx/experimental/migrate_gradual_types/transform_to_z3.py
8 2 torch/fx/experimental/migrate_gradual_types/util.py
11 10 torch/fx/experimental/migrate_gradual_types/z3_types.py
5 5 torch/fx/experimental/normalize.py
111 56 torch/fx/experimental/optimization.py
3 3 torch/fx/experimental/partitioner_utils.py
214 90 torch/fx/experimental/proxy_tensor.py
2 2 torch/fx/experimental/refinement_types.py
29 14 torch/fx/experimental/rewriter.py
55 21 torch/fx/experimental/schema_type_annotation.py
770 355 torch/fx/experimental/symbolic_shapes.py
2 2 torch/fx/experimental/unification/__init__.py
25 3 torch/fx/experimental/unification/core.py
1 0 torch/fx/experimental/unification/dispatch.py
18 11 torch/fx/experimental/unification/match.py
13 11 torch/fx/experimental/unification/more.py
6 2 torch/fx/experimental/unification/multipledispatch/__init__.py
37 21 torch/fx/experimental/unification/multipledispatch/conflict.py
7 5 torch/fx/experimental/unification/multipledispatch/core.py
88 68 torch/fx/experimental/unification/multipledispatch/dispatcher.py
5 5 torch/fx/experimental/unification/multipledispatch/utils.py
13 9 torch/fx/experimental/unification/multipledispatch/variadic.py
36 22 torch/fx/experimental/unification/unification_tools.py
7 5 torch/fx/experimental/unification/utils.py
5 2 torch/fx/experimental/unification/variable.py
4 1 torch/fx/experimental/unify_refinements.py
81 37 torch/fx/experimental/validator.py
466 305 torch/fx/graph.py
10 6 torch/fx/graph_module.py
105 49 torch/fx/interpreter.py
197 118 torch/fx/node.py
178 68 torch/fx/operator_schemas.py
13 11 torch/fx/passes/__init__.py
8 4 torch/fx/passes/backends/cudagraphs.py
57 15 torch/fx/passes/dialect/common/cse_pass.py
17 8 torch/fx/passes/fake_tensor_prop.py
78 38 torch/fx/passes/graph_drawer.py
9 7 torch/fx/passes/graph_manipulation.py
0 1 torch/fx/passes/infra/__init__.py
69 34 torch/fx/passes/infra/partitioner.py
6 2 torch/fx/passes/infra/pass_base.py
14 6 torch/fx/passes/infra/pass_manager.py
23 19 torch/fx/passes/net_min_base.py
29 16 torch/fx/passes/operator_support.py
46 16 torch/fx/passes/param_fetch.py
9 3 torch/fx/passes/pass_manager.py
162 87 torch/fx/passes/reinplace.py
35 20 torch/fx/passes/shape_prop.py
27 15 torch/fx/passes/split_module.py
64 44 torch/fx/passes/splitter_base.py
3 5 torch/fx/passes/tests/test_pass_manager.py
20 6 torch/fx/passes/tools_common.py
1 1 torch/fx/passes/utils/__init__.py
35 21 torch/fx/passes/utils/fuser_utils.py
94 46 torch/fx/passes/utils/matcher_utils.py
12 7 torch/fx/passes/utils/source_matcher_utils.py
170 95 torch/fx/proxy.py
72 32 torch/fx/subgraph_rewriter.py
12 6 torch/fx/tensor_type.py
16 6 torch/fx/traceback.py
170 92 torch/hub.py
87 46 torch/library.py
277 118 torch/linalg/__init__.py
15 15 torch/masked/__init__.py
49 48 torch/masked/_ops.py
72 39 torch/masked/maskedtensor/_ops_refs.py
17 12 torch/masked/maskedtensor/binary.py
32 15 torch/masked/maskedtensor/core.py
2 0 torch/masked/maskedtensor/creation.py
1 0 torch/masked/maskedtensor/reductions.py
10 10 torch/masked/maskedtensor/unary.py
1 0 torch/monitor/__init__.py
167 124 torch/nested/__init__.py
6 7 torch/nn/__init__.py
18 11 torch/nn/_reduction.py
1 0 torch/nn/backends/thnn.py
3 2 torch/nn/common_types.py
1029 388 torch/nn/functional.py
107 35 torch/nn/grad.py
71 35 torch/nn/init.py
29 29 torch/nn/intrinsic/__init__.py
29 27 torch/nn/intrinsic/modules/__init__.py
28 26 torch/nn/intrinsic/modules/fused.py
3 3 torch/nn/intrinsic/qat/modules/__init__.py
24 22 torch/nn/intrinsic/qat/modules/conv_fused.py
1 1 torch/nn/intrinsic/qat/modules/linear_fused.py
1 1 torch/nn/intrinsic/qat/modules/linear_relu.py
7 6 torch/nn/intrinsic/quantized/__init__.py
1 1 torch/nn/intrinsic/quantized/dynamic/modules/__init__.py
1 1 torch/nn/intrinsic/quantized/dynamic/modules/linear_relu.py
8 8 torch/nn/intrinsic/quantized/modules/__init__.py
3 4 torch/nn/intrinsic/quantized/modules/bn_relu.py
4 6 torch/nn/intrinsic/quantized/modules/conv_relu.py
1 1 torch/nn/intrinsic/quantized/modules/linear_relu.py
325 63 torch/nn/modules/__init__.py
66 35 torch/nn/modules/_functions.py
306 191 torch/nn/modules/activation.py
54 39 torch/nn/modules/adaptive.py
71 39 torch/nn/modules/batchnorm.py
5 5 torch/nn/modules/channelshuffle.py
155 99 torch/nn/modules/container.py
454 198 torch/nn/modules/conv.py
8 6 torch/nn/modules/distance.py
15 6 torch/nn/modules/dropout.py
28 17 torch/nn/modules/flatten.py
27 17 torch/nn/modules/fold.py
70 36 torch/nn/modules/instancenorm.py
43 17 torch/nn/modules/lazy.py
58 29 torch/nn/modules/linear.py
291 99 torch/nn/modules/loss.py
553 287 torch/nn/modules/module.py
81 47 torch/nn/modules/normalization.py
45 35 torch/nn/modules/padding.py
7 7 torch/nn/modules/pixelshuffle.py
285 98 torch/nn/modules/pooling.py
580 242 torch/nn/modules/rnn.py
152 63 torch/nn/modules/sparse.py
378 164 torch/nn/modules/transformer.py
46 20 torch/nn/modules/upsampling.py
5 6 torch/nn/modules/utils.py
17 6 torch/nn/parallel/__init__.py
34 25 torch/nn/parallel/_functions.py
36 15 torch/nn/parallel/comm.py
33 19 torch/nn/parallel/data_parallel.py
32 14 torch/nn/parallel/parallel_apply.py
37 13 torch/nn/parallel/replicate.py
23 10 torch/nn/parallel/scatter_gather.py
39 31 torch/nn/parameter.py
1 2 torch/nn/qat/__init__.py
3 7 torch/nn/qat/modules/__init__.py
1 3 torch/nn/qat/modules/conv.py
2 3 torch/nn/qat/modules/embedding_ops.py
4 5 torch/nn/quantizable/modules/__init__.py
1 2 torch/nn/quantizable/modules/rnn.py
32 34 torch/nn/quantized/__init__.py
22 15 torch/nn/quantized/_reference/modules/__init__.py
10 8 torch/nn/quantized/_reference/modules/conv.py
8 6 torch/nn/quantized/_reference/modules/rnn.py
1 2 torch/nn/quantized/_reference/modules/sparse.py
7 5 torch/nn/quantized/_reference/modules/utils.py
28 17 torch/nn/quantized/dynamic/modules/__init__.py
16 7 torch/nn/quantized/dynamic/modules/conv.py
22 11 torch/nn/quantized/dynamic/modules/rnn.py
81 54 torch/nn/quantized/modules/__init__.py
10 8 torch/nn/quantized/modules/activation.py
1 2 torch/nn/quantized/modules/batchnorm.py
17 10 torch/nn/quantized/modules/conv.py
1 1 torch/nn/quantized/modules/dropout.py
6 4 torch/nn/quantized/modules/embedding_ops.py
6 4 torch/nn/quantized/modules/functional_modules.py
2 3 torch/nn/quantized/modules/linear.py
14 6 torch/nn/quantized/modules/normalization.py
7 5 torch/nn/quantized/modules/utils.py
13 7 torch/nn/utils/__init__.py
11 5 torch/nn/utils/_deprecation_utils.py
2 2 torch/nn/utils/_expanded_weights/__init__.py
27 12 torch/nn/utils/_expanded_weights/conv_expanded_weights.py
136 38 torch/nn/utils/_expanded_weights/conv_utils.py
36 9 torch/nn/utils/_expanded_weights/embedding_expanded_weights.py
42 13 torch/nn/utils/_expanded_weights/expanded_weights_impl.py
70 30 torch/nn/utils/_expanded_weights/expanded_weights_utils.py
52 14 torch/nn/utils/_expanded_weights/group_norm_expanded_weights.py
53 15 torch/nn/utils/_expanded_weights/instance_norm_expanded_weights.py
44 18 torch/nn/utils/_expanded_weights/layer_norm_expanded_weights.py
25 9 torch/nn/utils/_expanded_weights/linear_expanded_weights.py
32 14 torch/nn/utils/_per_sample_grad.py
65 34 torch/nn/utils/clip_grad.py
16 9 torch/nn/utils/convert_parameters.py
45 12 torch/nn/utils/fusion.py
6 5 torch/nn/utils/init.py
12 4 torch/nn/utils/memory_format.py
114 61 torch/nn/utils/parametrizations.py
75 37 torch/nn/utils/parametrize.py
6 12 torch/nn/utils/prune.py
80 40 torch/nn/utils/rnn.py
98 46 torch/nn/utils/spectral_norm.py
28 18 torch/nn/utils/weight_norm.py
8 9 torch/optim/__init__.py
31 27 torch/optim/_functional.py
2 1 torch/optim/_multi_tensor/__init__.py
87 31 torch/optim/adadelta.py
46 17 torch/optim/adagrad.py
301 192 torch/optim/adam.py
78 29 torch/optim/adamax.py
128 54 torch/optim/adamw.py
73 26 torch/optim/asgd.py
77 75 torch/optim/lbfgs.py
560 317 torch/optim/lr_scheduler.py
295 177 torch/optim/nadam.py
202 113 torch/optim/optimizer.py
78 36 torch/optim/radam.py
93 32 torch/optim/rmsprop.py
75 32 torch/optim/rprop.py
166 102 torch/optim/sgd.py
44 31 torch/optim/sparse_adam.py
88 41 torch/optim/swa_utils.py
288 188 torch/overrides.py
58 26 torch/quasirandom.py
34 17 torch/random.py
6 3 torch/return_types.py
443 286 torch/serialization.py
1 3 torch/signal/__init__.py
11 11 torch/signal/windows/__init__.py
281 200 torch/signal/windows/windows.py
134 58 torch/sparse/__init__.py
692 272 torch/sparse/_triton_ops.py
14 20 torch/sparse/semi_structured.py
584 320 torch/special/__init__.py
442 233 torch/storage.py
497 143 torch/testing/_internal/autocast_test_lists.py
65 38 torch/testing/_internal/autograd_function_db.py
19 13 torch/testing/_internal/check_kernel_launches.py
126 47 torch/testing/_internal/common_cuda.py
415 199 torch/testing/_internal/common_device_type.py
77 47 torch/testing/_internal/common_distributed.py
69 12 torch/testing/_internal/common_dtype.py
165 86 torch/testing/_internal/common_jit.py
23031 12310 torch/testing/_internal/common_methods_invocations.py
5714 3477 torch/testing/_internal/common_modules.py
1752 1137 torch/testing/_internal/common_nn.py
9 8 torch/testing/_internal/common_pruning.py
709 363 torch/testing/_internal/common_quantization.py
80 21 torch/testing/_internal/common_quantized.py
41 27 torch/testing/_internal/common_subclass.py
1619 670 torch/testing/_internal/common_utils.py
206 121 torch/testing/_internal/composite_compliance.py
166 93 torch/testing/_internal/custom_op_db.py
0 1 torch/testing/_internal/data/network1.py
0 1 torch/testing/_internal/data/network2.py
7 2 torch/testing/_internal/dist_utils.py
7 3 torch/testing/_internal/distributed/_shard/sharded_tensor/__init__.py
7 6 torch/testing/_internal/distributed/_shard/sharded_tensor/_test_ops_common.py
5 15 torch/testing/_internal/distributed/_shard/sharded_tensor/_test_st_common.py
1 1 torch/testing/_internal/distributed/_tensor/common_dtensor.py
17 7 torch/testing/_internal/distributed/ddp_under_dist_autograd_test.py
129 94 torch/testing/_internal/distributed/distributed_test.py
11 7 torch/testing/_internal/distributed/distributed_utils.py
3 4 torch/testing/_internal/distributed/fake_pg.py
34 13 torch/testing/_internal/distributed/multi_threaded_pg.py
22 10 torch/testing/_internal/distributed/nn/api/remote_module_test.py
21 13 torch/testing/_internal/distributed/pipe_with_ddp_test.py
115 135 torch/testing/_internal/distributed/rpc/dist_autograd_test.py
3 1 torch/testing/_internal/distributed/rpc/dist_optimizer_test.py
8 12 torch/testing/_internal/distributed/rpc/examples/parameter_server_test.py
11 4 torch/testing/_internal/distributed/rpc/examples/reinforcement_learning_rpc_test.py
27 16 torch/testing/_internal/distributed/rpc/faulty_agent_rpc_test.py
9 8 torch/testing/_internal/distributed/rpc/faulty_rpc_agent_test_fixture.py
1 1 torch/testing/_internal/distributed/rpc/jit/dist_autograd_test.py
51 44 torch/testing/_internal/distributed/rpc/jit/rpc_test.py
8 6 torch/testing/_internal/distributed/rpc/jit/rpc_test_faulty.py
477 631 torch/testing/_internal/distributed/rpc/rpc_test.py
3 9 torch/testing/_internal/distributed/rpc/tensorpipe_rpc_agent_test_fixture.py
24 18 torch/testing/_internal/distributed/rpc_utils.py
28 12 torch/testing/_internal/hop_db.py
101 59 torch/testing/_internal/hypothesis_utils.py
15 9 torch/testing/_internal/inductor_utils.py
861 354 torch/testing/_internal/jit_metaprogramming_utils.py
240 121 torch/testing/_internal/jit_utils.py
63 25 torch/testing/_internal/logging_tensor.py
22 10 torch/testing/_internal/logging_utils.py
13 4 torch/testing/_internal/optests/__init__.py
56 22 torch/testing/_internal/optests/aot_autograd.py
1 1 torch/testing/_internal/optests/fake_tensor.py
2 1 torch/testing/_internal/optests/make_fx.py
1 0 torch/testing/_internal/quantization_torch_package_models.py
0 1 torch/testing/_internal/test_module/future_div.py
10 4 torch/torch_version.py
16 11 torch/types.py
15 7 torch/utils/__init__.py
13 8 torch/utils/_contextlib.py
12 10 torch/utils/_cpp_extension_versioner.py
8 3 torch/utils/_device.py
17 6 torch/utils/_foreach_utils.py
5 2 torch/utils/_mode_utils.py
2 1 torch/utils/_python_dispatch.py
3 0 torch/utils/_stats.py
43 16 torch/utils/_sympy/functions.py
31 25 torch/utils/_traceback.py
10 5 torch/utils/backcompat/__init__.py
74 34 torch/utils/backend_registration.py
43 26 torch/utils/benchmark/examples/blas_compare_setup.py
10 7 torch/utils/benchmark/examples/compare.py
19 10 torch/utils/benchmark/examples/fuzzer.py
17 8 torch/utils/benchmark/examples/op_benchmark.py
22 10 torch/utils/benchmark/examples/sparse/compare.py
22 14 torch/utils/benchmark/examples/sparse/fuzzer.py
35 12 torch/utils/benchmark/examples/sparse/op_benchmark.py
82 42 torch/utils/benchmark/examples/spectral_ops_fuzz_test.py
31 18 torch/utils/benchmark/op_fuzzers/binary.py
39 18 torch/utils/benchmark/op_fuzzers/sparse_binary.py
36 15 torch/utils/benchmark/op_fuzzers/sparse_unary.py
28 13 torch/utils/benchmark/op_fuzzers/spectral.py
31 17 torch/utils/benchmark/op_fuzzers/unary.py
3 0 torch/utils/benchmark/utils/_stubs.py
61 19 torch/utils/benchmark/utils/common.py
78 37 torch/utils/benchmark/utils/compare.py
84 38 torch/utils/benchmark/utils/compile.py
22 20 torch/utils/benchmark/utils/cpp_jit.py
43 29 torch/utils/benchmark/utils/fuzzer.py
23 10 torch/utils/benchmark/utils/sparse_fuzzer.py
53 33 torch/utils/benchmark/utils/timer.py
150 82 torch/utils/benchmark/utils/valgrind_wrapper/timer_interface.py
80 55 torch/utils/bottleneck/__main__.py
113 54 torch/utils/bundled_inputs.py
78 46 torch/utils/checkpoint.py
202 151 torch/utils/collect_env.py
1 0 torch/utils/cpp_backtrace.py
899 612 torch/utils/cpp_extension.py
59 57 torch/utils/data/__init__.py
4 2 torch/utils/data/_utils/__init__.py
109 28 torch/utils/data/_utils/collate.py
11 5 torch/utils/data/_utils/pin_memory.py
7 3 torch/utils/data/_utils/signal_handling.py
69 27 torch/utils/data/_utils/worker.py
5 2 torch/utils/data/backward_compatibility.py
351 221 torch/utils/data/dataloader.py
1 3 torch/utils/data/datapipes/__init__.py
58 30 torch/utils/data/datapipes/_decorator.py
64 32 torch/utils/data/datapipes/_hook_iterator.py
114 58 torch/utils/data/datapipes/_typing.py
4 5 torch/utils/data/datapipes/dataframe/__init__.py
2 1 torch/utils/data/datapipes/dataframe/dataframe_wrapper.py
77 54 torch/utils/data/datapipes/dataframe/dataframes.py
12 10 torch/utils/data/datapipes/dataframe/datapipes.py
4 2 torch/utils/data/datapipes/dataframe/structures.py
28 17 torch/utils/data/datapipes/datapipe.py
114 56 torch/utils/data/datapipes/gen_pyi.py
27 27 torch/utils/data/datapipes/iter/__init__.py
15 11 torch/utils/data/datapipes/iter/callable.py
21 17 torch/utils/data/datapipes/iter/combinatorics.py
105 40 torch/utils/data/datapipes/iter/combining.py
13 8 torch/utils/data/datapipes/iter/filelister.py
12 9 torch/utils/data/datapipes/iter/fileopener.py
49 30 torch/utils/data/datapipes/iter/grouping.py
13 9 torch/utils/data/datapipes/iter/routeddecoder.py
12 7 torch/utils/data/datapipes/iter/selecting.py
28 14 torch/utils/data/datapipes/iter/sharding.py
5 2 torch/utils/data/datapipes/iter/streamreader.py
4 1 torch/utils/data/datapipes/iter/utils.py
8 6 torch/utils/data/datapipes/map/__init__.py
4 3 torch/utils/data/datapipes/map/callable.py
11 8 torch/utils/data/datapipes/map/combinatorics.py
8 5 torch/utils/data/datapipes/map/combining.py
15 11 torch/utils/data/datapipes/map/grouping.py
4 1 torch/utils/data/datapipes/map/utils.py
55 26 torch/utils/data/datapipes/utils/common.py
38 19 torch/utils/data/datapipes/utils/decoder.py
9 4 torch/utils/data/datapipes/utils/snapshot.py
22 11 torch/utils/data/distributed.py
20 7 torch/utils/data/graph.py
32 14 torch/utils/data/graph_settings.py
84 26 torch/utils/data/sampler.py
25 21 torch/utils/dlpack.py
136 57 torch/utils/flop_counter.py
1 1 torch/utils/hipify/constants.py
1185 376 torch/utils/hipify/cuda_to_hip_mappings.py
408 216 torch/utils/hipify/hipify_python.py
1 1 torch/utils/hipify/version.py
64 27 torch/utils/hooks.py
24 9 torch/utils/jit/log_extract.py
55 40 torch/utils/mkldnn.py
75 42 torch/utils/mobile_optimizer.py
102 54 torch/utils/model_dump/__init__.py
1 0 torch/utils/model_dump/__main__.py
1 1 torch/utils/model_zoo.py
14 13 torch/utils/show_pickle.py
3 1 torch/utils/tensorboard/__init__.py
6 5 torch/utils/tensorboard/_caffe2_graph.py
1 0 torch/utils/tensorboard/_convert_np.py
6 3 torch/utils/tensorboard/_embedding.py
2 2 torch/utils/tensorboard/_onnx_graph.py
2 1 torch/utils/tensorboard/_proto_graph.py
3 3 torch/utils/tensorboard/_pytorch_graph.py
1 1 torch/utils/tensorboard/_utils.py
12 3 torch/utils/tensorboard/summary.py
8 3 torch/utils/tensorboard/writer.py
23 17 torch/utils/throughput_benchmark.py
88 43 torch/utils/viz/_cycles.py
26 10 torch/utils/weak.py
3 9 torch/xpu/_gpu_trace.py
'''
trie = {}
for line in output.strip().split('\n'):
additions, removals, file_path = line.split('\t')
additions = int(additions)
removals = int(removals)
changes = additions + removals
directories = file_path.split('/')
node = trie
for d in directories:
node = node.setdefault(d, {})
node.setdefault('_', 0)
node['_'] += changes
def go(threshold, node, path):
changes = node.get('_')
if changes is not None and changes < threshold:
# print(f"{changes}\t{'/'.join(path)}")
return 1
else:
r = 0
for k, v in node.items():
if k == '_':
continue
r += go(threshold, v, path + [k])
return r
thresholds = []
data = []
for i in range(1000, 200000, 500):
thresholds.append(i)
data.append(go(i, trie, []))
plt.figure(figsize=(8, 6))
plt.plot(thresholds, data)
plt.xlabel('Threshold')
plt.ylabel('Chunk')
plt.title('Line Chart')
plt.grid(True)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment