pytorch/torch/_dynamo
Colin L Reliability Rice 98a488c9aa Start recording inductor provenance (#162669)
Summary:
This stores information on where fx graphs come from, which makes it
significantly easier to debug.

One outstanding question

1) I only stored the kernel stack traces, do we also want the node mappings?

Test Plan:
I wrote a explicit logging test which makes a module, fx traces it, compiles it, and makes sure the logging infomration shows up.

```
clr@devvm17763 ~/fbsource/fbcode/caffe2/test/dynamo
 % buck2 test @//mode/opt fbcode//caffe2/test/dynamo:test_dynamo -- test_utils

File changed: fbsource//xplat/caffe2/test/dynamo/test_utils.py
File changed: fbcode//caffe2/test/dynamo/test_utils.py
Buck UI: https://www.internalfb.com/buck2/528dea32-2416-4a62-a1ec-39f3c0efdd2e
Test UI: https://www.internalfb.com/intern/testinfra/testrun/13229324015574003
Network: Up: 0B  Down: 0B
Executing actions. Remaining     0/2
Command: test.
Time elapsed: 17.3s
Tests finished: Pass 16. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Rollback Plan:

Differential Revision: D82037582

Pull Request resolved: https://github.com/pytorch/pytorch/pull/162669
Approved by: https://github.com/yushangdi
2025-10-16 23:05:31 +00:00
..
backends Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
polyfills do not overguard when comparing lists (#165091) 2025-10-11 20:37:51 +00:00
repro Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
variables [RFC] Add pyrefly to lintrunner (#165179) 2025-10-16 20:07:09 +00:00
__init__.py [dynamo, nested graph breaks] fix nested step graph break related issues (#162737) 2025-10-08 22:02:52 +00:00
_trace_wrapped_higher_order_op.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
aot_compile.py [precompile] Fix frame construction for wrapped model. (#165454) 2025-10-15 02:01:46 +00:00
bytecode_analysis.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
bytecode_transformation.py [dynamo, nested graph breaks] fix nested step graph break related issues (#162737) 2025-10-08 22:02:52 +00:00
cache_size.py [Dynamo][Better Engineering] Add typing for comptime, cache, and convert_frame (#158379) 2025-07-18 02:11:57 +00:00
callback.py increment pending_callbacks_counter before initation the pt2 compile callbacks (#157185) 2025-06-30 01:23:59 +00:00
code_context.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
codegen.py Enable ruff rule E721 (#165162) 2025-10-13 01:48:55 +00:00
compiled_autograd.py [Fix] Adding missing f prefixes to formatted strings [1/N] (#164065) 2025-09-29 04:53:00 +00:00
comptime.py [Dynamo][Better Engineering] Add typing for comptime, cache, and convert_frame (#158379) 2025-07-18 02:11:57 +00:00
config.py dynamo configs to torch.compiler (#163517) 2025-10-14 22:44:53 +00:00
convert_frame.py [precompile] Fix frame construction for wrapped model. (#165454) 2025-10-15 02:01:46 +00:00
create_parameter_op.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
current_scope_id.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
debug_utils.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
decorators.py [dynamo, nested graph breaks] fix nested step graph break related issues (#162737) 2025-10-08 22:02:52 +00:00
device_interface.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
distributed.py Implement guard collectives (optimized version) (#156562) 2025-06-24 04:59:49 +00:00
eval_frame.py [export] Turn on install_free_tensors flag (#164691) 2025-10-14 15:33:50 +00:00
exc.py [dynamo, nested graph breaks] fix nested step graph break related issues (#162737) 2025-10-08 22:02:52 +00:00
external_utils.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
funcname_cache.py gracefully handle tokenize.TokenError in funcname parser. Adds support for non-Python source (#148737) 2025-03-11 19:49:28 +00:00
functional_export.py [export] Turn on install_free_tensors flag (#164691) 2025-10-14 15:33:50 +00:00
graph_break_hints.py [dynamo] unimplemented -> unimplemented_v2 in variables/builder.py (#151044) 2025-04-11 09:07:01 +00:00
graph_break_registry.json [Bugfix][Dynamo] Fix Sparse tensors by graph break in Dynamo (#164873) 2025-10-16 15:06:20 +00:00
graph_bytecode_inputs.py [user-cuda-streams] Pass streams/events to the graph via lookup table (#162899) 2025-10-14 05:43:19 +00:00
graph_deduplication.py Helper to augment graph with additional deps (#163959) 2025-09-30 04:53:58 +00:00
graph_region_tracker.py Add split-K control to cuBLAS reduced-precision settings (#164766) 2025-10-08 18:48:45 +00:00
graph_utils.py [Intel GPU][pre_compile] Add XPU toolkit version and hardware info in compiled model check. (#162951) 2025-09-18 00:04:22 +00:00
guards.py [dynamo, guards] Better error messages when generated guard fails on the same frame (#165242) 2025-10-16 01:05:31 +00:00
hooks.py Replace frame_traced_fn hook with get_traced_code() util (#155249) 2025-06-10 22:40:58 +00:00
logging.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
metrics_context.py Optimize dynamo typing (#147499) 2025-08-25 13:20:45 +00:00
mutation_guard.py Revert "[dynamo][executorch] Do not trace into exeuctorch LoweredBackendModule (#165126)" 2025-10-10 19:21:41 +00:00
output_graph.py [user-cuda-streams] Pass streams/events to the graph via lookup table (#162899) 2025-10-14 05:43:19 +00:00
package.py Megacache integration (#163533) 2025-10-15 22:49:15 +00:00
pgo.py [PGO] log missing sources in allowlist (#164881) 2025-10-09 04:39:09 +00:00
precompile_context.py Support partial _DynamoCacheEntries when not all backends available (#163521) 2025-10-03 16:14:32 +00:00
profiler.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
replay_record.py [Dynamo][Better Engineering] Type coverage for torch/_dynamo/utils.py (#159580) 2025-08-04 21:51:53 +00:00
resume_execution.py [dynamo, nested graph breaks] fix nested step graph break related issues (#162737) 2025-10-08 22:02:52 +00:00
side_effects.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
source.py [dynamo, 3.14] fix BUILD_TUPLE with 0 args (#163818) 2025-09-30 17:42:40 +00:00
symbolic_convert.py [Dynamo][Logging] Add sources/types to LazyVariableTracker logging (#165402) 2025-10-15 23:23:09 +00:00
tensor_version_op.py [Dynamo][Better Engineering] Type devices, resume_execution and testing utils (#158593) 2025-07-18 18:22:06 +00:00
test_case.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
test_dont_skip_tracing_functions.py [dynamo] context manager/decorator for dynamo config patching during tracing (#150586) 2025-04-23 09:12:13 +00:00
test_minifier_common.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
testing.py [dynamo][logging] Add most recent bytecode to graph break with torch._dynamo.graph_break() and verbose (#164422) 2025-10-10 17:33:06 +00:00
trace_rules.py [dynamo][trace_rules] Add ao.quantization (#165069) 2025-10-09 23:08:42 +00:00
types.py Implement guard collectives (optimized version) (#156562) 2025-06-24 04:59:49 +00:00
utils.py Start recording inductor provenance (#162669) 2025-10-16 23:05:31 +00:00