Skip to content

[TRITON]: GEMM, MoE and Quants Kernel/Benchmark Updates - #304

Merged
okakarpa merged 5 commits into
mainfrom
triton_gemm_a16w16
Apr 18, 2025
Merged

okakarpa merged 5 commits into
mainfrom
triton_gemm_a16w16

Conversation

@rahulbatra85

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread aiter/ops/triton/gemm_a16w16.py Resolved
Comment thread aiter/ops/triton/gemm_a16w16.py Resolved
vgokhale
vgokhale previously approved these changes Apr 16, 2025

@vgokhale vgokhale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM pending comments.

@vgokhale
vgokhale self-requested a review April 17, 2025 14:01
vgokhale
vgokhale previously approved these changes Apr 17, 2025
@rahulbatra85 rahulbatra85 changed the title [TRITON]: Add GEMM A16W16 Kernel and Benchmark [TRITON]: Add GEMM Kernels and Benchmark Updates Apr 18, 2025
@rahulbatra85 rahulbatra85 changed the title [TRITON]: Add GEMM Kernels and Benchmark Updates [TRITON]: GEMM Kernels and Benchmark Updates Apr 18, 2025
@vgokhale
vgokhale self-requested a review April 18, 2025 02:45
vgokhale
vgokhale previously approved these changes Apr 18, 2025
Rahul Batra and others added 4 commits April 18, 2025 14:45
	-Create gemm a8w8 blockscale inputs in own function
	-Adds gemm a8w8 blockscale benchmark
	-Update configs for gemm_a8w8 kernel
	- Disable Silu fused with int4
	- Disable persistent with int4
@rahulbatra85 rahulbatra85 changed the title [TRITON]: GEMM Kernels and Benchmark Updates [TRITON]: GEMM and MoE Kernels/Benchmark Updates Apr 18, 2025
@vgokhale
vgokhale self-requested a review April 18, 2025 14:48
vgokhale
vgokhale previously approved these changes Apr 18, 2025
	-Optimized per token fp8 quant kernel
	 1) Made the grid equal to num rows. Previously it was one
	    WG every 32 rows. (60us -> 5.5us)
	 2) Added cache modifiers for ld/st (5.5us -> 4.7us)
	 3) Explicit reciprocal to avoid Newton Raphson steps on
	    result (4.7 -> 3.5us)
	   Results on 128 x 8192 tensor. Roofline ~1us.

	-Fixed bug with per tensor quant
	  1) Needed a second kernel call to quantize after computing
             atomic max
	  2) Also did perf optimizations similar to the per_token quant to
             the other kernels.
@rahulbatra85 rahulbatra85 changed the title [TRITON]: GEMM and MoE Kernels/Benchmark Updates [TRITON]: GEMM, MoE and Quants Kernel/Benchmark Updates Apr 18, 2025
@okakarpa
okakarpa merged commit 432348b into main Apr 18, 2025
@okakarpa
okakarpa deleted the triton_gemm_a16w16 branch April 18, 2025 18:47
valarLip pushed a commit that referenced this pull request Mar 18, 2026
* [TRITON]: Add GEMM a16w16 kernel and benchmark

* [TRITON]: GEMM A8W8 Blockscale Updates

	-Create gemm a8w8 blockscale inputs in own function
	-Adds gemm a8w8 blockscale benchmark
	-Update configs for gemm_a8w8 kernel

* [TRITON]: Fix gemm a8w8 unit test

* [TRITON]: Disable some MoE int4 tests

	- Disable Silu fused with int4
	- Disable persistent with int4

* [TRITON]: Quant Kernel Updates

	-Optimized per token fp8 quant kernel
	 1) Made the grid equal to num rows. Previously it was one
	    WG every 32 rows. (60us -> 5.5us)
	 2) Added cache modifiers for ld/st (5.5us -> 4.7us)
	 3) Explicit reciprocal to avoid Newton Raphson steps on
	    result (4.7 -> 3.5us)
	   Results on 128 x 8192 tensor. Roofline ~1us.

	-Fixed bug with per tensor quant
	  1) Needed a second kernel call to quantize after computing
             atomic max
	  2) Also did perf optimizations similar to the per_token quant to
             the other kernels.

---------

Co-authored-by: Rahul Batra <[email protected]>
Co-authored-by: Ali Zaidy <[email protected]>
Co-authored-by: Vinayak Gokhale <[email protected]>
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.

4 participants