[Bugfix] Fix nll bug via decomposition handling#177189
[Bugfix] Fix nll bug via decomposition handling#177189Lucaskabela wants to merge 1 commit intomainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/177189
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 2 Unrelated FailuresAs of commit 9ae0c7d with merge base f249065 ( NEW FAILURE - The following job has failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
b968311 to
9ae0c7d
Compare
|
@claude are these test failures related to my change? |
|
Claude finished @Lucaskabela's task in 1m 13s —— View job CI Failure Analysis
No, none of the CI failures are related to your change. Here's the breakdown: 1.
|
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot label "topic: not user facing" |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 3 checks: pull / linux-jammy-py3.14-clang15 / test (crossref, 1, 2, lf.linux.2xlarge), pull / linux-jammy-py3.10-gcc11 / test (distributed, 1, 2, lf.linux.2xlarge), inductor / inductor-cpu-test / test (cpu_inductor_torchbench, 1, 2, linux.2xlarge.amx, unstable) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes pytorch#89630 ## Summary NLL backward was failing under compile with 1d input when self is 1D, where target.unsqueeze(0) produced a 2D index for the subsequent 1D scatter. The fix mirrors the C++ kernel's behavior of only using target[0] ## Test ```bash python -m pytest test/inductor/test_torchinductor.py -xvs -k "test_nll_loss_backward_1d_input" ``` Pull Request resolved: pytorch#177189 Approved by: https://github.com/frgossen
Fixes #89630
Summary
NLL backward was failing under compile with 1d input when self is 1D, where target.unsqueeze(0) produced
a 2D index for the subsequent 1D scatter. The fix mirrors the C++ kernel's behavior of only using
target[0]
Test
python -m pytest test/inductor/test_torchinductor.py -xvs -k "test_nll_loss_backward_1d_input"cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo