Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _trtllm_fp8_prequant_linear_core(
enable_cuda_core = False
if torch.cuda.is_available():
capability = torch.cuda.get_device_capability(0)
enable_cuda_core = capability == (8, 9) or capability == (12, 0)
enable_cuda_core = capability in ((8, 9), (12, 0), (12, 1))

if x.shape[0] <= 8 and enable_cuda_core:
output = torch.ops.trtllm.cuda_scaled_mm(
Expand Down
5 changes: 2 additions & 3 deletions tensorrt_llm/_torch/modules/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -3273,9 +3273,8 @@ def __init__(
if torch.cuda.is_available():
capability = torch.cuda.get_device_capability(
torch.device('cuda:0'))
# enable cuda core for sm89 and sm120
self.enable_cuda_core = (capability[0] == 8 and capability[1] == 9) \
or (capability[0] == 12 and capability[1] == 0)
# enable cuda core for sm89, sm120 and sm121
self.enable_cuda_core = capability in ((8, 9), (12, 0), (12, 1))

if not skip_create_weights_in_init:
self.create_weights()
Expand Down