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

fix flaky test due to input_jkt.weight dtype #2763

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

Conversation

TroyGarden
Copy link
Contributor

Summary:

context

  • The test_model_parallel_nccl has been reported to be flaky: paste

  • after an in-depth investigation, the root cause is that when the dtype of the generated input KJT._weights is always torch.float (i.e., torch.float32), but the tested embedding table's dtype could be torch.FP16.

changes

  • added dtype argument to the torch.rand function in input generation so that the generated input kjt can have the correct dtype for the kjt._weights

Differential Revision: D70126859

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

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

TroyGarden added a commit to TroyGarden/torchrec that referenced this pull request Feb 24, 2025
Summary:

# context
* The [test_model_parallel_nccl](https://fb.workplace.com/groups/970281557043698/posts/1863456557726189/?comment_id=1867254224013089) has been reported to be flaky: [paste](https://www.internalfb.com/intern/everpaste/?color=0&handle=GJBrgxaEWkfR-ycEAP_fNV5sl_l1br0LAAAz)

* after an in-depth investigation, the root cause is that when the dtype of the generated input KJT._weights is always `torch.float` (i.e., `torch.float32`), but the tested embedding table's dtype could be `torch.FP16`.

# changes
* added `dtype` argument to the `torch.rand` function in input generation so that the generated input kjt can have the correct dtype for the kjt._weights

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

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

Summary:

# context
* The [test_model_parallel_nccl](https://fb.workplace.com/groups/970281557043698/posts/1863456557726189/?comment_id=1867254224013089) has been reported to be flaky: [paste](https://www.internalfb.com/intern/everpaste/?color=0&handle=GJBrgxaEWkfR-ycEAP_fNV5sl_l1br0LAAAz)

* after an in-depth investigation, the root cause is that when the dtype of the generated input KJT._weights is always `torch.float` (i.e., `torch.float32`), but the test embedding table's dtype could be `torch.FP16`.

# changes
* convert the input_kjt._weights.dtype to be consistent with `EmbeddingBag.weight.dtype` in EBC (unsharded)

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

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

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