Skip to content

Add support for exit layer (#18541)#18541

Merged
meta-codesync[bot] merged 1 commit intopytorch:mainfrom
lucylq:export-D96844228
Mar 31, 2026
Merged

Add support for exit layer (#18541)#18541
meta-codesync[bot] merged 1 commit intopytorch:mainfrom
lucylq:export-D96844228

Conversation

@lucylq
Copy link
Copy Markdown
Contributor

@lucylq lucylq commented Mar 27, 2026

Summary:

Add

Reviewed By: billmguo, kimishpatel

Differential Revision: D96844228

Copilot AI review requested due to automatic review settings March 27, 2026 15:57
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Mar 27, 2026

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit a4123eb with merge base 4c56d9b (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.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 27, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Mar 27, 2026

@lucylq has exported this pull request. If you are a Meta employee, you can view the originating Diff in D96844228.

Copy link
Copy Markdown
Contributor

@kimishpatel kimishpatel left a comment

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new per-method export configuration option intended to control the sequence length used for torch.export tracing.

Changes:

  • Extend MethodConfig with an optional export_seq_len field.
  • Document intended semantics for how export_seq_len affects tracing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +306 to +312
Attributes:
method_name: Name of the method to export.
lora_config: Optional LoRA configuration.
export_seq_len: Sequence length of example inputs used during
torch.export tracing. Controls which graph path is captured.
Use export_seq_len=1 for decode methods (e.g. YOCO decode
where all layers run). When unset, uses the model's default
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

PR metadata/title mentions "exit layer", but the only code change here adds export_seq_len to MethodConfig and related documentation. Please update the PR title/description to match the actual change (or include the missing exit-layer-related implementation changes) so reviewers can validate the intended behavior.

Copilot uses AI. Check for mistakes.
Comment thread extension/llm/export/config/llm_config.py
Comment thread extension/llm/export/config/llm_config.py Outdated
@meta-codesync meta-codesync Bot changed the title Add support for exit layer Add support for exit layer (#18541) Mar 30, 2026
@lucylq lucylq force-pushed the export-D96844228 branch from 3d05d25 to 62e4f8a Compare March 30, 2026 16:58
lucylq added a commit to lucylq/executorch-1 that referenced this pull request Mar 30, 2026
Summary:

Add

Reviewed By: billmguo, kimishpatel

Differential Revision: D96844228
lucylq added a commit to lucylq/executorch-1 that referenced this pull request Mar 30, 2026
Summary:

Add

Reviewed By: billmguo, kimishpatel

Differential Revision: D96844228
Copilot AI review requested due to automatic review settings March 30, 2026 21:03
@lucylq lucylq force-pushed the export-D96844228 branch from 62e4f8a to 01770af Compare March 30, 2026 21:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary:

Add

Reviewed By: billmguo, kimishpatel

Differential Revision: D96844228
@lucylq lucylq force-pushed the export-D96844228 branch from 01770af to a4123eb Compare March 30, 2026 23:06
@meta-codesync meta-codesync Bot merged commit cdbfbe3 into pytorch:main Mar 31, 2026
159 of 163 checks passed
rascani pushed a commit to rascani/executorch that referenced this pull request Apr 1, 2026
Differential Revision: D96844228

Pull Request resolved: pytorch#18541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants