Skip to content
Merged
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
26 changes: 20 additions & 6 deletions benchmarks/float8/float8_inference_roofline.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,27 @@ def run(
if do_benchmarks:
# create the model
if op_name == "conv2d":
m_orig = nn.Sequential(
nn.Conv2d(K_val, N_val, kernel_size, bias=False)
).to(memory_format=torch.channels_last)
if not enable_fusion_modeling:
m_orig = nn.Sequential(
nn.Conv2d(K_val, N_val, kernel_size, bias=False)
).to(memory_format=torch.channels_last)
else:
m_orig = nn.Sequential(
nn.ReLU(),
nn.Conv2d(K_val, N_val, kernel_size, bias=False),
nn.ReLU(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to have an epilogue here? It's nice to have a prologue to measure the fusion of preceding activation, but unless the conv kernel does epilogue fusion I'm not sure we need an epilogue here, it would just measure the same thing for both bf16 and lowp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I just saw conv was typically surrounded by activations/norms, do we only support prologue fusions typically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just checked, we'll have epilogue fusion for conv op. and can explore prologue fusion for the quant kernels later. so the current test is OK I think

).to(memory_format=torch.channels_last)
elif op_name == "conv3d":
m_orig = nn.Sequential(
nn.Conv3d(K_val, N_val, kernel_size, bias=False)
).to(memory_format=torch.channels_last_3d)
if not enable_fusion_modeling:
m_orig = nn.Sequential(
nn.Conv3d(K_val, N_val, kernel_size, bias=False)
).to(memory_format=torch.channels_last_3d)
else:
m_orig = nn.Sequential(
nn.ReLU(),
nn.Conv3d(K_val, N_val, kernel_size, bias=False),
nn.ReLU(),
).to(memory_format=torch.channels_last_3d)
else:
if not enable_fusion_modeling:
m_orig = nn.Sequential(nn.Linear(K_val, N_val, bias=False))
Expand Down
Loading