Skip to content

Commit

Permalink
fix dynamo.explain examples (#122745)
Browse files Browse the repository at this point in the history
Summary:
`dynamo.explain()` was updated to return a structure but the docs weren't updated to match.

- Update the docs to use the new API
- Remove some dead code left when `explain` was updated.
- Drive-by: Fix some `nopython` uses that I noticed
- Drive-by: I noticed an ignored error coming from CleanupHook on shutdown - make it check the global before setting it.

Fixes #122573

X-link: pytorch/pytorch#122745
Approved by: https://github.com/jansel

Reviewed By: atalman

Differential Revision: D55485698

Pulled By: aorenste

fbshipit-source-id: fe308dc169cfc8b88d1bb62b393e1f80eb95a9a5
  • Loading branch information
aorenste authored and facebook-github-bot committed Mar 29, 2024
1 parent a8c41ab commit f26ff42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,9 @@ class CleanupHook:
name: str

def __call__(self, *args):
CleanupManager.count -= 1
# Make sure we're not shutting down
if CleanupManager is not None:
CleanupManager.count -= 1
del self.scope[self.name]

@staticmethod
Expand Down

0 comments on commit f26ff42

Please sign in to comment.