[torch.compile] Add support for non-contiguous fused RMSNorm + group quant (#36551)
Signed-off-by: Luka Govedič <lgovedic@redhat.com> Signed-off-by: Luka Govedič <ProExpertProg@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
ProExpertProg
parent
a1a3523a56
commit
9556af87d5
+2
-2
@@ -427,7 +427,7 @@ def rms_norm_dynamic_per_token_quant(
|
||||
scale_ub: torch.Tensor | None = None,
|
||||
residual: torch.Tensor | None = None,
|
||||
) -> tuple[torch.Tensor, torch.Tensor]:
|
||||
output = torch.empty_like(input, dtype=quant_dtype)
|
||||
output = torch.empty(input.shape, dtype=quant_dtype, device=input.device)
|
||||
scales = torch.empty(
|
||||
(input.numel() // input.shape[-1], 1), device=input.device, dtype=torch.float32
|
||||
)
|
||||
@@ -451,7 +451,7 @@ def rms_norm_per_block_quant(
|
||||
tma_alignment: int = 0,
|
||||
) -> tuple[torch.Tensor, torch.Tensor]:
|
||||
assert len(group_size) == 2
|
||||
output = torch.empty_like(input, dtype=quant_dtype)
|
||||
output = torch.empty(input.shape, dtype=quant_dtype, device=input.device)
|
||||
if is_scale_transposed:
|
||||
if tma_alignment == 0:
|
||||
scales = torch.empty(
|
||||
|
||||
Reference in New Issue
Block a user