PR #11122: [ROCm] Fix RCCL hang on rocm5.7
PR #11122: [ROCm] Fix RCCL hang on rocm5.7

Imported from GitHub PR https://github.com/openxla/xla/pull/11122


Copybara import of the project:

--
94f7dc85f6ab07343ddb565b0aac0ed908fd66b4 by Dragan Mladjenovic <Dragan.Mladjenovic@amd.com>:

[ROCm] Allow ncclCommInitRankConfig on rocm5.7

--
2d196b645ccac046309d44f747d42777f00f1c9b by Dragan Mladjenovic <Dragan.Mladjenovic@amd.com>:

[ROCm] Fix sporadic hangs in CommInitRanks

Pointer to comm_handle must stay valid untill GroupEnd call
on pre 2.18 nccl. Only after that comm_handle contains a valid value.
Enforce this by using std::vector instead of temp local.

Merging this change closes #11122

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/11122 from ROCm:5.7-rccl-hang 2d196b645ccac046309d44f747d42777f00f1c9b
