From 2a5595e1598a606ba639773cddac0787d0c24228 Mon Sep 17 00:00:00 2001 From: akashveramd Date: Fri, 1 Aug 2025 23:01:04 -0700 Subject: [PATCH] [release/2.7] Fix test_rnn_check_device tests for P1 Jira SWDEV-542659 (#2440) This PR has fixes for P1 Jira https://ontrack-internal.amd.com/browse/SWDEV-542659. In this Jira, there are 3 test files with failing tests. 1) distributed.test_distributed_spawn 2) test_binary_ufuncs 3) test_nn The test files **distributed.test_distributed_spawn** & **test_binary_ufuncs** are passing with latest mainline build- **registry-sc-harbor.amd.com/framework/compute-rocm-dkms-no-npi-hipclang:16426_ubuntu22.04_py3.10_pytorch_lw_release-2.7_fe3d37a9**. The test file **test_nn** has 2 failing tests- **test_batchnorm_3D_train_NCHW_vs_native_mixed_float16** & **test_RNN_dropout_state**. The **test_batchnorm_3D_train_NCHW_vs_native_mixed_float16** test is skipped from PR https://github.com/ROCm/pytorch/pull/2370. The **test_RNN_dropout_state** is fixed by cherry picking upstream commit 1aa971a. Tested on MI200 with docker image- **registry-sc-harbor.amd.com/framework/compute-rocm-dkms-no-npi-hipclang:16426_ubuntu22.04_py3.10_pytorch_lw_release-2.7_fe3d37a9**. --------- Co-authored-by: Iurii Paikov Co-authored-by: Jeff Daily Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com> --- aten/src/ATen/miopen/Descriptors.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/aten/src/ATen/miopen/Descriptors.h b/aten/src/ATen/miopen/Descriptors.h index a0ad4a4e1098..4b6c0cf2cae6 100644 --- a/aten/src/ATen/miopen/Descriptors.h +++ b/aten/src/ATen/miopen/Descriptors.h @@ -120,12 +120,11 @@ struct TORCH_CUDA_CPP_API ConvolutionDescriptor } }; -// NOLINTNEXTLINE(bugprone-exception-escape) -struct TORCH_CUDA_CPP_API DropoutDescriptor - : public Descriptor< - miopenDropoutDescriptor, - &miopenCreateDropoutDescriptor, - &miopenDestroyDropoutDescriptor> { +struct DropoutDescriptor + : public Descriptor +{ void set(miopenHandle_t handle, float dropout, void* states, size_t stateSizeInBytes, unsigned long long seed, bool use_mask, bool state_evo, miopenRNGType_t rng_mode) { MIOPEN_CHECK(miopenSetDropoutDescriptor(mut_desc(), handle, dropout, states, stateSizeInBytes, seed, use_mask, state_evo, rng_mode));