Skip to content

Add a default delegate time scale converter #5076

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
Sep 10, 2024

Conversation

Olivia-liu
Copy link
Contributor

Summary:
Because the unit of delegate ops are different from non-delegates, this has caused confusion for users: post, Issue #4504.

This diff gives a quick solution for the problem to unblock Beta. The rationale is that since for non-delegated ops, we have the default time scale:

source_time_scale: TimeScale = TimeScale.NS,
target_time_scale: TimeScale = TimeScale.MS,

And the conversion rate is 10^6 (because 1 MS = 10^6 NS), so it makes sense to set a default converter function for delegated ops to be input_time/(1000 * 1000) as well. Similar converter functions have been used by coreml and vulkan already.

The proper solution to write the convertion in etdump is tracked by T198369344 and T198369419

Differential Revision: D62160650

Copy link

pytorch-bot bot commented Sep 4, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit d7c3001 with merge base 85410e4 (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 Sep 4, 2024
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Sep 4, 2024
Summary:
Pull Request resolved: pytorch#5076

By default, the non-delegated events have a time scale converter, but delegated events do not, and this has caused confusion for users: [post](https://fb.workplace.com/groups/pytorch.edge.users/permalink/1562687731268181/), [Issue pytorch#4504](pytorch#4504).

This diff gives a quick solution for the problem to unblock ET Beta. The rationale is that since for non-delegated ops, we have the default time scale:
```
source_time_scale: TimeScale = TimeScale.NS,
target_time_scale: TimeScale = TimeScale.MS,
```
And the conversion rate is 10^6 (because 1 MS = 10^6 NS), so it makes sense to set a default converter function for delegated ops to be `input_time/(1000 * 1000)` as well. Similar converter functions have been used by [coreml](https://www.internalfb.com/code/fbsource/[76be64aab17c]/fbcode/executorch/examples/apple/coreml/scripts/inspector_utils.py?lines=259-262) and [vulkan](https://fburl.com/code/5cu6fx2b) already.

The proper solution to write the convertion in etdump is tracked by T198369344 and T198369419

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

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

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Sep 4, 2024
Summary:
Pull Request resolved: pytorch#5076

By default, the non-delegated events have a time scale converter, but delegated events do not, and this has caused confusion for users: [post](https://fb.workplace.com/groups/pytorch.edge.users/permalink/1562687731268181/), [Issue pytorch#4504](pytorch#4504).

This diff gives a quick solution for the problem to unblock ET Beta. When no `delegate_time_scale_converter` is provided by the user, just use the same converting ratio as the non-delegated events.

The proper solution to write the convertion in etdump is tracked by T198369344 and T198369419

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

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

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Sep 9, 2024
Summary:
Pull Request resolved: pytorch#5076

By default, the non-delegated events have a time scale converter, but delegated events do not, and this has caused confusion for users: [post](https://fb.workplace.com/groups/pytorch.edge.users/permalink/1562687731268181/), [Issue pytorch#4504](pytorch#4504).

This diff gives a quick solution for the problem to unblock ET Beta. When no `delegate_time_scale_converter` is provided by the user, just use the same converting ratio as the non-delegated events.

The proper solution to write the convertion in etdump is tracked by T198369344 and T198369419

Reviewed By: dbort

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

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

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Sep 9, 2024
Summary:
Pull Request resolved: pytorch#5076

By default, the non-delegated events have a time scale converter, but delegated events do not, and this has caused confusion for users: [post](https://fb.workplace.com/groups/pytorch.edge.users/permalink/1562687731268181/), [Issue pytorch#4504](pytorch#4504).

This diff gives a quick solution for the problem to unblock ET Beta. When no `delegate_time_scale_converter` is provided by the user, just use the same converting ratio as the non-delegated events.

The proper solution to write the convertion in etdump is tracked by T198369344 and T198369419

Reviewed By: dbort

Differential Revision: D62160650
Summary:
Pull Request resolved: pytorch#5076

By default, the non-delegated events have a time scale converter, but delegated events do not, and this has caused confusion for users: [post](https://fb.workplace.com/groups/pytorch.edge.users/permalink/1562687731268181/), [Issue pytorch#4504](pytorch#4504).

This diff gives a quick solution for the problem to unblock ET Beta. When no `delegate_time_scale_converter` is provided by the user, just use the same converting ratio as the non-delegated events.

The proper solution to write the convertion in etdump is tracked by T198369344 and T198369419

Reviewed By: dbort

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

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

@facebook-github-bot facebook-github-bot merged commit 7650667 into pytorch:main Sep 10, 2024
36 of 37 checks passed
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.

3 participants