Skip to content
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

Reduce unnecesary function call and use zip to transpose 2d list #2796

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elokrainz
Copy link

@elokrainz elokrainz commented Mar 11, 2025

Summary:
This diff aims to improve the performance of the _set_sharding_context_post_a2a in embedding_sharding module in TorchRec by reducing unnecessary function calls and using zip_longest to transpose 2D jagged lists.

@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 Mar 11, 2025
Summary:
This diff aims to improve the performance of the `_set_sharding_context_post_a2a` in `embedding_sharding` module in TorchRec by reducing unnecessary function calls and using `zip_longest` to transpose 2D jagged lists.

Previous trace: about 4-5ms
{F1975959472}
Now: less than 4ms, some even less than 0.2ms, with much less operations
{F1975959630}
{F1975959609}

Test on IG TAB ESR TTSN model:
NE trending is same:
{F1975957602}
{F1975957605}
{F1975957635}

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

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

@facebook-github-bot
Copy link
Contributor

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

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.

2 participants