Skip to content

Commit e6858d6

Browse files
committed
Update on "aot autograd: dont allow symint outputs to get tangents in the bw graph"
Previously, if dynamic shapes were turned on and we had a forward graph that returns a symint, then we would generate a backward graph that takes in a tangent input for that symint fwd output. This causes problems for downstream - inductor will see an input that it expects to be a symint, but it gets a `None` from autograd. Confirmed that this repro now passes: ``` benchmarks/dynamo/torchbench.py --devices cuda --inductor --dynamic-shapes --unspecialize-int --accuracy --training --only drq ``` cc anijain2305 [ghstack-poisoned]
1 parent bc38b81 commit e6858d6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test/functorch/test_aotdispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@ def f(a, b, c, d):
20922092
bw_graph = bw_graph_cell[0]
20932093

20942094
self.assertEqual(get_num_ins_outs(fw_graph), (4, 13))
2095-
self.assertEqual(get_num_ins_outs(bw_graph), (12, 4))
2095+
self.assertEqual(get_num_ins_outs(bw_graph), (10, 4))
20962096
_, fw_graph_out_nodes = get_ins_outs(fw_graph)
20972097
self.assertEqual(
20982098
# fw outputs include b.size() which expands to 2 symints,

0 commit comments

Comments
 (0)