[ROCm] Use a ROCm version string without hash. (#166336)

Fixes #166068

Use the ROCm version string that does not contain a hash. The string is set in LoadHIP.cmake.

Tested on repro provided by reporter.

For a ROCm 7.0 docker container, we get `7.0.0`.

For a ROCm 7.0.2 docker container, we get `7.0.2`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/166336
Approved by: https://github.com/jeffdaily
This commit is contained in:
Nichols A. Romero 2025-10-28 03:53:51 +00:00 committed by PyTorch MergeBot
parent ff46d5a79b
commit a77f5d9a00

View File

@ -490,7 +490,7 @@ add_custom_target(
"${Python_EXECUTABLE}" "${TOOLS_PATH}/generate_torch_version.py" "${Python_EXECUTABLE}" "${TOOLS_PATH}/generate_torch_version.py"
--is-debug=${TORCH_VERSION_DEBUG} --is-debug=${TORCH_VERSION_DEBUG}
--cuda-version=${CUDA_VERSION} --cuda-version=${CUDA_VERSION}
--hip-version=${HIP_VERSION} --hip-version=${ROCM_VERSION_DEV}
--xpu-version=${SYCL_COMPILER_VERSION} --xpu-version=${SYCL_COMPILER_VERSION}
BYPRODUCTS ${TORCH_SRC_DIR}/version.py BYPRODUCTS ${TORCH_SRC_DIR}/version.py
COMMENT "Regenerating version file..." COMMENT "Regenerating version file..."