Skip to content

tune triton-fp8w8a8g64 and triton-fp8w8a8g128 in 4090D#1216

Merged
hiworldwzj merged 2 commits intomainfrom
wzh_tune
Mar 3, 2026
Merged

tune triton-fp8w8a8g64 and triton-fp8w8a8g128 in 4090D#1216
hiworldwzj merged 2 commits intomainfrom
wzh_tune

Conversation

@WANDY666
Copy link
Contributor

@WANDY666 WANDY666 commented Mar 3, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 integrates new autotuned Triton kernel configurations into the LightLLM project. These additions are crucial for optimizing the performance of scaled_mm_act_per_group_w_perchannel operations on NVIDIA GeForce RTX 4090 D and RTX 5090 GPUs. By providing specific tuning parameters for different matrix dimensions and activation quantization group sizes (64 and 128), the changes aim to significantly improve the efficiency and speed of FP8 weight and activation quantization on these target hardware platforms.

Highlights

  • New Triton Kernel Configurations for RTX 4090 D: Added a comprehensive set of autotuned Triton kernel configurations specifically for the NVIDIA GeForce RTX 4090 D GPU, covering various K, N, and act_quant_group_size parameters (64 and 128).
  • New Triton Kernel Configurations for RTX 5090: Introduced a new collection of autotuned Triton kernel configurations tailored for the NVIDIA GeForce RTX 5090 GPU, supporting diverse K, N, and act_quant_group_size values (64 and 128).
  • Performance Optimization for FP8 Quantization: These new configurations are designed to optimize the performance of scaled_mm_act_per_group_w_perchannel kernels, enhancing efficiency for FP8 weight and activation quantization on the specified NVIDIA GPUs.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=14336,N=5120,act_quant_group_size=128}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=14336,N=5120,act_quant_group_size=64}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=4096,N=5120,act_quant_group_size=128}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=4096,N=5120,act_quant_group_size=64}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=2048,act_quant_group_size=128}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=2048,act_quant_group_size=64}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=28672,act_quant_group_size=128}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=28672,act_quant_group_size=64}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=4096,act_quant_group_size=128}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_4090_D/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=4096,act_quant_group_size=64}_NVIDIA_GeForce_RTX_4090_D.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=14336,N=5120,act_quant_group_size=128}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=14336,N=5120,act_quant_group_size=64}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=4096,N=5120,act_quant_group_size=128}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=4096,N=5120,act_quant_group_size=64}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=2048,act_quant_group_size=128}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=2048,act_quant_group_size=64}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=28672,act_quant_group_size=128}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=28672,act_quant_group_size=64}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=4096,act_quant_group_size=128}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
  • lightllm/common/triton_utils/autotune_kernel_configs/triton_3.5.1/NVIDIA_GeForce_RTX_5090/scaled_mm_act_per_group_w_perchannel:v1/{K=5120,N=4096,act_quant_group_size=64}_NVIDIA_GeForce_RTX_5090.json
    • Added new Triton kernel autotuning configuration.
Activity
  • No human activity detected in this pull request.
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.

@hiworldwzj hiworldwzj merged commit f5ee4c3 into main Mar 3, 2026
1 check passed
@hiworldwzj hiworldwzj deleted the wzh_tune branch March 3, 2026 02:28
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 adds autotuned Triton kernel configurations for scaled_mm_act_per_group_w_perchannel on NVIDIA GeForce RTX 4090D and RTX 5090 GPUs. The changes consist of adding several JSON configuration files for various problem sizes. While the addition of tuned configurations is beneficial for performance, I've noticed a minor maintainability issue in the new JSON files. The keys, which correspond to matrix dimensions, are not sorted, making the files difficult to read and compare. I've left a comment with a suggestion to sort the keys numerically. This should be applied to all new configuration files. Also, the pull request title only mentions the 4090D, but configurations for the 5090 are also included. It would be good to update the title to accurately reflect the scope of the changes.

Comment on lines +1 to +74
{
"1": {
"BLOCK_K": 128,
"BLOCK_M": 8,
"BLOCK_N": 64,
"GROUP_M": 8,
"num_stages": 6,
"num_warps": 4
},
"100": {
"BLOCK_K": 128,
"BLOCK_M": 64,
"BLOCK_N": 128,
"GROUP_M": 8,
"num_stages": 4,
"num_warps": 8
},
"1024": {
"BLOCK_K": 128,
"BLOCK_M": 64,
"BLOCK_N": 64,
"GROUP_M": 8,
"num_stages": 3,
"num_warps": 4
},
"128": {
"BLOCK_K": 128,
"BLOCK_M": 64,
"BLOCK_N": 64,
"GROUP_M": 8,
"num_stages": 4,
"num_warps": 4
},
"16": {
"BLOCK_K": 128,
"BLOCK_M": 16,
"BLOCK_N": 64,
"GROUP_M": 8,
"num_stages": 4,
"num_warps": 4
},
"256": {
"BLOCK_K": 128,
"BLOCK_M": 64,
"BLOCK_N": 64,
"GROUP_M": 8,
"num_stages": 3,
"num_warps": 4
},
"32": {
"BLOCK_K": 128,
"BLOCK_M": 32,
"BLOCK_N": 64,
"GROUP_M": 8,
"num_stages": 4,
"num_warps": 8
},
"64": {
"BLOCK_K": 128,
"BLOCK_M": 64,
"BLOCK_N": 64,
"GROUP_M": 8,
"num_stages": 3,
"num_warps": 4
},
"8": {
"BLOCK_K": 128,
"BLOCK_M": 8,
"BLOCK_N": 64,
"GROUP_M": 8,
"num_stages": 5,
"num_warps": 4
}
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The keys in this JSON file, which represent the 'M' dimension for tuning, are not sorted. This makes the file difficult to read and maintain. Please sort the keys numerically to improve readability. This should be applied to all new JSON configuration files in this pull request.

{
  "1": {
    "BLOCK_K": 128,
    "BLOCK_M": 8,
    "BLOCK_N": 64,
    "GROUP_M": 8,
    "num_stages": 6,
    "num_warps": 4
  },
  "8": {
    "BLOCK_K": 128,
    "BLOCK_M": 8,
    "BLOCK_N": 64,
    "GROUP_M": 8,
    "num_stages": 5,
    "num_warps": 4
  },
  "16": {
    "BLOCK_K": 128,
    "BLOCK_M": 16,
    "BLOCK_N": 64,
    "GROUP_M": 8,
    "num_stages": 4,
    "num_warps": 4
  },
  "32": {
    "BLOCK_K": 128,
    "BLOCK_M": 32,
    "BLOCK_N": 64,
    "GROUP_M": 8,
    "num_stages": 4,
    "num_warps": 8
  },
  "64": {
    "BLOCK_K": 128,
    "BLOCK_M": 64,
    "BLOCK_N": 64,
    "GROUP_M": 8,
    "num_stages": 3,
    "num_warps": 4
  },
  "100": {
    "BLOCK_K": 128,
    "BLOCK_M": 64,
    "BLOCK_N": 128,
    "GROUP_M": 8,
    "num_stages": 4,
    "num_warps": 8
  },
  "128": {
    "BLOCK_K": 128,
    "BLOCK_M": 64,
    "BLOCK_N": 64,
    "GROUP_M": 8,
    "num_stages": 4,
    "num_warps": 4
  },
  "256": {
    "BLOCK_K": 128,
    "BLOCK_M": 64,
    "BLOCK_N": 64,
    "GROUP_M": 8,
    "num_stages": 3,
    "num_warps": 4
  },
  "1024": {
    "BLOCK_K": 128,
    "BLOCK_M": 64,
    "BLOCK_N": 64,
    "GROUP_M": 8,
    "num_stages": 3,
    "num_warps": 4
  }
}

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