Skip to content

[0.6 documentation] Fix Page Developer Tools: Bundled Program #10194

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

zhenyan-zhang-meta
Copy link
Contributor

@zhenyan-zhang-meta zhenyan-zhang-meta commented Apr 15, 2025

Stack from ghstack (oldest at bottom):

#10193

  • Update the hyperlink of “Generate Sample ExecuTorch program”, as this part has been heavily revamped in v0.6:
  • Fixed the emit stage sample code:
  • Remove function blocks for get_program_data, load_bundled_input and load_bundled_output, as there are no other similar usage in the doc.
    • Changed to links of real-world examples.
  • Remove hard-coded cpp code examples.
    • For APIs, provide links to real-world examples.
    • For runtime example, change to a ready-to-use snippet for people to quickly try out.

Differential Revision: D73027728

#10193

- Update the hyperlink of “Generate Sample ExecuTorch program”, as this part has been heavily revamped in v0.6:
  - Update to https://pytorch.org/executorch/0.6/getting-started.html#exporting
- Fixed the emit stage sample code:
  - Use `register_buffer` as warning suggests.
  - Update `to_edge` to be `to_edge_transform_and_lower`, as updated in https://pytorch.org/executorch/0.6/getting-started.html.
- Remove function blocks for `get_program_data`, `load_bundled_input` and `load_bundled_output`, as there are no other similar usage in the doc.
  - Changed to links of real-world examples.
- Remove hard-coded cpp code examples.
  - For APIs, provide links to real-world examples.
  - For runtime example, change to a ready-to-use snippet for people to quickly try out.

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

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Apr 15, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 18 Pending

As of commit e4dd23a with merge base 047bbc7 (image):
💚 Looks good so far! There are no failures yet. 💚

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

zhenyan-zhang-meta pushed a commit that referenced this pull request Apr 15, 2025
#10193

- Update the hyperlink of “Generate Sample ExecuTorch program”, as this part has been heavily revamped in v0.6:
  - Update to https://pytorch.org/executorch/0.6/getting-started.html#exporting
- Fixed the emit stage sample code:
  - Use `register_buffer` as warning suggests.
  - Update `to_edge` to be `to_edge_transform_and_lower`, as updated in https://pytorch.org/executorch/0.6/getting-started.html.
- Remove function blocks for `get_program_data`, `load_bundled_input` and `load_bundled_output`, as there are no other similar usage in the doc.
  - Changed to links of real-world examples.
- Remove hard-coded cpp code examples.
  - For APIs, provide links to real-world examples.
  - For runtime example, change to a ready-to-use snippet for people to quickly try out.

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

ghstack-source-id: 278155699
Pull Request resolved: #10194
@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 Apr 15, 2025
@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@Gasoonjia Gasoonjia left a comment

Choose a reason for hiding this comment

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

Thanks for updating! Overall looks good and left subtle comments

@@ -105,8 +105,8 @@ class SampleModel(torch.nn.Module):

def __init__(self) -> None:
super().__init__()
self.a: torch.Tensor = 3 * torch.ones(2, 2, dtype=torch.int32)
self.b: torch.Tensor = 2 * torch.ones(2, 2, dtype=torch.int32)
self.register_buffer('a', 3 * torch.ones(2, 2, dtype=torch.int32))
Copy link
Contributor

Choose a reason for hiding this comment

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

y use register_buffer to replace torch.tensor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To solve warnings like UserWarning: Node a target a a of does not reference an nn.Module, nn.Parameter, or buffer, which is what 'get_attr' Nodes typically target

```bash
cd executorch
./examples/devtools/build_example_runner.sh
./cmake-out/examples/devtools/example_runner --bundled_program_path {your-bpte-file}.bpte --output_verification
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
./cmake-out/examples/devtools/example_runner --bundled_program_path {your-bpte-file}.bpte --output_verification
./cmake-out/examples/devtools/example_runner --bundled_program_path {your-bpte-file} --output_verification

i think only bracelet here should be fine

```

It is expected to see no input.
Copy link
Contributor

Choose a reason for hiding this comment

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

What's that mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is expected to see no input from running the above mentioned snippet.

Let me update the wording.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm i‘m still confused here: what do you mean by "no input to see"? What's the expected or hypnosis input user want to see?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sheesh I mean no output 😅

…ram"

#10193

- Update the hyperlink of “Generate Sample ExecuTorch program”, as this part has been heavily revamped in v0.6:
  - Update to https://pytorch.org/executorch/0.6/getting-started.html#exporting
- Fixed the emit stage sample code:
  - Use `register_buffer` as warning suggests.
  - Update `to_edge` to be `to_edge_transform_and_lower`, as updated in https://pytorch.org/executorch/0.6/getting-started.html.
- Remove function blocks for `get_program_data`, `load_bundled_input` and `load_bundled_output`, as there are no other similar usage in the doc.
  - Changed to links of real-world examples.
- Remove hard-coded cpp code examples.
  - For APIs, provide links to real-world examples.
  - For runtime example, change to a ready-to-use snippet for people to quickly try out.

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

[ghstack-poisoned]
zhenyan-zhang-meta pushed a commit that referenced this pull request Apr 16, 2025
Pull Request resolved: #10194

#10193

- Update the hyperlink of “Generate Sample ExecuTorch program”, as this part has been heavily revamped in v0.6:
  - Update to https://pytorch.org/executorch/0.6/getting-started.html#exporting
- Fixed the emit stage sample code:
  - Use `register_buffer` as warning suggests.
  - Update `to_edge` to be `to_edge_transform_and_lower`, as updated in https://pytorch.org/executorch/0.6/getting-started.html.
- Remove function blocks for `get_program_data`, `load_bundled_input` and `load_bundled_output`, as there are no other similar usage in the doc.
  - Changed to links of real-world examples.
- Remove hard-coded cpp code examples.
  - For APIs, provide links to real-world examples.
  - For runtime example, change to a ready-to-use snippet for people to quickly try out.
ghstack-source-id: 278357457
@exported-using-ghexport

Differential Revision: [D73027728](https://our.internmc.facebook.com/intern/diff/D73027728/)
@facebook-github-bot
Copy link
Contributor

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

@zhenyan-zhang-meta
Copy link
Contributor Author

@Gasoonjia Thanks for reviewing! Updated as suggested.

…ram"

#10193

- Update the hyperlink of “Generate Sample ExecuTorch program”, as this part has been heavily revamped in v0.6:
  - Update to https://pytorch.org/executorch/0.6/getting-started.html#exporting
- Fixed the emit stage sample code:
  - Use `register_buffer` as warning suggests.
  - Update `to_edge` to be `to_edge_transform_and_lower`, as updated in https://pytorch.org/executorch/0.6/getting-started.html.
- Remove function blocks for `get_program_data`, `load_bundled_input` and `load_bundled_output`, as there are no other similar usage in the doc.
  - Changed to links of real-world examples.
- Remove hard-coded cpp code examples.
  - For APIs, provide links to real-world examples.
  - For runtime example, change to a ready-to-use snippet for people to quickly try out.

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

[ghstack-poisoned]
zhenyan-zhang-meta pushed a commit that referenced this pull request Apr 16, 2025
Pull Request resolved: #10194

#10193

- Update the hyperlink of “Generate Sample ExecuTorch program”, as this part has been heavily revamped in v0.6:
  - Update to https://pytorch.org/executorch/0.6/getting-started.html#exporting
- Fixed the emit stage sample code:
  - Use `register_buffer` as warning suggests.
  - Update `to_edge` to be `to_edge_transform_and_lower`, as updated in https://pytorch.org/executorch/0.6/getting-started.html.
- Remove function blocks for `get_program_data`, `load_bundled_input` and `load_bundled_output`, as there are no other similar usage in the doc.
  - Changed to links of real-world examples.
- Remove hard-coded cpp code examples.
  - For APIs, provide links to real-world examples.
  - For runtime example, change to a ready-to-use snippet for people to quickly try out.
ghstack-source-id: 278385371
@exported-using-ghexport

Differential Revision: [D73027728](https://our.internmc.facebook.com/intern/diff/D73027728/)
@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@Gasoonjia Gasoonjia left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!
Please cherry pick this PR.

@zhenyan-zhang-meta
Copy link
Contributor Author

@pytorchbot cherry-pick --onto release/0.6 -c docs

@pytorch pytorch deleted a comment from pytorch-bot bot Apr 16, 2025
@zhenyan-zhang-meta zhenyan-zhang-meta merged commit 32abec5 into gh/zhenyan-zhang-meta/3/base Apr 16, 2025
82 of 83 checks passed
@zhenyan-zhang-meta zhenyan-zhang-meta deleted the gh/zhenyan-zhang-meta/3/head branch April 16, 2025 05:58
metascroy pushed a commit that referenced this pull request Apr 16, 2025
This PR was created by the merge bot to help merge the original PR into
the main branch.
ghstack PR number: #10194 by
@zhenyan-zhang-meta
^ Please use this as the source of truth for the PR details, comments,
and reviews
ghstack PR base:
https://github.com/pytorch/executorch/tree/gh/zhenyan-zhang-meta/3/base
ghstack PR head:
https://github.com/pytorch/executorch/tree/gh/zhenyan-zhang-meta/3/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head:
https://github.com/pytorch/executorch/tree/gh/zhenyan-zhang-meta/3/orig
@diff-train-skip-merge
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 topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants