Fixed an error after backporting Upstream PR180310 to release/2.12 br…#3376
Open
glen-amd wants to merge 1 commit into
Open
Fixed an error after backporting Upstream PR180310 to release/2.12 br…#3376glen-amd wants to merge 1 commit into
glen-amd wants to merge 1 commit into
Conversation
|
Jenkins build for b8fc04681280710a1737186e87d398d9e5f6b0ad commit finished as FAILURE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Error after backporting the Upstream PR180310
Summary
F.interpolate(x, scale_factor=2, mode='nearest')on a default contiguous tensor takes PATH 2 (NCHW) inupsample_nearest2d_out_cuda_template. That path computed:int grid_z = std::min<int>(maxGridSize[2], ceil_div(nc, (int64_t) block_z * 4));.F.interpolate(x, scale_factor=2, mode='nearest'): the NCHW 3D-grid forward launch. It avoids the badstd::min<int>(maxGridSize[2], requested_grid_z)behavior on ROCm, computesgrid_zinint64_t, casts to unsigned only at the end, and preserves correctness because the kernel already grid-strides over the NC/Z dimension.hipDeviceProp_t::maxGridSize[2]is reported through the signedintfield as -1 (uint32 max wrapped). Sostd::min<int>(-1, requested)-> -1 -> stored intodim3as0xFFFFFFFF. HIP/HSA stores each dimension's global work size (gridDim*blockDim) in auint32_tAQL field, sogrid.z = 4294967295overflows it ->hipErrorInvalidConfiguration-> the exactCUDA error: invalid configuration argument.@skipCUDAIfRocmfromtest_upsampling_64bit_indexing_channels_last, whose contiguous reference branch hits NCHW with largenc.maxGridSize[2];computegrid_zin int64, clamp to[1, UINT32_MAX/block_z], and builddim3from unsigned values. Safe because the NCHW kernel already grid-strides over the NC dimension.grid_x/grid_yare left exact (the kernel doesn't stride over X/Y; they're bounded byINT_MAX/block_dim). The CUDA path is unchanged (kept under#else, including itsTORCH_CHECKandmaxGridSizeusage).Notes