Skip to content

Conversation

Edenzzzz
Copy link
Contributor

@Edenzzzz Edenzzzz commented Oct 7, 2025

📌 Description

Before it couldn't run due to missing layout
image

After

image image

🔍 Related Issues

🚀 Pull Request Checklist

Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.

✅ Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit (or used your preferred method).
  • I have installed the hooks with pre-commit install.
  • I have run the hooks manually with pre-commit run --all-files and fixed any reported issues.

If you are unsure about how to set up pre-commit, see the pre-commit documentation.

🧪 Tests

  • Tests have been added or updated as needed.
  • All tests are passing (unittest, etc.).

Reviewer Notes

Copy link
Contributor

Summary of Changes

Hello @Edenzzzz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical runtime error in the B200 GEMM benchmark by correctly specifying a missing layout parameter, ensuring the benchmark can execute as intended. Additionally, it enhances the TGV GEMM benchmark by integrating TFLOPS calculations into the output, offering a more comprehensive view of performance for various GEMM implementations.

Highlights

  • B200 GEMM Benchmark Fix: Resolved a runtime issue in the B200 GEMM benchmark by explicitly setting the scale_major_mode parameter to 'MN' in the gemm_fp8_nt_groupwise function calls, which was previously missing.
  • TGV GEMM Benchmark Output Enhancement: Improved the output of the TGV GEMM benchmark by adding TFLOPS (Tera Floating-point Operations Per Second) calculations and display for CUBLAS, TGV, and PDL average times, providing more detailed performance metrics.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes a benchmark for B200 GEMM by adding the required scale_major_mode parameter and enhances another benchmark by adding TFLOPS reporting. The changes are correct and improve the benchmarks. I have one suggestion to improve code readability by replacing magic numbers with named constants.

for m, n, k, has_bias, description in test_cases:
print(f"\n--- {description}: M={m}, N={n}, K={k}, has_bias={has_bias} ---")

flops = m * n * k * 2 / 1e12
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve readability and maintainability, it's a good practice to avoid using magic numbers. Consider defining 2 and 1e12 as named constants with descriptive names.

Suggested change
flops = m * n * k * 2 / 1e12
FLOPS_PER_MAC = 2
TFLOPS_SCALE = 1e12
flops = (m * n * k * FLOPS_PER_MAC) / TFLOPS_SCALE

@yzh119 yzh119 requested a review from bkryu October 7, 2025 22:41
Copy link
Collaborator

@bkryu bkryu left a comment

Choose a reason for hiding this comment

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

Thanks @Edenzzzz for fixing the broken benchmark. The groupwise gemm seems to have been broken since #1358. The TFLOPs/s addition to tgv gemms lgtm.

Looks good except for the pre-commit failure. Can you install & run pre-commit, and update the PR?

Copy link
Collaborator

@bkryu bkryu left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. LGTM

@bkryu
Copy link
Collaborator

bkryu commented Oct 8, 2025

@Edenzzzz, to address the CI failures, you I suggest you try rebasing your branch or merging from main.

@bkryu bkryu merged commit 9c6c265 into flashinfer-ai:main Oct 8, 2025
3 checks passed
@Edenzzzz Edenzzzz deleted the gemm_bench branch October 8, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants