8000 [dynamo, nested graph breaks] refactor codegen to minimize NULL codegen'ing by williamwen42 · Pull Request #153510 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[dynamo, nested graph breaks] refactor codegen to minimize NULL codegen'ing #153510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[dynamo] refactor codegen to minimize NULL codegen'ing
[ghstack-poisoned]
  • Loading branch information
williamwen42 committed May 14, 2025
commit 178685b912e3e6c4395598270127915a7468357b
16 changes: 0 additions & 16 deletions torch/_dynamo/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,22 +507,6 @@ def rot_n(self, n):
create_instruction("UNPACK_SEQUENCE", arg=n),
]

def pop_null(self):
# POP_TOP doesn't work for null, so we pop nulls by pushing in a
# nop function, calling it (which consumes the null), and popping the result.
assert sys.version_info >= (3, 11)
return [
self.create_load_const_unchecked(lambda: None),
# 3.13 swapped NULL and callable
*(
(create_instruction("SWAP", arg=2),)
if sys.version_info >= (3, 13)
else ()
),
*create_call_function(0, False),
create_instruction("POP_TOP"),
]

def pop_top(self):
self.append_output(create_instruction("POP_TOP"))

Expand Down
Loading
Loading
0