Skip to content
Open
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
7 changes: 5 additions & 2 deletions examples/python/CuTeDSL/blackwell/grouped_blockscaled_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2490,6 +2490,9 @@ def create_tensors_abc_for_all_groups(
strides_abc = []
ptrs_abc = []

# FP4 packing: 2 elements per byte, so the K storage dimension is halved
k_fct = 2 if ab_dtype == cutlass.Float4E2M1FN else 1

# Iterate through all groups and create tensors for each group
for group_idx, (m, n, k, l) in enumerate(problem_sizes_mnkl):
# Create tensors A, B, C
Expand All @@ -2499,15 +2502,15 @@ def create_tensors_abc_for_all_groups(
cute_tensor_a,
ref_torch_fp32_tensor_a,
stride_mk_a,
) = create_tensor_and_stride(l, m, k, a_major == "m", ab_dtype)
) = create_tensor_and_stride(l, m, k // k_fct, a_major == "m", ab_dtype)

(
ptr_b,
torch_tensor_b,
cute_tensor_b,
ref_torch_fp32_tensor_b,
stride_nk_b,
) = create_tensor_and_stride(l, n, k, b_major == "n", ab_dtype)
) = create_tensor_and_stride(l, n, k // k_fct, b_major == "n", ab_dtype)

(
ptr_c,
Expand Down