Skip to content

Update export and build from source docs #10807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented May 11, 2025

Summary

This PR makes some small updates to the docs in a few places. In the Build from Source page, I've added an explicit command to generate a test model (add.pte) to use with the executor_runner.

In the Exporting and Lowering page, I've added some details on advanced export and lowering techniques, including state management, dynamic control flow, and multi-method .ptes.

Test plan

I've built and viewed the docs locally to validate the changes.

cc @mergennachin @byjlw

@GregoryComer GregoryComer added module: doc Issues related to documentation, both in docs/ and inlined in code topic: not user facing labels May 11, 2025
Copy link

pytorch-bot bot commented May 11, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Unrelated Failure

As of commit 61c0835 with merge base b173722 (image):

NEW FAILURE - The following job has failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@facebook-github-bot facebook-github-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 May 11, 2025
@GregoryComer GregoryComer requested a review from byjlw May 11, 2025 05:44
@mergennachin
Copy link
Contributor

@JacobSzwejbka - can you take a look at the new content?


### Dynamic (Data-Dependent) Control Flow

Control flow is considered data-dependent if the path taken is not fixed at export-time. This is commonly the case when if or loop conditions depend on the value of a Tensor, such as a generator loop that terminates when an
Copy link
Contributor

Choose a reason for hiding this comment

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

Control flow is considered data-dependent if the path taken is not fixed at export-time.

This isn't true.

Its data dependent if its dependent on the data contained within the tensor rather than its shape. But shape based control flow can still be dynamic.

At runtime, the method name can be passed to `load_method` and `execute` on the `Module` class.

Multi-method .ptes have several caveats:
- Methods are individually memory-planned. Activation memory is not current re-used between methods.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe worth mentioning you could write a custom plan to change this, or share the same arenas at runtime.

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. module: doc Issues related to documentation, both in docs/ and inlined in code topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants