@triton.jit
def matmul_kernel_simple(a_ptr, qw_ptr, c_ptr, scales_ptr, zeros_ptr,
    dbg_qwpacked_ptr, dbg_qwunpacked_ptr, dbg_dequant_ptr, dbg_scales_ptr,
    dbg_unpacked_zeros_ptr, dbg_to_add_ptr, M, N, K, BLOCK_SIZE_M: tl.
    constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr,
    GROUP_SIZE_M: tl.constexpr, QUANT_GROUP_SIZE: tl.constexpr):
    """Kernel for computing the matmul C = A x qw (qweights). """
    pid = tl.program_id(axis=0)
    num_pid_m = tl.cdiv(M, BLOCK_SIZE_M)
    num_pid_n = tl.cdiv(N, BLOCK_SIZE_N)
    num_pid_in_group = GROUP_SIZE_M * num_pid_n
    group_id = pid // num_pid_in_group
    first_pid_m = group_id * GROUP_SIZE_M
    group_size_m = min(num_pid_m - first_pid_m, GROUP_SIZE_M)
    pid_m = first_pid_m + pid % group_size_m
    pid_n = pid % num_pid_in_group // group_size_m
    offs_am = pid_m * BLOCK_SIZE_M + tl.arange(0, BLOCK_SIZE_M)
    offs_bn = pid_n * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)
    offs_k = tl.arange(0, BLOCK_SIZE_K)
    qw_shifter = offs_k % 8 * 4
    accumulator = tl.zeros((BLOCK_SIZE_M, BLOCK_SIZE_N), dtype=tl.float32)
    for k in range(0, 1):
        a_offs = k * BLOCK_SIZE_K + (offs_am[:, None] * K + offs_k[None, :])
        a = tl.load(a_ptr + a_offs, mask=offs_k[None, :] < K - k *
            BLOCK_SIZE_K, other=0.0)
        qw_offs = (k * BLOCK_SIZE_K + offs_k[:, None]) // 8 * N + offs_bn[
            None, :]
        qw_packed = tl.load(qw_ptr + qw_offs)
        if pid == 0 and k == 0:
            k_x_n = tl.arange(0, BLOCK_SIZE_K)[:, None
                ] * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)[None, :]
            tl.store(dbg_qwpacked_ptr + k_x_n, qw_packed)
        qw_unpacked = qw_packed >> qw_shifter[:, None] & 15
        if pid == 0 and k == 0:
            k_x_n = tl.arange(0, BLOCK_SIZE_K)[:, None
                ] * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)[None, :]
            tl.store(dbg_qwunpacked_ptr + k_x_n, qw_unpacked)
        k_iters_per_quant_group = QUANT_GROUP_SIZE // BLOCK_SIZE_K
        grp_idx = k // k_iters_per_quant_group
        grp_row_off = N * grp_idx
        col_offs = offs_bn
        scales = tl.load(scales_ptr + grp_row_off + col_offs)
        if pid == 0 and k == 0:
            tl.store(dbg_scales_ptr + tl.arange(0, BLOCK_SIZE_N), scales)
        zeros_row_off = grp_row_off // 8
        idx_within_packed = grp_idx % 8
        packed_zeros = tl.load(zeros_ptr + zeros_row_off + col_offs)
        unpacked_zeros = packed_zeros >> idx_within_packed * 4 & 15
        if pid == 0 and k == 0:
            tl.store(dbg_unpacked_zeros_ptr + tl.arange(0, BLOCK_SIZE_N),
                unpacked_zeros)
        dequantized = scales[None, :].to(tl.float32) * (qw_unpacked.to(tl.
            float32) - unpacked_zeros[None, :].to(tl.float32))
        if pid == 0 and k == 0:
            k_x_n = tl.arange(0, BLOCK_SIZE_K)[:, None
                ] * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)[None, :]
            tl.store(dbg_dequant_ptr + k_x_n, dequantized)
        to_add = tl.dot(a, dequantized.to(tl.float16))
        if pid == 0 and k == 0:
            m_x_n = tl.arange(0, BLOCK_SIZE_M)[:, None
                ] * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)[None, :]
            tl.store(dbg_to_add_ptr + m_x_n, to_add)
        accumulator += to_add
    c = accumulator.to(tl.float16)
    offs_cm = pid_m * BLOCK_SIZE_M + tl.arange(0, BLOCK_SIZE_M)
    offs_cn = pid_n * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)
    stride_cm = N
    c_ptrs = c_ptr + stride_cm * offs_cm[:, None] + offs_cn[None, :]
    c_mask = (offs_cm[:, None] < M) & (offs_cn[None, :] < N)
    tl.store(c_ptrs, c, mask=c_mask)
