Direct, immediate, and local fix to UpSampleNearest2D fwd to work around the UINT32_MAX limit of HIP runtime#3082
Direct, immediate, and local fix to UpSampleNearest2D fwd to work around the UINT32_MAX limit of HIP runtime#3082glen-amd wants to merge 5 commits intorelease/2.10from
Conversation
…nd the UINT32_MAX limit of HIP runtime
|
Jenkins build for c1fbfd13502a1870937f7e8f4995ff2827a738ae commit finished as FAILURE |
| #if 0 | ||
| // TODO: The change below needs to work with | ||
| // a grid-strided loop in `vectorized_elementwise_kernel`. | ||
| // Simiar to: https://github.com/pytorch/pytorch/pull/169474 | ||
| #ifdef USE_ROCM | ||
| // Clamp the grid to ensure total threads (grid * num_threads) | ||
| // does not exceed the uint32_t limit of the HSA AQL packet. | ||
| // Use 4294967295 (UINT32_MAX) as the ceiling. | ||
| int64_t max_safe_grid = 4294967295LL / num_threads(); | ||
| grid = std::min(grid, max_safe_grid); | ||
| #endif | ||
| #endif |
There was a problem hiding this comment.
Why did you add an #if 0 block? For commentary?
There was a problem hiding this comment.
- It's not required for the direct fix to the specific error we were working on. But it's identified as a potential (similar) issue while debugging the issue in question.
- As the
TODOcomment indicates, to be fully functional, this change would need some corresponding changes to the other function. - So, I commented out this change (using
#if 0) for now.
There was a problem hiding this comment.
Please remove from PR.
We can add it back when necessary.
Otherwise. Looks good to me
|
Jenkins build for 2a0a2b229e7e30577bedd61535f9d1343a667244 commit finished as FAILURE |
PR Review SummaryJira: ROCM-2926 ProblemHIP's HSA AQL dispatch packet stores Code Quality Assessment
Open Issues / Action Items
VerdictThe fix is technically sound — the root cause analysis is correct, the grid-stride loop pattern is the right approach, and the CUDA/ROCm split is clean. However, the PR is not ready to merge because:
|
|
Jenkins build for 7d3a91f696975197c73afe49349e2f980f553672 commit finished as FAILURE Detected error during Pytorch building: |
Please check the inline, detailed comments in the changed files.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist