Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ def get_extensions():
extra_link_args.append("/DEBUG")

rocm_sparse_marlin_supported = False
rocm_tiled_layout_supported = False
if use_rocm:
# naive search for hipblalst.h, if any found contain HIPBLASLT_ORDER_COL16 and VEC_EXT
found_col16 = False
Expand Down Expand Up @@ -488,8 +489,11 @@ def get_extensions():
# Define ROCm source directories
rocm_source_dirs = [
os.path.join(extensions_dir, "rocm", "swizzle"),
os.path.join(extensions_dir, "cuda", "tensor_core_tiled_layout"),
]
if rocm_tiled_layout_supported:
rocm_source_dirs.append(
os.path.join(extensions_dir, "cuda", "tensor_core_tiled_layout")
)
if rocm_sparse_marlin_supported:
rocm_source_dirs.extend([os.path.join(extensions_dir, "cuda", "sparse_marlin")])

Expand All @@ -512,14 +516,8 @@ def get_extensions():
sources = [s for s in sources if s not in mxfp8_sources_to_exclude]

# TOOD: Remove this and use what CUDA has once we fix all the builds.
# TODO: Add support for other ROCm GPUs
if use_rocm:
# Add ROCm GPU architecture check
gpu_arch = None
if torch.cuda.is_available():
gpu_arch = torch.cuda.get_device_properties(0).name
if gpu_arch and gpu_arch != "gfx942":
print(f"Warning: Unsupported ROCm GPU architecture: {gpu_arch}")
print("Currently only gfx942 is supported. Compiling only for gfx942.")
extra_compile_args["nvcc"].append("--offload-arch=gfx942")
sources += rocm_sources
else:
Expand Down
Loading