-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[nll_loss] Avoid unnecessary type casts #86086
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86086
Note: Links to docs will display an error until the docs builds have been completed. ✅ No Failures, 1 PendingAs of commit 3d6bc2c: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
/easycla As part of the transition to the PyTorch Foundation, this project now requires contributions be covered under the new CLA. See #85559 for additional details. This comment will trigger a new check of this PR. If you are already covered, you will simply see a new "EasyCLA" check that passes. If you are not covered, a bot will leave a new comment with a link to sign. |
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thank you!
@pytorchbot merge -g |
Merge startedYour change will be merged once all checks on your PR pass since you used the green (-g) flag (ETA: 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Hey @crcrpar. |
Summary: follow-up #85395 `AT_DISPATCH_NLL_LOSS_INDEX_TYPES` should not be removed in favor of #59765 and there's a testcase https://github.com/pytorch/pytorch/blob/99ca25e6eb8299f31824bdbaf62f16f8a8db458d/test/test_nn.py#L16832 Besides the dispatcher, I wanted to sanity check `int64_t ignore_index` because `int64_t` can be inappropriate considering that `target` can be `Byte`. However, given that the default value is -100 as in https://github.com/pytorch/pytorch/blob/0a75c42f36c0e50a22c06fa65478df53d7d420c4/aten/src/ATen/native/native_functions.yaml#L9949 it's not easy to add a check while keeping the backward compatibility. Thus I decided to not add a check. cc lezcano t-vi Pull Request resolved: #86086 Approved by: https://github.com/lezcano Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/a2419638373071c74692c9fe5996c69ef509f581 Reviewed By: seemethere Differential Revision: D40167225 Pulled By: seemethere fbshipit-source-id: ae031f061a88ef90d38b48f56b91bd17ae5c0e2a
follow-up #85395
AT_DISPATCH_NLL_LOSS_INDEX_TYPES
should not be removed in favor of #59765 and there's a testcasepytorch/test/test_nn.py
Line 16832 in 99ca25e
Besides the dispatcher, I wanted to sanity check
int64_t ignore_index
becauseint64_t
can be inappropriate considering thattarget
can beByte
. However, given that the default value is -100 as inpytorch/aten/src/ATen/native/native_functions.yaml
Line 9949 in 0a75c42
cc @lezcano @t-vi