[Dynamo][Better Engineering] Add typing for comptime, cache, and convert_frame #158379
[Dynamo][Better Engineering] Add typing for comptime, cache, and convert_frame #158379Lucaskabela wants to merge 1 commit intomainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/158379
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 42eb33f with merge base 16b21fa ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
torch/_dynamo/convert_frame.py
Outdated
|
|
||
|
|
||
| @TorchPatcher.suppress_torch_distributed_warnings | ||
| @TorchPatcher.suppress_torch_distributed_warnings # type: ignore[misc] |
There was a problem hiding this comment.
This error should go away once we land #158276 but we need to add to avoid race conditions for now
|
@pytorchbot label "topic: not user facing" |
930dda2 to
42eb33f
Compare
| constraints: Optional[list[Constraint]] = None, | ||
| **extra_kwargs: Any, | ||
| ) -> Callable[[tuple[Any, Any]], ExportResult]: | ||
| ) -> Callable[..., ExportResult]: |
There was a problem hiding this comment.
tuple[Any, Any] isn't quite right since truly this is args and kwargs; for now we can use the less restrictive ... here
|
@pytorchmergebot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
As part of better engineering week, we would like to improve out type support to improve dev experience in dynamo
This PR adds strict typing support to a critical tracing point for dynamo, primarily for
comptime.pybut alsocache_size.pyandconvert_frame.py.Running
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames