Skip to content

Conversation

tugsbayasgalan
Copy link
Contributor

@tugsbayasgalan tugsbayasgalan commented Aug 29, 2024

Stack from ghstack (oldest at bottom):

Subset of changes in #132901, can't land the previous one because it is too complicated. Rest of the change will be implemented as follow up after export design meeting. This part just makes the training IR -> inference IR decomp to have the same path as normal export.

Differential Revision: D62000525

Copy link

pytorch-bot bot commented Aug 29, 2024

🔗 Helpful Links

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

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

✅ You can merge normally! (9 Unrelated Failures)

As of commit e85a235 with merge base 195ac85 (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

tugsbayasgalan added a commit that referenced this pull request Aug 29, 2024
ghstack-source-id: cfffa47
Pull Request resolved: #134801
tugsbayasgalan added a commit that referenced this pull request Aug 29, 2024
ghstack-source-id: 430aa46
Pull Request resolved: #134801
@tugsbayasgalan
Copy link
Contributor Author

@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@tugsbayasgalan
Copy link
Contributor Author

@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Subset of changes in #132901, can't land the previous one because it is too complicated. Rest of the change will be implemented as follow up after export design meeting. This part just makes the training IR -> inference IR decomp to have the same path as normal export. 

Differential Revision: [D62000525](https://our.internmc.facebook.com/intern/diff/D62000525)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

fake_val = node.meta["val"]
if fake_val is not None and isinstance(fake_val, torch.Tensor):
fake_vals.append(fake_val)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this makes sense, but could you explain what prompted the change? The previous implementation seemed equivalent, and only required one loop right?

node.meta[k] = v
_populate_param_buffer_metadata_to_new_gm(
params_buffers_to_node_meta, gm, export_graph_signature
)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

return gm, new_graph_signature


def _remove_unneccessary_copy_op_pass(
Copy link
Contributor

Choose a reason for hiding this comment

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

noob question: why is this op special?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is because ep.module() adds copy_ nodes in the end to update the buffers. When we retrace, we functionalize these nodes and they will show up as extra nodes in the end. We actually don't need it because aot_export_module will take care of returning extra updated buffers.

Subset of changes in #132901, can't land the previous one because it is too complicated. Rest of the change will be implemented as follow up after export design meeting. This part just makes the training IR -> inference IR decomp to have the same path as normal export. 

Differential Revision: [D62000525](https://our.internmc.facebook.com/intern/diff/D62000525)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

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

tugsbayasgalan added a commit that referenced this pull request Sep 3, 2024
Pull Request resolved: #134801




@imported-using-ghimport

Differential Revision: [D62000525](https://our.internmc.facebook.com/intern/diff/D62000525/)
ghstack-source-id: 240844924
Subset of changes in #132901, can't land the previous one because it is too complicated. Rest of the change will be implemented as follow up after export design meeting. This part just makes the training IR -> inference IR decomp to have the same path as normal export. 

Differential Revision: [D62000525](https://our.internmc.facebook.com/intern/diff/D62000525)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

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

tugsbayasgalan added a commit that referenced this pull request Sep 4, 2024
Pull Request resolved: #134801




@imported-using-ghimport

Differential Revision: [D62000525](https://our.internmc.facebook.com/intern/diff/D62000525/)
ghstack-source-id: 240909553
Subset of changes in #132901, can't land the previous one because it is too complicated. Rest of the change will be implemented as follow up after export design meeting. This part just makes the training IR -> inference IR decomp to have the same path as normal export. 

Differential Revision: [D62000525](https://our.internmc.facebook.com/intern/diff/D62000525)

[ghstack-poisoned]
@tugsbayasgalan
Copy link
Contributor Author

@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@avikchaudhuri avikchaudhuri left a comment

Choose a reason for hiding this comment

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

lgtm after discussing offline

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 4, 2024
# When aot_export lifts the params, we lose metadata (e.g. source_fn_stack, stack_trace)
# from the param nodes as they are treated as fresh inputs
# Therefore, we manually extract them before calling into aot_export
# params_buffers_to_node_meta = _collect_param_buffer_metadata(gm_torch_level)
Copy link
Contributor

Choose a reason for hiding this comment

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

delete?

@tugsbayasgalan
Copy link
Contributor Author

@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge -f 'Landed internally'

(Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

@facebook-github-bot
Copy link
Contributor

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

enter-ctrl9 pushed a commit to enter-ctrl9/pytorch11 that referenced this pull request Sep 15, 2024
Pull Request resolved: pytorch/pytorch#134801

@imported-using-ghimport

Differential Revision: [D62000525](https://our.internmc.facebook.com/intern/diff/D62000525/)
ghstack-source-id: 15a3e01
Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Sep 20, 2024
Subset of changes in pytorch#132901, can't land the previous one because it is too complicated. Rest of the change will be implemented as follow up after export design meeting. This part just makes the training IR -> inference IR decomp to have the same path as normal export.

Differential Revision: [D62000525](https://our.internmc.facebook.com/intern/diff/D62000525)
Pull Request resolved: pytorch#134801
Approved by: https://github.com/avikchaudhuri, https://github.com/angelayi
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 fb-exported Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants