Skip to content

[Not for land] remove workaround for slow rowwise cutlass gemm #2185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
16 changes: 0 additions & 16 deletions torchao/float8/float8_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,6 @@ def addmm_float8_unwrapped(
a_inverse_scale = a_scale.reciprocal()
b_inverse_scale = b_scale.reciprocal()

post_inverse_scale = None
is_rowwise_scaling = a_scale.shape == (a_data.shape[0], 1) and b_scale.shape == (
1,
b_data.shape[1],
)

if is_rowwise_scaling and not use_fast_accum:
# The rowwise CUTLASS-based kernel is so slow without fast-accum that
# we'd rather use the tensorwise cuBLAS-based kernel and do the scaling
# manually afterwards (hoping Inductor will be able to fuse it).
post_inverse_scale = a_inverse_scale * b_inverse_scale
a_inverse_scale = a_inverse_scale.new_ones(())
b_inverse_scale = a_inverse_scale.new_ones(())

post_bias = None
if output_dtype == torch.float32:
# Bias is not supported by _scaled_mm when output is fp32
Expand All @@ -71,8 +57,6 @@ def addmm_float8_unwrapped(
use_fast_accum=use_fast_accum,
)

if post_inverse_scale is not None:
output *= post_inverse_scale
if post_bias is not None:
output += post_bias

Expand Down
Loading