pytorch/torch/_dynamo
Kasperi Apell a7915c56f6 Propagate callable parameter types using ParamSpec (#142306) (#143797)
The codebase has a few locations where callable parameter type information is lost when the unpackings *args and **kwargs are typed as Any. Refactor these instances to retain type information using typing_extensions.ParamSpec.

Also, in these functions, enforce return type with TypeVar.

Addresses #142306

Pull Request resolved: https://github.com/pytorch/pytorch/pull/143797
Approved by: https://github.com/Skylion007

Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com>
Co-authored-by: Xuehai Pan <XuehaiPan@outlook.com>
2024-12-29 23:03:14 +00:00
..
backends
polyfills
repro
variables [dynamo] Remove HFPretrained config hack (#143698) 2024-12-28 02:03:13 +00:00
__init__.py [ca] add graph id (#141906) 2024-12-14 03:02:06 +00:00
_trace_wrapped_higher_order_op.py
bytecode_analysis.py
bytecode_transformation.py dynamo tracing perf: cache cleaned_instructions: 33.7 -> 30.0 (#143070) 2024-12-26 19:02:08 +00:00
cache_size.py Rename cache limit to recompile limit in configs (#143709) 2024-12-22 10:03:57 +00:00
callback.py
code_context.py
codegen.py Add support for contextmanager in Dynamo (#136033) 2024-12-20 12:02:20 +00:00
compiled_autograd.py [compiled autograd] log compilation time to perfetto (#140964) 2024-12-21 04:23:25 +00:00
comptime.py
config.py Rename cache limit to recompile limit in configs (#143709) 2024-12-22 10:03:57 +00:00
convert_frame.py [dynamo] Shorten tracebacks for backend compiler errors (#143552) 2024-12-24 21:48:23 +00:00
create_parameter_op.py
current_scope_id.py
debug_utils.py
decorators.py [Dynamo] only import einops if version is lower than 0.7.0 (#142847) 2024-12-20 07:46:49 +00:00
device_interface.py [Dynamo] Add MPSDevice interface (#143891) 2024-12-27 20:31:44 +00:00
distributed.py
eval_frame.py [dynamo] Shorten tracebacks for backend compiler errors (#143552) 2024-12-24 21:48:23 +00:00
exc.py [dynamo] Add types to exc.py (#143626) 2024-12-24 21:48:32 +00:00
external_utils.py Propagate callable parameter types using ParamSpec (#142306) (#143797) 2024-12-29 23:03:14 +00:00
funcname_cache.py
graph_deduplication.py [Dynamo] check node class first for graph dedup (#143609) 2024-12-20 04:09:46 +00:00
graph_region_tracker.py [Dynamo] topologically sort duplicated graph regions (#143523) 2024-12-19 00:43:48 +00:00
guards.py [dynamo] Remove dead code after introducing UserDefinedDictVariable (#143699) 2024-12-27 04:51:35 +00:00
hooks.py
logging.py
metrics_context.py add some logging for tensorify (#143391) 2024-12-19 20:06:26 +00:00
mutation_guard.py
output_graph.py [dynamo] Shorten tracebacks for backend compiler errors (#143552) 2024-12-24 21:48:23 +00:00
pgo.py pgo: Log feature use (#142819) 2024-12-20 20:22:20 +00:00
profiler.py
replay_record.py
resume_execution.py [dynamo] implement framelocals mapping as c++ object (#140063) 2024-12-17 18:54:27 +00:00
side_effects.py [dynamo] Remove dead code after introducing UserDefinedDictVariable (#143699) 2024-12-27 04:51:35 +00:00
source.py [dynamo] Make ConstDictKeySource a subclass of ChainedSource (#143924) 2024-12-28 05:59:45 +00:00
symbolic_convert.py dynamo tracing perf: import_module: 59.92 -> 52.9 (#143057) 2024-12-22 06:38:38 +00:00
tensor_version_op.py
test_case.py
test_minifier_common.py
testing.py Propagate callable parameter types using ParamSpec (#142306) (#143797) 2024-12-29 23:03:14 +00:00
trace_rules.py [ARM][feat]: Add 4 bit dynamic quantization matmuls & KleidiAI Backend (#134124) 2024-12-20 19:32:03 +00:00
types.py
utils.py [dynamo] Remove DICT_SUBCLASS_GUARD_MANAGER and use dict.keys (#143722) 2024-12-27 04:51:35 +00:00