Skip to content

Conversation

@limintang
Copy link
Contributor

Differential Revision: D64941627

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 28, 2024

🔗 Helpful Links

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

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

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 Oct 28, 2024
@facebook-github-bot
Copy link
Contributor

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

@cccclai
Copy link
Contributor

cccclai commented Oct 29, 2024

@chiwwang Limin added support for for op trace? Mind taking a look?

if (profile_level != QnnExecuTorchProfileLevel::kProfileOff) {
const QnnInterface& qnn_interface = implementation_.GetQnnInterface();
Qnn_ErrorHandle_t error = qnn_interface.qnn_profile_create(
backend_->GetHandle(), static_cast<int>(profile_level), &handle_);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to fixed profile_level?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should add the level to QnnExecuTorchProfileLevel. Maybe typo? I saw kProfileOptrace = 3 there.

@shewu-quic , how about the linting profile level? Should we reserve a number for that?

Copy link
Contributor Author

@limintang limintang Oct 29, 2024

Choose a reason for hiding this comment

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

Not typo. Optrace requires profiling level to be QNN_PROFILE_LEVEL_DETAILED (2), same as kProfileDetailed. I considered adding an additional config for optrace, but it requires signature change of many functions, so I chose to add a new profiling level kProfileOptrace in the schema, but the profiling level passed to QNN compiler for which is the same as kProfileDetailed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to remove the hardcoded value of QNN profile level.

Copy link
Contributor

@chiwwang chiwwang left a comment

Choose a reason for hiding this comment

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

Thank your for the change!

Generally looks good for me. Just some comments around the profile_level settings.

if (profile_level != QnnExecuTorchProfileLevel::kProfileOff) {
const QnnInterface& qnn_interface = implementation_.GetQnnInterface();
Qnn_ErrorHandle_t error = qnn_interface.qnn_profile_create(
backend_->GetHandle(), static_cast<int>(profile_level), &handle_);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should add the level to QnnExecuTorchProfileLevel. Maybe typo? I saw kProfileOptrace = 3 there.

@shewu-quic , how about the linting profile level? Should we reserve a number for that?

online_prepare: bool = False,
dump_intermediate_outputs: bool = False,
profile: bool = False,
optrace: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

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

How about change profile: bool to an enum class or something similar? Then users can choose profile level they want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. However, before this change kProfileDetailed is the only supported profile level. It might be better to make this change in a separate diff.

limintang added a commit to limintang/executorch that referenced this pull request Oct 29, 2024
Summary:
Add a new profile level to support optrace capture.


Reviewed By: billmguo

Differential Revision: D64941627
@facebook-github-bot
Copy link
Contributor

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

Summary:
Add a new profile level to support optrace capture.


Reviewed By: billmguo

Differential Revision: D64941627
@facebook-github-bot
Copy link
Contributor

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

Copy link
Collaborator

@shewu-quic shewu-quic 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 for your effort.

@chiwwang
Copy link
Contributor

Looks good for me. Thank you!

Copy link
Contributor

@cccclai cccclai left a comment

Choose a reason for hiding this comment

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

Thanks folk for the review!

Copy link
Contributor Author

@limintang limintang left a comment

Choose a reason for hiding this comment

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

@pytorchbot merge

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 30, 2024

Mergebot is not configured for this repository. Please use the merge button provided by GitHub.

@facebook-github-bot facebook-github-bot merged commit 6086d6e into pytorch:main Oct 31, 2024
3 of 5 checks passed
@limintang limintang deleted the export-D64941627 branch October 31, 2024 15:52
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants