Add torch.xpu.get_arch_list and torch.xpu.get_gencode_flags for XPU (#137773)

# Motivation
Add `torch.xpu.get_arch_list()` and `torch.xpu.get_gencode_flags()` methods that return architecture list and AOT flags to preserve what flags PyTorch XPU was built with.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/137773
Approved by: https://github.com/EikanWang, https://github.com/albanD
This commit is contained in:
Yu, Guangye
2024-10-16 03:35:05 +00:00
committed by PyTorch MergeBot
parent 6d8c9be54b
commit 8cda774a03
10 changed files with 70 additions and 0 deletions

View File

@ -119,6 +119,10 @@
# These are not CUDA versions, instead, they specify what
# classes of NVIDIA hardware we should generate PTX for.
#
# TORCH_XPU_ARCH_LIST
# specify which XPU architectures to build for.
# ie `TORCH_XPU_ARCH_LIST="ats-m150,lnl-m"`
#
# PYTORCH_ROCM_ARCH
# specify which AMD GPU targets to build for.
# ie `PYTORCH_ROCM_ARCH="gfx900;gfx906"`