Repository navigation
Validate grad_output in grid_sampler_{2d,3d}_backward - #5584
Conversation
XPU was the only backend still skipping the `grad_output` shape check, so a mismatched `grad_output` made both backward kernels read out of bounds. CPU, CUDA and MPS already use the hardened helpers added upstream by pytorch/pytorch#191915. - 2d: switch to `check_grid_sampler_2d_backward` - 3d: add `check_grid_sampler_backward`; the bicubic-rejecting 3-arg `check_grid_sampler_3d` overload is kept until 5-D bicubic lands (#5511) - port `test_grid_sample_backward_error_checking` from upstream `test_nn.py` Requested in review of #5511
0f0e78a to
a8b9dbb
Compare
dvrogozh
left a comment
There was a problem hiding this comment.
The PR now looks good to me per-se, but I see the CI failure which might be related:
op_extended,third_party.torch-xpu-ops.test.xpu.extended.test_ops_xpu.TestCompositeComplianceXPU,test_forward_ad_nn_functional_grid_sample_xpu_float32
Please, help to investigate.
Added this test case to the tracking issue: #5452 - all will be fixed with the actual implementation of the Bicubic grid sampler #5511 (This entry also fails in other PR - e.g., https://github.com/intel/torch-xpu-ops/actions/runs/37002662439/job/110852416391?pr=5592 ) |
|
@pbielak , please, do the similar triage for the recently finished op_ut tests: Also, check if other failing tests are a known failures (they don't have |
I also checked these and I added them to the tracking issue (same problem of missing bicubic implementation) |
|
The rest are known failures (same in https://github.com/intel/torch-xpu-ops/actions/runs/36961251529/job/110751670169?pr=5117 for the #5117 which is orthogonal to the PR we review). |
|
@torchxpubot merge -f "CI failures are unrelated" |
|
Failed to merge PR: Repository rule violations found A conversation must be resolved before this pull request can be merged. |
|
@torchxpubot merge -f "CI failures are unrelated" |
|
PR has been successfully merged by @dvrogozh (force merge). |
XPU was the only backend still skipping the `grad_output` shape check, so a mismatched `grad_output` made both backward kernels read out of bounds. CPU, CUDA and MPS already use the hardened helpers added upstream by pytorch/pytorch#191915. - 2d: replace `check_grid_sampler_common` + `check_grid_sampler_2d` with `check_grid_sampler_2d_backward` - 3d: replace the equivalent block with `check_grid_sampler_3d_backward` and reject bicubic via a standalone `TORCH_CHECK_NOT_IMPLEMENTED`, mirroring MPS; the torch check is kept until 5-D bicubic lands (#5511) - port `test_grid_sample_backward_error_checking` from upstream `test_nn.py`
XPU was the only backend still skipping the `grad_output` shape check, so a mismatched `grad_output` made both backward kernels read out of bounds. CPU, CUDA and MPS already use the hardened helpers added upstream by pytorch/pytorch#191915. - 2d: replace `check_grid_sampler_common` + `check_grid_sampler_2d` with `check_grid_sampler_2d_backward` - 3d: replace the equivalent block with `check_grid_sampler_3d_backward` and reject bicubic via a standalone `TORCH_CHECK_NOT_IMPLEMENTED`, mirroring MPS; the torch check is kept until 5-D bicubic lands (intel#5511) - port `test_grid_sample_backward_error_checking` from upstream `test_nn.py`
XPU was the only backend still skipping the
grad_outputshape check, so a mismatchedgrad_outputmade both backward kernels read out of bounds. CPU, CUDA and MPS already use the hardened helpers added upstream by pytorch/pytorch#191915.check_grid_sampler_common+check_grid_sampler_2dwithcheck_grid_sampler_2d_backwardcheck_grid_sampler_3d_backwardandreject bicubic via a standalone
TORCH_CHECK_NOT_IMPLEMENTED, mirroring MPS; the torch check is kept until 5-D bicubic lands (Implement bicubic version ofgrid_sampler_3d#5511)test_grid_sample_backward_error_checkingfrom upstreamtest_nn.py