Commit Graph

396 Commits

Author SHA1 Message Date
Zoltan Lakatos
e2a75d6653 Merge remote-tracking branch 'origin/feature/multiple-d-gemms' into 8-implement-device_gemm_add_multiply-for-rdna4 2025-07-14 11:59:26 +00:00
Apoorva Kalyani
27c0f95552 Merge branch '79-add-instances-and-examples-for-device_gemm_add_relu' into 'feature/multiple-d-gemms'
Resolve "Add instances and examples for device_gemm_add_relu"

See merge request amd/ai/composable_kernel!29
2025-07-14 11:46:24 +00:00
Apoorva Kalyani
9c1314de6d Merge branch '51-create-bf16-and-f16-instances-for-gemm_add-cshuffle_v3-for-rdna4' into 'feature/multiple-d-gemms'
Resolve "Create bf16 and f16 instances for gemm_add CShuffle_v3 for RDNA4"

See merge request amd/ai/composable_kernel!17
2025-07-14 11:45:57 +00:00
Zoltan Lakatos
41d4500509 Merge remote-tracking branch 'origin/feature/multiple-d-gemms' into 8-implement-device_gemm_add_multiply-for-rdna4 2025-07-11 13:27:04 +00:00
apoorva
e6ea4aaf6d Fixed typo. 2025-07-09 10:55:21 +00:00
apoorva
76f4bb0e60 Added missing wrapper instances 2025-07-09 09:22:02 +00:00
apoorva
32125077e7 Fixed the if condition MACROS. 2025-07-09 08:03:09 +00:00
apoorva
55299c924e Fixed the review comments 2025-07-09 07:33:14 +00:00
apoorva
669befb25a Updated copyrights and added wrappers. 2025-07-08 12:06:38 +00:00
apoorva
9b64da2298 Added wrapper and renamed the wmma_v3 instances 2025-07-08 11:26:01 +00:00
apoorva
6ec0ad2758 Added test for gemm_add_relu wmma instance 2025-07-01 13:44:18 +00:00
apoorva
35aab35d96 Added bf16 wmma instance for add_relu 2025-07-01 11:23:17 +00:00
Zoltan Lakatos
eaa0452b80 Merge remote-tracking branch 'origin/feature/multiple-d-gemms' into 64-implement-device_gemm_multiply_multiply_instance-for-rdna4 2025-06-30 11:06:09 +00:00
Zoltan Lakatos
6ba1dc66ac Merge remote-tracking branch 'origin/feature/multiple-d-gemms' into 8-implement-device_gemm_add_multiply-for-rdna4 2025-06-30 11:03:13 +00:00
Zoltán Lakatos
686df332e2 Resolve "Implement device_gemm_bilinear for RDNA4" 2025-06-26 06:48:38 +00:00
Zoltan Lakatos
3c3136be79 added fp8 instances 2025-06-24 16:05:42 +00:00
Zoltan Lakatos
5e454276e3 fp8 instances - not tested 2025-06-19 10:57:38 +00:00
apoorva
38d00277c2 Updated tests. 2025-06-19 10:56:18 +00:00
apoorva
ef781db305 Fixing build errors 2025-06-19 09:47:36 +00:00
apoorva
0cce81c3e7 Code update of template parameters modified. 2025-06-19 09:47:07 +00:00
Apoorva Kalyani
1fda4990ad added datatype and use clang-format-12
(cherry picked from commit ae4e853682ef1bb27784b2f965b4a66b3751ceec)

Co-authored-by: Cenxuan <cenxuan@streamhpc.com>
2025-06-19 09:47:06 +00:00
Apoorva Kalyani
455275de80 temp work saved, changed the BDataType to f16 or bf16 since wmma currently not support non-equal A and B datatype
(cherry picked from commit 22fbd68f1db458ab50780a394ee2544c7a1484d1)

Co-authored-by: Cenxuan <cenxuan@streamhpc.com>
2025-06-19 09:47:06 +00:00
Apoorva Kalyani
b42b6b67a5 adding gemm_add wmma_cshuffle and other support
(cherry picked from commit ec447e7f564095ea969eddc39ec77b843aa52976)

Co-authored-by: Cenxuan <cenxuan@streamhpc.com>
2025-06-19 09:45:34 +00:00
Zoltan Lakatos
40ce862cdf Merge remote-tracking branch 'origin/feature/multiple-d-gemms' into 64-implement-device_gemm_multiply_multiply_instance-for-rdna4 2025-06-18 14:46:38 +00:00
Zoltan Lakatos
ac60286ed0 added wmma multiply_multiply instances 2025-06-17 19:46:22 +00:00
Zoltan Lakatos
a529e3ee96 multiply_add instances created 2025-06-13 08:36:51 +00:00
Zoltan Lakatos
264e1b238a created fastegelu instances 2025-06-11 14:14:43 +00:00
Zoltan Lakatos
4c8ea9517d created gemm_add_add_fastgelu instances 2025-06-11 12:46:42 +00:00
Zoltan Lakatos
ea9805b580 added add_fastgelu instances 2025-06-10 17:23:44 +00:00
Zoltan Lakatos
32e78b6c29 Merge remote-tracking branch 'origin/feature/multiple-d-gemms' into 8-implement-device_gemm_add_multiply-for-rdna4 2025-06-05 14:57:38 +00:00
Zoltan Lakatos
4e070857ad switched to splitK interface 2025-06-04 12:11:20 +00:00
Anton Gorenko
9912e5f09c Add a special wrapper to use DeviceGemmMultipleD_Wmma_CShuffleV3 with old API
ckProfiler uses DeviceGemmMultipleD (tests also call its functions), the wrapper allows to use
DeviceGemmMultipleDSplitK instances there.
2025-06-04 12:34:26 +05:00
Anton Gorenko
381c02d06a Add gemm_add_fastgelu instances and test 2025-06-04 12:34:26 +05:00
Anton Gorenko
52b4860a30 WMMA GEMM universal pipeline v1, mixed precision and paddings, examples (#2230)
* Fixed cmake errors related to  gemm_bilinear. Previously, if the above flags are set, cmake build fails: GPU_TARGETS="gfx1100;gfx1201" -D DTYPES="fp16;bf16;fp8"

* Fixed cmake build errors related to test_fp8

* Updates to support mixed precision

* Adding support for RRR, F8xF16xF16 gemm_universal_wmma - wip

* Added support for F8xF16xF16 to gemm_wmma_universal

* Added support for F16xF8xF16 to gemm_wmma_universal

* Added support for BF16xI4xBF16 to gemm_wmma_universal

* Added support for F16xI4xF16 to gemm_wmma_universal

* Fixed IsSupportedArgument to check ComputeTypeA, ComputeTypeB instead of ADataType, BDataType

* Added missing test class for FP16_KM_NK

* Pre-commit hooks fixes

* Added padding instances for f16xf16xf16

* Fixed cmake errors related to  gemm_bilinear. Previously, if the above flags are set, cmake build fails: GPU_TARGETS="gfx1100;gfx1201" -D DTYPES="fp16;bf16;fp8"

* Fixed cmake build errors related to test_fp8

* Ammending changes for adding support for padding instances for f16xf16xf16

* Fixes for padding instances for f16xf16xf16

* Added padding instances for bf16xbf16, f8xf8

* Added packed instances for bf16xi4xbf16

* Added padding instances for f8xf16xf16

* Added padding instances for f16xf8xf16, f16xi4xf16

* Fixed typos for bf16xbf16xbf16 padding instances

* Fixed typos for padded instances

* Added tests for fp16, KM_KN and KM_NK

* Padding not supported for when BDataType is pk_i4_t. Added fix for correct check and removed padding instances.

* Fixed typos

* Updated the set of tests for FP16

* Updated the set of tests for FP16

* Fix typo

* Moved f16xi4 test under the correct data layout group

* example for gemm_universal_bf16

* Adding examples for gemm_wmma instances

* Added the  missing parameters

* Fixed review comments and added executable to cmakeLists

* Fixing clang format

* Fixing build erros

* Fixed compilation failure.

* Modified some code as per gemm_universal_examples

* Fixed the gemm specialization error

* Fixed the build errors.

* Fix strides of a/b_thread_desc

The descriptors are larger than needed (even though the compiler don't alloc registers for unused values).

* Load in M/NRepeat dims with thread copy's slice instead of a loop

* Clone BlockwiseGemmXdlops_pipeline_v1 for WMMA implementation

* Implement Intrawave and Interwave variants of pipeline v1

* Add instances for Interwave and Intrawave v1

* Add instances with ABlockLdsExtraM and BBlockLdsExtraN = 0

* Remove instances that are too slow (mostly because of register spilling)

* Add a workaround for fp8/bf8->f32 packed conversion issue

* Add instances for Interwave and Intrawave v1

* Enable profiling of mixed precision with f8 and int4 on WMMA

* Fix segfault in profiler when B is pk_i4_t

b_device_buf's size in bytes is larger than b_k_n_permute so b_device_buf.ToDevice reads out-of-bounds.

* Remove instances that are too slow (mostly because of register spilling)

* Add missing add_device_gemm_wmma_universal_f8_f8_bf16 declarations

* Add test case for bf16_i4

* Add missing Regular tests

* Add test_gemm_universal_xdl/wmma_fp16 to REGRESSION_TESTS

They take more than 30 seconds

* Fix a bug that fp16_i4 validation passes only with PermuteB

A permutation required by conversion from pk_i4_t to half_t does not
depend on PermuteB, they can be used independently.

* Use PermuteB with f16_i4 in most instances (as xdl)

Some instances use PermuteB = false for checking correctness.
See also the previous commit.

* Fix cache flushing for pk_i4

* Add mixed precision examples

* Disable all tests and instances with f8 on gfx11

Even though f8_f16 and f16_f8 don't require f8 WMMA instructions,
gfx11 still lacks hardware instructions for fast f8->f32 conversion.

* Add FP16 KM_NK and KM_KN test suites for XDL

These tests were added to common .inc for better testing of WMMA instances

* Fix int8 DTYPES check for gemm_bilinear

---------

Co-authored-by: Anca Hamuraru <anca@streamhpc.com>
Co-authored-by: Apoorva Kalyani <apoorva@streamhpc.com>
2025-06-04 12:22:33 +06:00
Bartłomiej Kocot
6e5acee0f9 Add Clamp/Relu bf16/fp16 cast fixes (#2279)
* Add Clamp/Relu bf16/fp16 fixes

* fix
2025-06-03 18:31:46 +02:00
Zoltan Lakatos
538fa87141 initial gemm_add_multiply instance implementations 2025-06-03 13:49:45 +00:00
Anton Gorenko
959defbb22 Add a special wrapper to use DeviceGemmMultipleD_Wmma_CShuffleV3 with old API
ckProfiler uses DeviceGemmMultipleD (tests also call its functions), the wrapper allows to use
DeviceGemmMultipleDSplitK instances there.
2025-06-02 15:51:12 +05:00
Anton Gorenko
25f7204de2 Add gemm_add_fastgelu instances and test 2025-06-02 15:30:21 +05:00
Bartłomiej Kocot
e7906dd644 Change relu to clamp for grouped conv fwd instances (#2249) 2025-05-29 00:51:25 +02:00
Bartłomiej Kocot
b1ed92b131 Revert "Remove not needed bwd wei merged groups instances (#2218)" (#2235)
This reverts commit 4583aeffad.
2025-05-26 23:26:04 +02:00
Bartłomiej Kocot
4583aeffad Remove not needed bwd wei merged groups instances (#2218)
* Grouped conv bwd wei add two stage instances for larger filter and Merge Groups

* Fix

* fix

* Revert "Restore oddc instances (#2201)"

This reverts commit 6342f6b5e8.

* fix

---------

Co-authored-by: Rostyslav Geyyer <46627076+geyyer@users.noreply.github.com>
2025-05-26 22:46:18 +02:00
Anton Gorenko
2679c0aa2b Disable all tests and instances with f8 on gfx11
Even though f8_f16 and f16_f8 don't require f8 WMMA instructions,
gfx11 still lacks hardware instructions for fast f8->f32 conversion.
2025-05-23 15:17:36 +05:00
Anton Gorenko
02bf56a6de Add missing add_device_gemm_wmma_universal_f8_f8_bf16 declarations 2025-05-23 10:53:42 +05:00
Bartłomiej Kocot
ebc5a6ef87 Grouped conv bwd wei add for larger filter and Merge Groupes optimization (#2197)
* Grouped conv bwd wei add two stage instances for larger filter and Merge Groups

* Fix

* fix

* Restore removed instances

---------

Co-authored-by: Rostyslav Geyyer <46627076+geyyer@users.noreply.github.com>
2025-05-21 22:47:34 +02:00
Anca Hamuraru
185ea0fdc4 Fix typo 2025-05-20 13:45:48 +00:00
Anca Hamuraru
0a5e6d48ec Fixed typos 2025-05-20 13:16:12 +00:00
Anca Hamuraru
a08ca63b36 Padding not supported for when BDataType is pk_i4_t. Added fix for correct check and removed padding instances. 2025-05-20 13:14:07 +00:00
Andriy Roshchenko
57e0f5df29 MX GEMM - Expand MX MFMA Testing to BF8, FP6, and BF6 Data Types (#2199)
* Unify test interface for different layouts.

* WIP: Introducing FP4/FP6/FP8 abstractions

* WIP: Introducing packed storage abstraction

* WIP: Introducing packed storage abstraction

* WIP: Improved support for FP6 data type

* Refactor packed storage for f6_t

* WIP: FP6 MFMA test

* Test if we correctly represent all FP6/FP4 numbers

* Additional output for failed FP4 test.

* More failing conversion tests

* Even more failing conversion tests

* Working FP6 MFMA tests

* Expand MX MFMA testing to BF8/6

* Update and verify MX MFMA test for packed types

* Fix fp4 and fp6 conversions on host

* Working MX MFMA tests for FP8/6/4

* Cleanup

* Add missing type

* Cleanup

* Final cleanup

* Restrict FP6/4 values output to CK_LOGGING=1

* Use CHAR_BIT instead of number 8

* Fix typo

* Remove FP6 and FP4 from the list of native types

---------

Co-authored-by: Rostyslav Geyyer <rosty.geyyer@amd.com>
2025-05-19 16:52:51 -05:00
Anca Hamuraru
7975c9cea6 Fixed typos for padded instances 2025-05-19 14:51:56 +00:00
Anca Hamuraru
a0a2bf27b1 Fixed typos for bf16xbf16xbf16 padding instances 2025-05-19 13:08:05 +00:00