Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
url = https://github.com/zeromq/cppzmq.git
[submodule "3rdparty/DeepGEMM"]
path = 3rdparty/DeepGEMM
url = https://github.com/deepseek-ai/DeepGEMM.git
url = https://github.com/ruoqianguo/DeepGEMM.git
branch = dev/ruoqiang/swapab_sm100
11 changes: 6 additions & 5 deletions tensorrt_llm/_torch/custom_ops/torch_custom_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,9 @@ def get_valid_tactics(
inputs: List[torch.Tensor],
profile: OptimizationProfile,
) -> List[int]:
# Encode swap_ab as False (0) and True (1). Currently only add one tactic here.
return [0]
# Encode swap_ab as False (0) and True (1). Currently enabled when GEMM m <= 128.
input, _, _ = inputs
return [0, 1] if input.shape[0] <= 128 else [0]

def forward(
self,
Expand All @@ -941,9 +942,9 @@ def forward(
device=input.device,
dtype=self.output_dtype,
)
# TODO: add swap_ab=tactic == 0 to detemrmine the swap_ab value
# Treat the default tactic=-1 as swap_ab=False
deep_gemm.fp8_gemm_nt(

forward_func = deep_gemm.fp8_gemm_ntt if tactic == 1 else deep_gemm.fp8_gemm_nt
forward_func(
(a, a_sf),
(weight, weight_scale),
output,
Expand Down