pytorch/torch/_dynamo
Edward Z. Yang a6630bcf87 Profile guided optimization for automatic_dynamic (#139001)
Previously: https://github.com/pytorch/pytorch/pull/138052 but the implementation is done from scratch, so I open a new PR.

This implements the ability to save and load profiles of automatic dynamic decisions, so on subsequent runs we can directly make something automatically dynamic. Unlike the previous implementation, this cache is never enabled by default; instead, you have to specify a "job id" that says it's OK to share results. We will be able to automatically populate this id for internal MAST jobs but for generic OSS users you will have to explicitly opt into it.

Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Differential Revision: [D65065497](https://our.internmc.facebook.com/intern/diff/D65065497)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/139001
Approved by: https://github.com/oulgen
2024-11-01 21:43:25 +00:00
..
backends Made DDPOptimizer work with HOPs (#138787) 2024-10-25 18:59:01 +00:00
polyfills [Dynamo] Add itertools.compress() support (#139061) 2024-10-29 10:25:55 +00:00
repro Add option to save real tensors in TORCH_COMPILE_DEBUG repro (#138110) 2024-10-28 16:18:22 +00:00
variables [invoke_subgraph] Generate fake_inputs correctly (#139130) 2024-11-01 21:02:32 +00:00
__init__.py Profile guided optimization for automatic_dynamic (#139001) 2024-11-01 21:43:25 +00:00
_trace_wrapped_higher_order_op.py
bytecode_analysis.py
bytecode_transformation.py Revert "[dynamo, 3.13] fix bytecode nop tests (#139323)" 2024-10-31 23:34:00 +00:00
cache_size.py [dynamo][refactor][config-cleanp] Use guard_manager consistently instead of check_fn (#138896) 2024-10-26 15:14:46 +00:00
callback.py
code_context.py
codegen.py Have as_tensor always return a float64 tensor in dynamo (#138598) 2024-10-24 20:50:28 +00:00
compiled_autograd.py support nesting of suppress_guards, suppress guards when generated compiled autograd graph (#138968) 2024-10-31 00:13:39 +00:00
comptime.py
config.py Profile guided optimization for automatic_dynamic (#139001) 2024-11-01 21:43:25 +00:00
convert_frame.py Profile guided optimization for automatic_dynamic (#139001) 2024-11-01 21:43:25 +00:00
create_parameter_op.py
current_scope_id.py
debug_utils.py
decorators.py
device_interface.py
distributed.py
eval_frame.py [dynamo] ignore False/None callback in fail_on_recompile/force_backend stances (#139215) 2024-11-01 06:15:28 +00:00
exc.py [tlparse] Add dynamo_graph_break_reason logging to trace_structured (#138778) 2024-10-25 02:00:04 +00:00
external_utils.py
funcname_cache.py
guards.py Revert "[dynamo] Fix constant propagation in builtins and UserClasses (#131354)" 2024-11-01 00:13:20 +00:00
hooks.py
logging.py Make automatic_dynamic state live per CodeId, rather than on code object (#138740) 2024-10-27 03:08:41 +00:00
mutation_guard.py Allow Lazy Module to be modelled as UnspecializedNNModuleVariable (#138639) 2024-10-26 02:17:07 +00:00
output_graph.py Add option to dynamo_timed and chromium_event_logger for logging pt2 compile events (#139309) 2024-11-01 02:40:25 +00:00
pgo.py Profile guided optimization for automatic_dynamic (#139001) 2024-11-01 21:43:25 +00:00
profiler.py
replay_record.py
resume_execution.py
side_effects.py [dynamo] Remove mutable_local.source and index on VariableTracker rather than MutableLocalBase (#137905) 2024-10-18 20:20:42 +00:00
source.py [Dynamo] Disable torch function compilation during guard execution and in compiled bytecode (#137669) 2024-10-19 04:12:45 +00:00
symbolic_convert.py Refactor core algorithm for automatic dynamic shapes (#138717) 2024-10-27 03:08:41 +00:00
tensor_version_op.py
test_case.py
test_minifier_common.py config: simplify most of the config handling and fix some bugs (#138377) 2024-10-22 13:40:26 +00:00
testing.py [dynamo][refactor][config-cleanp] Use guard_manager consistently instead of check_fn (#138896) 2024-10-26 15:14:46 +00:00
trace_rules.py fix dynamo tracking numpy 2 ops (#138686) 2024-11-01 19:51:40 +00:00
types.py [dynamo][refactor][config-cleanp] Use guard_manager consistently instead of check_fn (#138896) 2024-10-26 15:14:46 +00:00
utils.py Add option to dynamo_timed and chromium_event_logger for logging pt2 compile events (#139309) 2024-11-01 02:40:25 +00:00