ROCm: Allow setting compilation target (#2581)
This commit is contained in:
parent
1b20639a43
commit
ea8489fce2
14
setup.py
14
setup.py
@ -287,11 +287,15 @@ if _is_cuda():
|
||||
},
|
||||
))
|
||||
elif _is_hip():
|
||||
amd_arch = get_amdgpu_offload_arch()
|
||||
if amd_arch not in ROCM_SUPPORTED_ARCHS:
|
||||
raise RuntimeError(
|
||||
f"Only the following arch is supported: {ROCM_SUPPORTED_ARCHS}"
|
||||
f"amdgpu_arch_found: {amd_arch}")
|
||||
amd_archs = os.getenv("GPU_ARCHS")
|
||||
if amd_archs is None:
|
||||
amd_archs = get_amdgpu_offload_arch()
|
||||
for arch in amd_archs.split(";"):
|
||||
if arch not in ROCM_SUPPORTED_ARCHS:
|
||||
raise RuntimeError(
|
||||
f"Only the following arch is supported: {ROCM_SUPPORTED_ARCHS}"
|
||||
f"amdgpu_arch_found: {arch}")
|
||||
NVCC_FLAGS += [f"--offload-arch={arch}"]
|
||||
|
||||
elif _is_neuron():
|
||||
neuronxcc_version = get_neuronxcc_version()
|
||||
|
Loading…
x
Reference in New Issue
Block a user