Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
e3378b20
Commit
e3378b20
authored
Feb 02, 2024
by
zhuwenwen
Browse files
add gfx
parent
318e2b5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
+25
-24
setup.py
setup.py
+25
-24
No files found.
setup.py
View file @
e3378b20
...
...
@@ -67,20 +67,20 @@ CXX_FLAGS += [f"-D_GLIBCXX_USE_CXX11_ABI={ABI}"]
NVCC_FLAGS
+=
[
f
"-D_GLIBCXX_USE_CXX11_ABI=
{
ABI
}
"
]
#
def get_amdgpu_offload_arch():
#
command = "/opt/
rocm
/llvm/bin/amdgpu-offload-arch"
#
try:
#
output = subprocess.check_output([command])
#
return output.decode('utf-8').strip()
#
except subprocess.CalledProcessError as e:
#
error_message = f"Error: {e}"
#
raise RuntimeError(error_message) from e
#
except FileNotFoundError as e:
#
# If the command is not found, print an error message
#
error_message = f"The command {command} was not found."
#
raise RuntimeError(error_message) from e
#
return None
def
get_amdgpu_offload_arch
():
command
=
"/opt/
dtk-23.10
/llvm/bin/amdgpu-offload-arch"
try
:
output
=
subprocess
.
check_output
([
command
])
return
output
.
decode
(
'utf-8'
).
strip
()
except
subprocess
.
CalledProcessError
as
e
:
error_message
=
f
"Error:
{
e
}
"
raise
RuntimeError
(
error_message
)
from
e
except
FileNotFoundError
as
e
:
# If the command is not found, print an error message
error_message
=
f
"The command
{
command
}
was not found."
raise
RuntimeError
(
error_message
)
from
e
return
None
def
get_hipcc_rocm_version
():
...
...
@@ -290,16 +290,17 @@ if _is_cuda():
"nvcc"
:
NVCC_FLAGS_PUNICA
,
},
))
# elif _is_hip():
# 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_hip
():
amd_archs
=
os
.
getenv
(
"GPU_ARCHS"
)
if
amd_archs
is
None
:
# amd_archs = get_amdgpu_offload_arch()
amd_archs
=
"gfx906;gfx926"
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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment