From 882f2f7533b6fe061b10315e9a15ebc1fbb87de1 Mon Sep 17 00:00:00 2001 From: sudhu2k Date: Tue, 17 Mar 2026 20:00:57 +0000 Subject: [PATCH 1/2] Refactor test_cast_master_weights_to_fp8 to use executable directly without resolving symlinks, preventing potential issues with virtual environments. --- tests/pytorch/distributed/test_cast_master_weights_to_fp8.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/pytorch/distributed/test_cast_master_weights_to_fp8.py b/tests/pytorch/distributed/test_cast_master_weights_to_fp8.py index f60986a92..352a05c66 100644 --- a/tests/pytorch/distributed/test_cast_master_weights_to_fp8.py +++ b/tests/pytorch/distributed/test_cast_master_weights_to_fp8.py @@ -717,7 +717,9 @@ def run_parallel_tests() -> None: @pytest.mark.parametrize("world_size", [2]) def test_cast_master_weights_to_fp8(world_size: int) -> None: """Launch parallel job that runs parallel tests""" - python_exe = pathlib.Path(sys.executable).resolve() + # Use executable as-is; do not resolve() or a venv symlink may point to system + # Python which does not have torch/site-packages. + python_exe = pathlib.Path(sys.executable) current_file = pathlib.Path(__file__).resolve() command = [ python_exe, From 398ba85a16eb25be0a2f98e455ff04b20ba465c9 Mon Sep 17 00:00:00 2001 From: sudhu2k Date: Wed, 18 Mar 2026 14:47:35 +0000 Subject: [PATCH 2/2] Enhance test_cast_master_weights_to_fp8 for AMDGPU portability and update comments for ROCm compatibility. --- tests/pytorch/distributed/test_cast_master_weights_to_fp8.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/pytorch/distributed/test_cast_master_weights_to_fp8.py b/tests/pytorch/distributed/test_cast_master_weights_to_fp8.py index 352a05c66..a8fca0577 100644 --- a/tests/pytorch/distributed/test_cast_master_weights_to_fp8.py +++ b/tests/pytorch/distributed/test_cast_master_weights_to_fp8.py @@ -1,3 +1,5 @@ +# This file was modified for portability to AMDGPU. +# Copyright (c) 2026, Advanced Micro Devices, Inc. All rights reserved. # Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # See LICENSE for license information. @@ -717,7 +719,7 @@ def run_parallel_tests() -> None: @pytest.mark.parametrize("world_size", [2]) def test_cast_master_weights_to_fp8(world_size: int) -> None: """Launch parallel job that runs parallel tests""" - # Use executable as-is; do not resolve() or a venv symlink may point to system + # ROCm: Use executable as-is; do not resolve() or a venv symlink may point to system # Python which does not have torch/site-packages. python_exe = pathlib.Path(sys.executable) current_file = pathlib.Path(__file__).resolve()