Skip to content

[invoke_subgraph] Support integer outputs in the subgraph#160777

Closed
anijain2305 wants to merge 1 commit intogh/anijain2305/850/basefrom
gh/anijain2305/850/head
Closed

[invoke_subgraph] Support integer outputs in the subgraph#160777
anijain2305 wants to merge 1 commit intogh/anijain2305/850/basefrom
gh/anijain2305/850/head

Conversation

@anijain2305
Copy link
Contributor

@anijain2305 anijain2305 commented Aug 15, 2025

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Aug 15, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/160777

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit a425e3d with merge base fa75ba9 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

anijain2305 added a commit that referenced this pull request Aug 15, 2025
@anijain2305 anijain2305 added ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category labels Aug 15, 2025
ref[0].sum().backward()
res[0].sum().backward()
self.assertEqual(x.grad, x_clone.grad)

Copy link
Contributor

@zou3519 zou3519 Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. symints should be allowed to be outputs of the graph
  2. any non-symbolic expressions (constants) should not be outputs of the graph. Instead, Dynamo should figure out how to propagate them along.

For example, if there's a function like the following:

def f(x):
    return x.sin(), 1

then the subgraph should just look like the following:

def subgraph(x):
    return torch.ops.aten.sin.default(x)

This is to avoid giving Inductor and/or AOTAutograd anything that looks crazy (a constant that they can't handle)

@anijain2305
Copy link
Contributor Author

Closing in favor of #161354

@github-actions github-actions bot deleted the gh/anijain2305/850/head branch September 23, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants