Skip to content

method_meta add uses_backend function #8198

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
merged 1 commit into from
Feb 6, 2025

Conversation

cmt0
Copy link
Contributor

@cmt0 cmt0 commented Feb 4, 2025

Summary: For a runtime that supports models of a couple different types it helps to be able to check ahead of time whether certain backend types are present. In our case, there are processors that can use this information to make scheduling decisions without having the actual required backend implementations present.

Differential Revision: D69143825

Copy link

pytorch-bot bot commented Feb 4, 2025

🔗 Helpful Links

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

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:

✅ No Failures

As of commit d18c44a with merge base 3e64c4e (image):
💚 Looks good so far! There are no failures yet. 💚

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
@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@dbort dbort 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 adding this! It's a reasonable feature.

Comment on lines 195 to 200
/**
* Check to see if a backend is used in this method.
*
* @returns Whether a backend is used in this method.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a @param, and clarify true-vs-false rather than "whether".

Suggested change
/**
* Check to see if a backend is used in this method.
*
* @returns Whether a backend is used in this method.
*/
/**
* Check to see if a backend is used by this method.
*
* @param backend_name The name of the backend to search for.
* @returns true if this method uses this backend; false otherwise.
*/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added clarification

Copy link
Contributor

@dbort dbort Feb 5, 2025

Choose a reason for hiding this comment

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

Please add the @param line too

cmt0 pushed a commit to cmt0/executorch that referenced this pull request Feb 5, 2025
Summary:

For a runtime that supports models of a couple different types it helps to be able to check ahead of time whether certain backend types are present. In our case, there are processors that can use this information to make scheduling decisions without having the actual required backend implementations present.

Differential Revision: D69143825
@cmt0 cmt0 force-pushed the export-D69143825 branch from 0993897 to 1ff1b1f Compare February 5, 2025 19:09
@facebook-github-bot
Copy link
Contributor

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

@cmt0
Copy link
Contributor Author

cmt0 commented Feb 5, 2025

@pytorchbot label "release notes: Adds method meta function which checks whether a backend is used by a program"

Copy link

pytorch-bot bot commented Feb 5, 2025

Didn't find following labels among repository labels: release notes: Adds method meta function which checks whether a backend is used by a program

cmt0 pushed a commit to cmt0/executorch that referenced this pull request Feb 5, 2025
Summary:

For a runtime that supports models of a couple different types it helps to be able to check ahead of time whether certain backend types are present. In our case, there are processors that can use this information to make scheduling decisions without having the actual required backend implementations present.

Differential Revision: D69143825
@cmt0 cmt0 force-pushed the export-D69143825 branch from 1ff1b1f to 9d7ed81 Compare February 5, 2025 19:16
@facebook-github-bot
Copy link
Contributor

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

cmt0 pushed a commit to cmt0/executorch that referenced this pull request Feb 5, 2025
Summary:

For a runtime that supports models of a couple different types it helps to be able to check ahead of time whether certain backend types are present. In our case, there are processors that can use this information to make scheduling decisions without having the actual required backend implementations present.

Differential Revision: D69143825
@cmt0 cmt0 force-pushed the export-D69143825 branch from 9d7ed81 to 86b15c1 Compare February 5, 2025 19:17
@facebook-github-bot
Copy link
Contributor

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

cmt0 pushed a commit to cmt0/executorch that referenced this pull request Feb 5, 2025
Summary:

For a runtime that supports models of a couple different types it helps to be able to check ahead of time whether certain backend types are present. In our case, there are processors that can use this information to make scheduling decisions without having the actual required backend implementations present.

Differential Revision: D69143825
@cmt0 cmt0 force-pushed the export-D69143825 branch from 86b15c1 to 54b7d77 Compare February 5, 2025 19:17
@facebook-github-bot
Copy link
Contributor

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

@cmt0
Copy link
Contributor Author

cmt0 commented Feb 5, 2025

@pytorchbot label "release notes: misc"

@pytorch-bot pytorch-bot bot added the release notes: misc Miscellaneous label Feb 5, 2025
cmt0 pushed a commit to cmt0/executorch that referenced this pull request Feb 5, 2025
Summary:

For a runtime that supports models of a couple different types it helps to be able to check ahead of time whether certain backend types are present. In our case, there are processors that can use this information to make scheduling decisions without having the actual required backend implementations present.

Differential Revision: D69143825
@cmt0 cmt0 force-pushed the export-D69143825 branch from 54b7d77 to d5f51f6 Compare February 5, 2025 19:23
@facebook-github-bot
Copy link
Contributor

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

@cmt0 cmt0 changed the title Method_Meta contains_backend check method_meta add uses_backend function Feb 5, 2025
@cmt0
Copy link
Contributor Author

cmt0 commented Feb 5, 2025

@dbort Does it need an ET_EXPERIMENTAL tag, or can I define it normally to avoid deprecated declarations warning?

@dbort dbort added release notes: runtime Changes related to the core runtime which loads the program methods, initializes delegates, and runs and removed release notes: misc Miscellaneous labels Feb 5, 2025
@dbort
Copy link
Contributor

dbort commented Feb 5, 2025

@dbort Does it need an ET_EXPERIMENTAL tag, or can I define it normall to avoid deprecated declarations warning?

I think the new method is general enough to remove the ET_EXPERIMENTAL annotation. The behavior is well-defined compared to e.g. the instruction count.

cmt0 pushed a commit to cmt0/executorch that referenced this pull request Feb 5, 2025
Summary:

For a runtime that supports models of a couple different types it helps to be able to check ahead of time whether certain backend types are present. In our case, there are processors that can use this information to make scheduling decisions without having the actual required backend implementations present.

Reviewed By: dbort

Differential Revision: D69143825
@cmt0 cmt0 force-pushed the export-D69143825 branch from d5f51f6 to e4720f2 Compare February 5, 2025 19:50
@facebook-github-bot
Copy link
Contributor

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

Summary:

For a runtime that supports models of a couple different types it helps to be able to check ahead of time whether certain backend types are present. In our case, there are processors that can use this information to make scheduling decisions without having the actual required backend implementations present.

Reviewed By: dbort

Differential Revision: D69143825
@cmt0 cmt0 force-pushed the export-D69143825 branch from e4720f2 to d18c44a Compare February 5, 2025 20:02
@facebook-github-bot
Copy link
Contributor

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

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 release notes: runtime Changes related to the core runtime which loads the program methods, initializes delegates, and runs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants