KEMBAR78
dynamic_shapes + retrace exported program by avikchaudhuri · Pull Request #110276 · pytorch/pytorch · GitHub
Skip to content

Conversation

@avikchaudhuri
Copy link
Contributor

@avikchaudhuri avikchaudhuri commented Sep 29, 2023

An ExportedProgram's __call__ signature is different from the original module, so dynamic_shapes that follow the original signature would fail when applied to re-export an ExportedProgram.

This PR fixes this issue, in other words, the original dynamic_shapes should now work when re-exporting.

Differential Revision: D49764011

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 29, 2023

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 21be12a with merge base acac92f (image):

NEW FAILURE - The following job has failed:

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

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49764011

Summary: Pull Request resolved: pytorch#110276

Test Plan: modified test

Differential Revision: D49764011
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49764011

import inspect
signature = inspect.signature(f.forward) if isinstance(f, torch.nn.Module) else inspect.signature(f)
combined_args = signature.bind(*args, **kwargs).arguments
if isinstance(f, ExportedProgram):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

main change here

from typing import get_origin, get_args

def assoc_zip(combined_args, dynamic_shapes):
def tree_zip(combined_args, dynamic_shapes):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ignore this part, it has nothing to do with this PR. Just cleaning up.

@avikchaudhuri avikchaudhuri added the release notes: fx release notes category label Sep 29, 2023
@avikchaudhuri
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 29, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-focal-rocm5.6-py3.8 / test (default, 1, 3, linux.rocm.gpu)

Details for Dev Infra team Raised by workflow job

@avikchaudhuri
Copy link
Contributor Author

@pytorchbot merge -i "unrelated IO failure"

@avikchaudhuri
Copy link
Contributor Author

@pytorchbot merge -i

@pytorch pytorch deleted a comment from pytorch-bot bot Sep 29, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 1 checks: trunk / linux-focal-rocm5.6-py3.8 / test (default, 1, 3, linux.rocm.gpu)

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged release notes: fx release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants