Skip to content

Commit 9199468

Browse files
ezyangpytorchmergebot
authored andcommitted
Properly trace into mark_static (#120232)
Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: #120232 Approved by: https://github.com/yanboliang
1 parent d38a362 commit 9199468

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

test/dynamo/test_unspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def fn(x):
273273
comptime.assert_static(x.size(0))
274274
return x + 1
275275

276-
opt_fn = torch.compile(fn, dynamic=True)
276+
opt_fn = torch.compile(fn, dynamic=True, fullgraph=True)
277277
opt_fn(torch.randn(12, 23))
278278

279279
def test_shape_graph_break(self):

torch/_dynamo/trace_rules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
"torch._C._functorch._add_batch_dim": TorchInGraphFunctionVariable,
188188
"torch._C._functorch._remove_batch_dim": TorchInGraphFunctionVariable,
189189
"torch._C._functorch.is_batchedtensor": TorchInGraphFunctionVariable,
190+
"torch._dynamo.mark_static": UserFunctionVariable,
190191
}
191192

192193

0 commit comments

Comments
 (0)