Skip to content

ParoQuant CUDA dispatch accepts shapes the native kernel rejects, while fallback has a dtype error #3919

Closed

Description

@Qubitium

Two linked CUDA dispatch failures (current main, 8ecc295)

ParoLinear advertises group_size=16 and output widths without a 64-channel restriction, but forward calls the native AWQ GEMM unconditionally for CUDA tensors. The native validator requires group_size % 32 == 0 and out_features % 64 == 0. A supported ParoQuant configuration such as group_size=16, in_features=16, out_features=8 therefore cannot run that kernel. There is no capability gate or caught native error to select the dense fallback. On this audit host, the unmodified CUDA forward stops earlier at AWQ JIT setup because nvcc is absent; the native shape rejection is established from its binding contract.

The dense fallback added in #3866 also fails on CUDA with FP16 activations. It reconstructs FP32 weights, then linear_wide_bias calls torch.mm(FP16 input, FP32 weight, out_dtype=FP32), which raises RuntimeError: input dtypes must be the same. In a small CUDA test using the supported 16×8 layer, packed 4-bit code 1, scale 8, bias -1024, and FP16 input filled with 516, forcing _forward_cuda_awq_kernel to return None reached this exact error. The independent FP32 packed-grid oracle rounds to a finite FP16 value of 65024.

Expected

Gate native dispatch on its real shape/device requirements and use the dense fallback for unsupported configurations. Make that fallback use compatible operand dtypes while retaining the FP32 reduction and bias epilogue. Add a CUDA test for an advertised group_size=16, narrow-output shape and its fallback result.

Activity

  1. added a commit that references this issue on Nov 18, 2026
    221cd56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions