[ROCm][Regression] Remove tensor creation that harms performance on ROCm (#20741)

Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
This commit is contained in:
Gregory Shtrasberg
2025-07-10 12:22:23 -04:00
committed by GitHub
parent c7753a9809
commit 5b8366b61a

View File

@ -247,10 +247,6 @@ class RocmPlatform(Platform):
Set the device for the current platform.
"""
torch.cuda.set_device(device)
# With this trick we can force the device to be set eagerly
# see https://github.com/pytorch/pytorch/issues/155668
# for why and when it is needed
_ = torch.zeros(1, device=device)
@classmethod
@lru_cache(maxsize=8)