Conversation
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
| # Quantized wrappers can report a logical BF16 dtype. | ||
| if isinstance(tensor, QuantizedTensorStorage): | ||
| raise NotImplementedError("Quantized inputs and outputs are not supported.") | ||
| if isinstance(tensor, GroupedTensorStorage): |
There was a problem hiding this comment.
This looks silly -- why is GroupedTensorStorage used for non-quantized where the only field people care is rowwise_data?
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
|
| if bias_scale is not None: | ||
| bias_data = bias_data * bias_scale[:, None] |
There was a problem hiding this comment.
When packed input storage has unused capacity beyond offsets[-1], result and the expanded bias_data include those extra rows, while bias_scale contains only the logical token rows. This multiplication therefore raises a size-mismatch error before the later torch.where can preserve the unused output capacity. Please limit scaling to the logical prefix or otherwise account for the capacity rows.
Knowledge Base Used: Native GEMM and quantization kernels
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
Description
Motivated by NVIDIA/Megatron-LM#7400: on GB200, grouped BF16 GEMM can retain old output values despite beta=0 while NCCL all-gather and reduce-scatter run concurrently. The issue includes a standalone cuBLASLt + NCCL reproducer without PyTorch or TE. The underlying cause remains unresolved.
This PR extends
NVTE_USE_CUTLASS_GROUPED_GEMM=1to the graph-safe BF16 GroupedLinear path on SM100 usingtorch._grouped_mm. It provides an alternative to the affected cuBLASLt path while preserving independent communication streams and CUDA graph support.Type of change
Changes
NVTE_GROUPED_LINEAR_USE_FUSED_GROUPED_GEMM=1; Hopper keeps its existing dispatch. If PyTorch exposestorch.backends.cuda.matmul.prefer_cublaslt_grouped_gemm, it must beFalse.The implementation uses temporary weight/output buffers. No performance improvement is claimed.
Validation
GPU validation used GB200, PyTorch
2.14.0a0+4fdf77b940.nv26.08, and TE2.18.0+27486e03:_grouped_mm.git diff --checkpassed.This draft ports the change onto
main. The new GEMM helper and shared dispatch function are identical to the GPU-tested versions; the port only required resolving imports. A fresh native build/test on thismainrevision and a physical Hopper run remain outstanding.Checklist