Skip to content

New Getting Started documentation #8179

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

Merged

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Feb 4, 2025

Summary

Update the Getting Started documentation, as part of the wider documentation revamp effort. See #8178 for more context on goals, motivation, and structure.

Note that this is a draft. There are a number of TODOs still present in markdown, as well as links to documentation that does not currently exist.

Test plan

See the documentation preview built for this PR.

cc @mergennachin @byjlw

Copy link

pytorch-bot bot commented Feb 4, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure

As of commit d3d2a5a with merge base a5c7609 (image):

NEW FAILURE - The following job has failed:

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 Feb 4, 2025
@GregoryComer GregoryComer added release notes: misc Miscellaneous module: doc Issues related to documentation, both in docs/ and inlined in code labels Feb 4, 2025
Copy link
Contributor

@mergennachin mergennachin left a comment

Choose a reason for hiding this comment

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

In general looks good in terms of structure

I added some inline comments

Let's actually create a separate branch and starting merging into the new branch.

That way, we can actually start working on this collaboratively on document revamp. Once things are in good condition, we can merge the whole branch onto main.

Otherwise, I don't want to be in this limbo state where some parts of the doc is working and some are not working for external documentation. A lot of people are still looking main doc (as opposed to stable)

https://pytorch.org/executorch/main/getting-started-setup.html

```
pip install executorch
```

Copy link
Contributor

Choose a reason for hiding this comment

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

For the time being, we should still have a way to install from source steps

At least have a pointer to another page/section.

Otherwise, as I said in the previous comment, we're not ready yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Where do you see the current gaps? IMO we should prioritize this as much as possible, since build + install is a big source of friction currently.

After successfully generating a .pte file, it is common to use the Python runtime bindings to validate the model. This can be used to evaluate model accuracy before running on-device.

<hr/>

Copy link
Contributor

Choose a reason for hiding this comment

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

We should provide an alternative pathway to use HF transformers and optimum library directly for exportability.

Cc @guangy10 @tarun292

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense. I'd like to do another pass once we get the "core" framework docs in place to figure out how LLMs and transformers fit in.

- One or more target hardware backends.

### Selecting a Backend
ExecuTorch provides hardware backends for a wide variety of hardware. The most commonly used backends are XNNPACK, for ARM and x86 CPU, CoreML (for iOS), and Vulkan (for Android GPUs).
Copy link
Contributor

Choose a reason for hiding this comment

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

Mention Qualcomm for Android NPU

Copy link
Member Author

Choose a reason for hiding this comment

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

Added. I do think that it is very hard to use NPU delegates right now, in part because we don't expose any sane way to detect if the user is running supported hardware, and they need to ship a fully separate PTE. Hopefully backend capabilities + program data separation will help alleviate this. Until then, I think it's a hard sell to get anyone to do the extra work unless they really want every bit of performance. Internally, I've had a hard time getting people to sign up to support multiple delegates because of the amount of work needed to export another PTE + test it + write runtime code. I'd like to focus on this once we get the core CPU + CoreML experience tightened up.

Copy link
Contributor

@jackzhxng jackzhxng left a comment

Choose a reason for hiding this comment

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

Quick drive by, this is great 👍🏻

@mergennachin
Copy link
Contributor

@GregoryComer

Can you convert this an actual PR. Also, I don't see the new branch for the upstream.

Backend delegates may require additional dependencies. See the appropriate backend documentation for more information.

#### System Requirements
The following are required to install the ExecuTorch host libraries, needed to export models and run from Python. Requirements for target end-user devices are backend dependent. See the appropriate backend documentation for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

"run from Python" -> change to "run".

The reason is that we're listing g++ requirements below, which is confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought that we needed a C++ compiler to install the pip package, as some parts were locally compiled at install time? I could be wrong on that, though.

@dbort Do you know if a C++ compiler is required to install the pip package?

model = MyModel() # The PyTorch model to export
example_inputs = (torch.randn(1,3,64,64),) # A tuple of inputs

et_program =
Copy link
Contributor

Choose a reason for hiding this comment

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

np: formatting is a bit strange

@GregoryComer GregoryComer changed the base branch from main to doc-revamp February 5, 2025 22:34
@GregoryComer GregoryComer marked this pull request as ready for review February 5, 2025 22:34
@GregoryComer GregoryComer changed the base branch from doc-revamp to executorch-just-works February 6, 2025 09:11
@GregoryComer GregoryComer changed the title (Draft) New Getting Started documentation New Getting Started documentation Feb 6, 2025
@GregoryComer GregoryComer merged commit 504b5e0 into pytorch:executorch-just-works Feb 6, 2025
42 of 43 checks passed
GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Feb 23, 2025
GregoryComer added a commit that referenced this pull request Feb 23, 2025
GregoryComer added a commit that referenced this pull request Feb 26, 2025
GregoryComer added a commit that referenced this pull request Feb 26, 2025
* New Getting Started documentation (#8179)

WIP New getting started

* Update documentation flow and add placeholders (#8287)

Add placeholder top-level doc pages

* Add new export + lowering docs, update getting started (#8412)

Write new top-level export and lowering documentation

* More doc placeholders (#8523)

* Move cmake and faq docs to new location

* Rename CMake build to Building from Source

* Move backend docs to new locations (#8413)

* Temporarily remove new backend pages

* Move backend docs to new locations

* Update backend titles and inline contents

* Backend doc template (#8524)

Add backend template, update XNNPACK docs

* Add runtime integration documentation (#8516)

Add runtime integration doc

* Move iOS docs to top, add Android placeholders (#8511)

* Temporarily remove using-executorch-ios.md

* Move Apple runtime docs to new location

* Clean up documentation placeholders and links, add top-level docs for C++ APIs, Android, and troubleshooting (#8618)

* Clean up getting-started.md, remove placeholders

* Move Android pre-built AAR info into top-level Android page

* Add placeholder backend overview

* Add placeholder troubleshooting docs

* Populate top-level C++ API doc

* Clean up additional doc placeholders and fix broken links

* Add env setup instructions for source build

* Fix getting started code snippet (#8637)

Fix quotes in getting started code snippets

* Clean up a few more doc sections and links (#8672)

Clean up a few more broken links and sections in new doc flow

* Fix QNN link, typo (#8729)

* Add a CMake snippet to the XNNPACK backend doc build section (#8730)

Add CMake example to xnnpack backend doc
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 release notes: misc Miscellaneous
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants