1. 11 Feb, 2025 1 commit
    • aledudek's avatar
      [CK_TILE] Add GetName for GEMM kernels (#1791) · 2312f4aa
      aledudek authored
      
      
      * [CK_TILE] Add GetName functions for Gemm Kernels
      
      * [CK_TILE] Add GetName for grouped gemm
      
      * [CK_TILE] Add GetName for gemm - review changes
      
      * [CK_TILE] Print also gemm problem pipeline and shape
      
      * [CK_TILE] Print also GemmPipelineScheduler
      
      * [CK_TILE] GetName - fixed Scheduler <<operator visibility
      
      * [CK_TILE] GetName info adjustments
      
      * [CK_TILE] GetName post-merge fix
      
      * [CK_TILE] GetName - add general concat function
      
      * [CK_TILE] GetName - small adjustments, format change
      
      * post merge develop fix
      
      * Remove commented code
      
      * Merge from internal (#1857)
      
      * enable batched_gemm_softmax_gemm_perm_wmma for gfx12
      
      * disable instances with blocksize=256 in attention examples
      
      * debuggging
      
      * debug
      
      * fixed lds_enabled
      
      * debugging
      
      * Fix and add limit to skiplds feature
      
      * Enable skipLds feature and fix compilation bugs
      
      * add ck_tile definitions for gfx12
      
      * fix clang format and test/wmma_op
      
      * updage instances cmake for gfx12
      
      * disable the test_wmma_op on gfx12
      
      * fix the builds for gfx950
      
      * add gfx12 and gfx950 to default target list
      
      * clean-up cmake file
      
      * Initial introduction of OFP8 data types.
      
      * Renamed FP8 and BF8 tests into FP8_FNUZ and BF8_FNUZ.
      
      * Implementation of ConvertFP32Nearest in test_fp8_ocp.
      
      * Remove dependence on possibly undeclared alias.
      
      * Implement FP8OCP test for stochastic rounding mode.
      
      * Implement FP8OCP tests for half_t type conversions.
      
      * enable bf16 atomic add on gfx950
      
      * Implement ConvertFP32Nearest test.
      
      * Implement ConvertFP32Stochastic test.
      
      * Implement ConvertFP16Nearest and ConvertFP16Stochastic tests.
      
      * Refactoring. Move FP8 definitions into a separate header file.
      
      * Enable easy switching between architectures.
      
      * Fix compilation error for gfx942 architecture.
      
      * Add fp4 type with constants
      
      * only builf gfx950 branch for gfx950 target by default
      
      * Enable OCP build of example_gemm_xdl_fp8.
      
      * Fix formatting.
      
      * fix the build logic for gfx950
      
      * Improve GEMM example verbosity.
      
      * Add constexpr where applicable.
      
      * fix the logic of enabling XDL and WMMA instances
      
      * Improve GEMM example verbosity.
      
      * Enable build of example_gemm_xdl_fp8_bf8 test.
      
      * Fix tests for gfx1101 architecture.
      
      * Build DPP examples only on gfx103 and gfx11 architectures.
      
      * Optionaly run either CPU or GPU verifications with GEMM examples.
      
      * Extend GeneratorTensor_Sequential to produce values of prescribed data types.
      
      * Add missing constructor.
      
      * Add scale type and mxfp conversions
      
      * Update conversions
      
      * Add conversion tests
      
      * Fix typo
      
      * Improve infrastructure for OFP8 data type support.
      
      * BUGFIX. Should not use FP8 as Compute/Accum data type.
      
      * Add custom target for grouped_convnd_bwd_weight tests.
      
      * Can build `tests` target on gfx950.
      
      * Bugfixes on gfx1101 architecture.
      
      * Fix dependencies.
      
      * Add stochastic rounding tests
      
      * Provide single point of truth for FP8 INF and NAN checks
      
      * Prevent instantiation of operators that are not supported by FP8 data types
      
      * Add FP8 type selection into client_axample CMakeLists.txt
      
      * Prevent sccache server from shutting down during build
      
      * Fix test success reporting logic
      
      * Change default verification method to CPU.
      
      GPU verification takes too much time to complete on the emulator.
      
      * Add scale <-> float conversions
      
      * Add scaled conversions with tests
      
      * Add device conversions
      
      * Make sure all tests and examples are built for gfx950
      
      * Facilitate testing of FP8 data types on the emulator
      
      * Introduce two new tensor generators
      
      * Enable instances built for gfx94 to be built on gfx950
      
      * Verify 35_splitk_gemm on floating point numbers.
      
      splitk gemm appears to be losing precision VS reference implementation when FP numbers are involved.
      
      * Format
      
      * Verify 04_gemm_add_add_fastgelu on floating point numbers
      
      * Verify 20_grouped_conv_bwd_weight on floating point numbers
      
      * Verify 38_grouped_conv_bwd_data_multiple_d on floating point numbers
      
      * Verify more tests on floating point data
      
      * Fix data types and improve testing verbocity.
      
      * Add fp4 vectors
      
      * Add debug tests
      
      * Upgrade to NPI 573 build docker.
      
      * Skip on gemm_universal tests.
      
      The tests take too long to complete on the emulator.
      Need to see if it is possible to reduce the scope of the testing to just FP8 data types.
      
      * Add new mfma instructions and examples
      
      * Add preprocessor directives for gfx950 specific code
      
      * Fix gfx1101 build
      
      * Document test availability
      
      * Re-enable fp8 gemms for gfx94/95
      
      * Cherry-pick GEMM Universal tests for FP8 data types
      
      * Cleanup
      
      * Add vector types and tests
      
      * Add check_err function
      
      * Add tensor generators
      
      * CK_USE_GFX94 has already been set on this branch
      
      * Fix
      
      * Address formatting issues and leftovers
      
      * Make fail/pass logic consistent within 01_gemm folder
      
      Removed multiple negations in fail/pass logic to propagate `true` as the success indicator.
      
      * Fix GPU verification reporting logic.
      
      * Update year in copyright notice.
      
      * Cleanup
      
      * Use `enum class` instead of `enum`
      
      * Remove set_property for FP8 tests
      
      * Add vector conversions
      
      * Fix
      
      * Fix linker errror
      
      * Clean up
      
      * Fix gfx950 conversions
      
      * Clean up
      
      * Fix more gfx950 conversions
      
      * Fix even more gfx950 conversions
      
      * Narrowing the scope of PR to OCP FP8 enablement only
      
      * Add tests for OCP FP8 vector_type storage
      
      * Fix client examples build
      
      * Fix typo
      
      * Update e8m0 casting
      
      * Rename E8M0 type
      
      * Update unpack method
      
      * Cleanup merge artifacts
      
      * Enable gemm kernel on all gfx9 architectures (#227)
      
      * clean-up
      
      * Implement `non_native_vector_base` with `ext_vector_type` array. (#232)
      
      * Enable support of 1, 2, 4, and 8-byte custom types in CK.
      
      * Fix pool tests for OCP FP8 data type
      
      * Fix build
      
      * Add ckProfiler gemm instances for new mfma instructions and fix ckProfiler build on MI350
      
      * fix clang format
      
      * Add new mfma instructions and examples
      
      * Add preprocessor directives for gfx950 specific code
      
      * Add ckProfiler gemm instances for new mfma instructions and fix ckProfiler build on MI350
      
      * fix clang format
      
      * Fix clang format for the newly merged files
      
      * Use the existing example instances for fp16 bf16 and int8
      
      * Remove comment on new mfma instructions in MfmaInstr
      
      * Update include/ck/tensor_operation/gpu/grid/gridwise_batched_gemm_gemm_xdl_cshuffle_v1.hpp
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      
      * merge from public repo
      
      * Fix ck build
      
      * Fix ck build
      
      * Use double for max_abs_in_val
      
      * Move scaled_type_convert functions to a separate header (#251)
      
      * re-enable building mha lib and gemm_universal_f8 instances for gfx950
      
      * Update library/src/tensor_operation_instance/gpu/CMakeLists.txt
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      
      * fix typo for CK_USE_OCP_FP8
      
      * fix typo for CK_USE_OCP_FP8
      
      * Add FP6 and BF6 types (#261)
      
      * Add a rounding flag
      
      * Add FP6 and BF6
      
      * Add tests
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      
      * Clean up
      
      ---------
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      
      * fix one more typo
      
      * Refactor E8M0 scale implementation (#262)
      
      * Refactor E8M0 scale implementation
      
      * Add MXFP6 and MXBF6 conversion methods (#270)
      
      * Add conversions
      
      * Add tests
      
      * Add docstrings
      
      * Add scaled conversions
      
      * Add fp6/bf6 tests
      
      * Remove misleading fp4 test case
      
      * Add docstrings
      
      * Clean up
      
      * Address comments
      
      * Set stricter tolerances for RNE tests
      
      * Add missing tests
      
      * Add native conversions to float
      
      * Revert "Add native conversions to float"
      
      This reverts commit 09467111f73b753c8cc3d597533b187940353dab.
      
      * Update copyright years
      
      * replace the fp6 with bf6 convert calls in test_bf6
      
      * fix test_bf6
      
      * enable smfmac test
      
      * [MX FP8] Add Scaled Type Convert Functions for OCP FP8/BF8 data types (#271)
      
      * Move scaled_type_convert functions to a separate header
      
      * Introduce MX data tests
      
      * Build MX tests only on relevant architectures
      
      * Refactor E8M0 scale implementation
      
      * Fix `config.h` typo
      
      * Cleanup deprecated symbols
      
      * Refactor `amd_ck_fp8.hpp`
      
      * `scaled_type_convert` for `f8_ocp_t`
      
      * Implement test for MX FP8 scaled type convert
      
      * Implement test for MX BF8 scaled type convert
      
      * Scaled type convert for vectors of 2 FP8 elements
      
      * Scaled type convert for vectors of 16 FP8 elements
      
      * Implementation of scaled conversion from F32 to F8
      
      * Add tests for scaled conversions from FP32 to FP8
      
      * Add documentation to the test functions
      
      * Implementation of scaled conversion from F32x2 to F8x2
      
      * Implementation of scaled conversion from F32x16 to F8x16
      
      * Implementation of scaled conversion from F32x32 to F8x32
      
      * Implementation of scaled conversion from F8x32 to F32x32
      
      * Verified on the emulator
      
      * MX FP GEMM - Example Template (#277)
      
      Temporarily uses `DeviceGemmMultiD_ABScale_Xdl_CShuffle_V3` kernel and 128x128 scaling matrices.
      Must be modified to use MX-native GEMM kernell with 16 or 32 component vectors per scale.
      
      Verified on the emulator.
      
      * Add vector support
      
      * Add tests
      
      * Add missing type aliases
      
      * Fix test naming
      
      * only build mx example for gfx950
      
      * disable CK_USE_AMD_MFMA_GFX950 by default
      
      * fic build for multiple archs
      
      * fix typo
      
      * fix typo
      
      * Update unpack signature
      
      * Fix merge
      
      * Add size checks in pack function
      
      * Add a flag
      
      * Add conversions
      
      * Fix build logic
      
      * Update pack/unpack methods
      
      * Remove unneeded AsType accessors
      
      * Add docstrings
      
      * Add a flag to config file
      
      * Test the functionality of V_MFMA_F32_16X16X128_F8F6F4 and  V_MFMA_F32_32X32X64_F8F6F4 instructions. (#293)
      
      * Introduced MFMA tests
      
      * Verified f8f6f4 MFMA Instructions
      
      * Move flag logic to scaled_type_convert header
      
      * Use pointers instead of array indices
      
      * Fix a typo
      
      * Update tests and pack functions
      
      * Fix gemm gemm on gfx950
      
      * Fix clang format
      
      * restore the default gput target lists
      
      * fix the jenkinsfile
      
      * add missing ifdef
      
      ---------
      Co-authored-by: default avatarJing Zhang <jizhan@amd.com>
      Co-authored-by: default avataraska-0096 <haocwang@amd.com>
      Co-authored-by: default avatarJun Liu <Liu.Jun@amd.com>
      Co-authored-by: default avatarAndriy Roshchenko <andriy.roshchenko@amd.com>
      Co-authored-by: default avatarRostyslav Geyyer <rosty.geyyer@amd.com>
      Co-authored-by: default avatarRostyslav Geyyer <46627076+geyyer@users.noreply.github.com>
      Co-authored-by: default avatarroot <root@banff-cyxtera-s83-2.ctr.dcgpu>
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      Co-authored-by: default avatarjefyang1 <146495389+jefyang1@users.noreply.github.com>
      Co-authored-by: default avatarjefyang1 <Jeffreyj.Yang@amd.com>
      
      * restore cron trigger (#1863)
      
      * add vectorloads on non-k dim for memory pipelines (#1856)
      
      * Support for dtypes (fp8, bf8, bf16 and fp16) for the ck_tile/03_gemm example. (#1845)
      
      * Support bf16/fb8/bf8 datatypes for ck_tile/gemm
      
      * remove commented out code.
      
      * Addressing code review comments and enabling universal_gemm for all the supported data types.
      
      * Merge conflict resolution.
      
      * Solve the memory pipeline compilation error. Merge with the new change of CShuffle
      
      * finish the feature, pass the tests
      
      * Fix the pipeline and add the benchmark script for other data types
      
      ---------
      Co-authored-by: default avatarThomasNing <thomas.ning@amd.com>
      
      * Extract prec_str and add separator to concat
      
      * GetName add
      
      * CK Tile - small fix to hotloop scheduler & KPack value. (#1867)
      
      * Use SmemPack in HotLoop scheduler
      
      * Additional debug print information
      
      * Change KPack value.
      
      Hardcode for now, as without AK1/BK1 there's no good way to determine
      its value.
      
      * Fix HotLoopScheduler MFMA instr parameters.
      
      * Resolve merge issues
      
      ---------
      Co-authored-by: default avatarIllia Silin <98187287+illsilin@users.noreply.github.com>
      Co-authored-by: default avatarJing Zhang <jizhan@amd.com>
      Co-authored-by: default avataraska-0096 <haocwang@amd.com>
      Co-authored-by: default avatarJun Liu <Liu.Jun@amd.com>
      Co-authored-by: default avatarAndriy Roshchenko <andriy.roshchenko@amd.com>
      Co-authored-by: default avatarRostyslav Geyyer <rosty.geyyer@amd.com>
      Co-authored-by: default avatarRostyslav Geyyer <46627076+geyyer@users.noreply.github.com>
      Co-authored-by: default avatarroot <root@banff-cyxtera-s83-2.ctr.dcgpu>
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      Co-authored-by: default avatarjefyang1 <146495389+jefyang1@users.noreply.github.com>
      Co-authored-by: default avatarjefyang1 <Jeffreyj.Yang@amd.com>
      Co-authored-by: default avatarjakpiase <jakub.piasecki@amd.com>
      Co-authored-by: default avatarkylasa <sudhir.kylasa@amd.com>
      Co-authored-by: default avatarThomasNing <thomas.ning@amd.com>
      Co-authored-by: default avatarAdam Osewski <19374865+aosewski@users.noreply.github.com>
      2312f4aa
  2. 07 Feb, 2025 4 commits
    • Adam Osewski's avatar
      CK Tile - small fix to hotloop scheduler & KPack value. (#1867) · 0c15de6a
      Adam Osewski authored
      * Use SmemPack in HotLoop scheduler
      
      * Additional debug print information
      
      * Change KPack value.
      
      Hardcode for now, as without AK1/BK1 there's no good way to determine
      its value.
      
      * Fix HotLoopScheduler MFMA instr parameters.
      0c15de6a
    • kylasa's avatar
      Support for dtypes (fp8, bf8, bf16 and fp16) for the ck_tile/03_gemm example. (#1845) · ab5d0278
      kylasa authored
      
      
      * Support bf16/fb8/bf8 datatypes for ck_tile/gemm
      
      * remove commented out code.
      
      * Addressing code review comments and enabling universal_gemm for all the supported data types.
      
      * Merge conflict resolution.
      
      * Solve the memory pipeline compilation error. Merge with the new change of CShuffle
      
      * finish the feature, pass the tests
      
      * Fix the pipeline and add the benchmark script for other data types
      
      ---------
      Co-authored-by: default avatarThomasNing <thomas.ning@amd.com>
      ab5d0278
    • jakpiase's avatar
      9b5dfba2
    • Illia Silin's avatar
      Merge from internal (#1857) · 555244e7
      Illia Silin authored
      
      
      * enable batched_gemm_softmax_gemm_perm_wmma for gfx12
      
      * disable instances with blocksize=256 in attention examples
      
      * debuggging
      
      * debug
      
      * fixed lds_enabled
      
      * debugging
      
      * Fix and add limit to skiplds feature
      
      * Enable skipLds feature and fix compilation bugs
      
      * add ck_tile definitions for gfx12
      
      * fix clang format and test/wmma_op
      
      * updage instances cmake for gfx12
      
      * disable the test_wmma_op on gfx12
      
      * fix the builds for gfx950
      
      * add gfx12 and gfx950 to default target list
      
      * clean-up cmake file
      
      * Initial introduction of OFP8 data types.
      
      * Renamed FP8 and BF8 tests into FP8_FNUZ and BF8_FNUZ.
      
      * Implementation of ConvertFP32Nearest in test_fp8_ocp.
      
      * Remove dependence on possibly undeclared alias.
      
      * Implement FP8OCP test for stochastic rounding mode.
      
      * Implement FP8OCP tests for half_t type conversions.
      
      * enable bf16 atomic add on gfx950
      
      * Implement ConvertFP32Nearest test.
      
      * Implement ConvertFP32Stochastic test.
      
      * Implement ConvertFP16Nearest and ConvertFP16Stochastic tests.
      
      * Refactoring. Move FP8 definitions into a separate header file.
      
      * Enable easy switching between architectures.
      
      * Fix compilation error for gfx942 architecture.
      
      * Add fp4 type with constants
      
      * only builf gfx950 branch for gfx950 target by default
      
      * Enable OCP build of example_gemm_xdl_fp8.
      
      * Fix formatting.
      
      * fix the build logic for gfx950
      
      * Improve GEMM example verbosity.
      
      * Add constexpr where applicable.
      
      * fix the logic of enabling XDL and WMMA instances
      
      * Improve GEMM example verbosity.
      
      * Enable build of example_gemm_xdl_fp8_bf8 test.
      
      * Fix tests for gfx1101 architecture.
      
      * Build DPP examples only on gfx103 and gfx11 architectures.
      
      * Optionaly run either CPU or GPU verifications with GEMM examples.
      
      * Extend GeneratorTensor_Sequential to produce values of prescribed data types.
      
      * Add missing constructor.
      
      * Add scale type and mxfp conversions
      
      * Update conversions
      
      * Add conversion tests
      
      * Fix typo
      
      * Improve infrastructure for OFP8 data type support.
      
      * BUGFIX. Should not use FP8 as Compute/Accum data type.
      
      * Add custom target for grouped_convnd_bwd_weight tests.
      
      * Can build `tests` target on gfx950.
      
      * Bugfixes on gfx1101 architecture.
      
      * Fix dependencies.
      
      * Add stochastic rounding tests
      
      * Provide single point of truth for FP8 INF and NAN checks
      
      * Prevent instantiation of operators that are not supported by FP8 data types
      
      * Add FP8 type selection into client_axample CMakeLists.txt
      
      * Prevent sccache server from shutting down during build
      
      * Fix test success reporting logic
      
      * Change default verification method to CPU.
      
      GPU verification takes too much time to complete on the emulator.
      
      * Add scale <-> float conversions
      
      * Add scaled conversions with tests
      
      * Add device conversions
      
      * Make sure all tests and examples are built for gfx950
      
      * Facilitate testing of FP8 data types on the emulator
      
      * Introduce two new tensor generators
      
      * Enable instances built for gfx94 to be built on gfx950
      
      * Verify 35_splitk_gemm on floating point numbers.
      
      splitk gemm appears to be losing precision VS reference implementation when FP numbers are involved.
      
      * Format
      
      * Verify 04_gemm_add_add_fastgelu on floating point numbers
      
      * Verify 20_grouped_conv_bwd_weight on floating point numbers
      
      * Verify 38_grouped_conv_bwd_data_multiple_d on floating point numbers
      
      * Verify more tests on floating point data
      
      * Fix data types and improve testing verbocity.
      
      * Add fp4 vectors
      
      * Add debug tests
      
      * Upgrade to NPI 573 build docker.
      
      * Skip on gemm_universal tests.
      
      The tests take too long to complete on the emulator.
      Need to see if it is possible to reduce the scope of the testing to just FP8 data types.
      
      * Add new mfma instructions and examples
      
      * Add preprocessor directives for gfx950 specific code
      
      * Fix gfx1101 build
      
      * Document test availability
      
      * Re-enable fp8 gemms for gfx94/95
      
      * Cherry-pick GEMM Universal tests for FP8 data types
      
      * Cleanup
      
      * Add vector types and tests
      
      * Add check_err function
      
      * Add tensor generators
      
      * CK_USE_GFX94 has already been set on this branch
      
      * Fix
      
      * Address formatting issues and leftovers
      
      * Make fail/pass logic consistent within 01_gemm folder
      
      Removed multiple negations in fail/pass logic to propagate `true` as the success indicator.
      
      * Fix GPU verification reporting logic.
      
      * Update year in copyright notice.
      
      * Cleanup
      
      * Use `enum class` instead of `enum`
      
      * Remove set_property for FP8 tests
      
      * Add vector conversions
      
      * Fix
      
      * Fix linker errror
      
      * Clean up
      
      * Fix gfx950 conversions
      
      * Clean up
      
      * Fix more gfx950 conversions
      
      * Fix even more gfx950 conversions
      
      * Narrowing the scope of PR to OCP FP8 enablement only
      
      * Add tests for OCP FP8 vector_type storage
      
      * Fix client examples build
      
      * Fix typo
      
      * Update e8m0 casting
      
      * Rename E8M0 type
      
      * Update unpack method
      
      * Cleanup merge artifacts
      
      * Enable gemm kernel on all gfx9 architectures (#227)
      
      * clean-up
      
      * Implement `non_native_vector_base` with `ext_vector_type` array. (#232)
      
      * Enable support of 1, 2, 4, and 8-byte custom types in CK.
      
      * Fix pool tests for OCP FP8 data type
      
      * Fix build
      
      * Add ckProfiler gemm instances for new mfma instructions and fix ckProfiler build on gfx950
      
      * fix clang format
      
      * Add new mfma instructions and examples
      
      * Add preprocessor directives for gfx950 specific code
      
      * Add ckProfiler gemm instances for new mfma instructions and fix ckProfiler build on gfx950
      
      * fix clang format
      
      * Fix clang format for the newly merged files
      
      * Use the existing example instances for fp16 bf16 and int8
      
      * Remove comment on new mfma instructions in MfmaInstr
      
      * Update include/ck/tensor_operation/gpu/grid/gridwise_batched_gemm_gemm_xdl_cshuffle_v1.hpp
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      
      * merge from public repo
      
      * Fix ck build
      
      * Fix ck build
      
      * Use double for max_abs_in_val
      
      * Move scaled_type_convert functions to a separate header (#251)
      
      * re-enable building mha lib and gemm_universal_f8 instances for gfx950
      
      * Update library/src/tensor_operation_instance/gpu/CMakeLists.txt
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      
      * fix typo for CK_USE_OCP_FP8
      
      * fix typo for CK_USE_OCP_FP8
      
      * Add FP6 and BF6 types (#261)
      
      * Add a rounding flag
      
      * Add FP6 and BF6
      
      * Add tests
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      
      * Clean up
      
      ---------
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      
      * fix one more typo
      
      * Refactor E8M0 scale implementation (#262)
      
      * Refactor E8M0 scale implementation
      
      * Add MXFP6 and MXBF6 conversion methods (#270)
      
      * Add conversions
      
      * Add tests
      
      * Add docstrings
      
      * Add scaled conversions
      
      * Add fp6/bf6 tests
      
      * Remove misleading fp4 test case
      
      * Add docstrings
      
      * Clean up
      
      * Address comments
      
      * Set stricter tolerances for RNE tests
      
      * Add missing tests
      
      * Add native conversions to float
      
      * Revert "Add native conversions to float"
      
      This reverts commit 09467111f73b753c8cc3d597533b187940353dab.
      
      * Update copyright years
      
      * replace the fp6 with bf6 convert calls in test_bf6
      
      * fix test_bf6
      
      * enable smfmac test
      
      * [MX FP8] Add Scaled Type Convert Functions for OCP FP8/BF8 data types (#271)
      
      * Move scaled_type_convert functions to a separate header
      
      * Introduce MX data tests
      
      * Build MX tests only on relevant architectures
      
      * Refactor E8M0 scale implementation
      
      * Fix `config.h` typo
      
      * Cleanup deprecated symbols
      
      * Refactor `amd_ck_fp8.hpp`
      
      * `scaled_type_convert` for `f8_ocp_t`
      
      * Implement test for MX FP8 scaled type convert
      
      * Implement test for MX BF8 scaled type convert
      
      * Scaled type convert for vectors of 2 FP8 elements
      
      * Scaled type convert for vectors of 16 FP8 elements
      
      * Implementation of scaled conversion from F32 to F8
      
      * Add tests for scaled conversions from FP32 to FP8
      
      * Add documentation to the test functions
      
      * Implementation of scaled conversion from F32x2 to F8x2
      
      * Implementation of scaled conversion from F32x16 to F8x16
      
      * Implementation of scaled conversion from F32x32 to F8x32
      
      * Implementation of scaled conversion from F8x32 to F32x32
      
      * Verified on the emulator
      
      * MX FP GEMM - Example Template (#277)
      
      Temporarily uses `DeviceGemmMultiD_ABScale_Xdl_CShuffle_V3` kernel and 128x128 scaling matrices.
      Must be modified to use MX-native GEMM kernell with 16 or 32 component vectors per scale.
      
      Verified on the emulator.
      
      * Add vector support
      
      * Add tests
      
      * Add missing type aliases
      
      * Fix test naming
      
      * only build mx example for gfx950
      
      * disable CK_USE_AMD_MFMA_GFX950 by default
      
      * fic build for multiple archs
      
      * fix typo
      
      * fix typo
      
      * Update unpack signature
      
      * Fix merge
      
      * Add size checks in pack function
      
      * Add a flag
      
      * Add conversions
      
      * Fix build logic
      
      * Update pack/unpack methods
      
      * Remove unneeded AsType accessors
      
      * Add docstrings
      
      * Add a flag to config file
      
      * Test the functionality of V_MFMA_F32_16X16X128_F8F6F4 and  V_MFMA_F32_32X32X64_F8F6F4 instructions. (#293)
      
      * Introduced MFMA tests
      
      * Verified f8f6f4 MFMA Instructions
      
      * Move flag logic to scaled_type_convert header
      
      * Use pointers instead of array indices
      
      * Fix a typo
      
      * Update tests and pack functions
      
      * Fix gemm gemm on gfx950
      
      * Fix clang format
      
      * restore the default gput target lists
      
      * fix the jenkinsfile
      
      * add missing ifdef
      
      ---------
      Co-authored-by: default avatarJing Zhang <jizhan@amd.com>
      Co-authored-by: default avataraska-0096 <haocwang@amd.com>
      Co-authored-by: default avatarJun Liu <Liu.Jun@amd.com>
      Co-authored-by: default avatarAndriy Roshchenko <andriy.roshchenko@amd.com>
      Co-authored-by: default avatarRostyslav Geyyer <rosty.geyyer@amd.com>
      Co-authored-by: default avatarRostyslav Geyyer <46627076+geyyer@users.noreply.github.com>
      Co-authored-by: default avatarroot <root@banff-cyxtera-s83-2.ctr.dcgpu>
      Co-authored-by: default avatarAndriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
      Co-authored-by: default avatarjefyang1 <146495389+jefyang1@users.noreply.github.com>
      Co-authored-by: default avatarjefyang1 <Jeffreyj.Yang@amd.com>
      555244e7
  3. 30 Jan, 2025 2 commits
    • Adam Osewski's avatar
      [CK Tile] Spatially local GEMM tile partitioner. (#1843) · ce448002
      Adam Osewski authored
      * Add spatially local tile partitioner
      
      * Use 1D Grid size & create partitioner object.
      
      * Docs & use 1D partitioner in example.
      
      * Clang format.
      
      * Change kernel grid size
      
      Now: X is the # of output C-tiles,
           Y is the batch count
           Z is the splitK
      
      * Formatting & more doc.
      
      * Clang format.
      
      * Fix batched gemm test. Use 1d partitioner.
      
      * Move condition.
      
      * FIx ctor.
      
      * clang-format.
      ce448002
    • Bartłomiej Kocot's avatar
      [CK TILE] Implement cschuflle algorithm (#1842) · 25e2e0f0
      Bartłomiej Kocot authored
      * [CK TILE] Implement cschuflle algorithm
      
      * Rebase
      
      * Vector store size fixes
      
      * fixes
      
      * Fixes
      
      * fixes
      
      * fmha fix
      
      * fixes
      
      * fixes of fixes
      25e2e0f0
  4. 29 Jan, 2025 1 commit
  5. 27 Jan, 2025 1 commit
    • Adam Osewski's avatar
      [CK-Tile] Enable vectorized reads on all layouts & improve perf. (#1835) · 39dc25a9
      Adam Osewski authored
      
      
      * Refactor universal gemm policy.
      
      * Adapt example to refactor changes.
      
      * Introduce static encoding pattern
      
      * Adding shuffled encoding patterns.
      
      * Fix err in reverse tuple.
      
      * Add transpose_tile2d
      
      * Small refactoring + doc
      
      * Enable reading on contiguous dimension in all layouts.
      
      * Transpose A/B register tile if needed for comp v3 pipeline.
      
      * Take contiguous dim size when calculating dram vector load size.
      
      * A/B smem pack size taken from WarpGemm attributes
      
      * Update B LDS layout and setup tile distribution pattern at class level.
      
      * Fix static assert.
      
      * Fix errors in examples.
      
      * Formatting & fix IsTranspose
      
      * Fix VectorSize & refactor.
      
      * Add error loging messages.
      
      * Fix VecLoadSize and TranspseC for mem pipeline.
      
      * Update unit-tests & disable mem pipeline.
      
      * Clang format
      
      * Update include/ck_tile/core/tensor/tile_window.hpp
      Co-authored-by: default avatarjakpiase <jakub.piasecki@amd.com>
      
      * Fix compilation and reviewers comments.
      
      * Refactor unit-test. Fallback to non-universal gemm.
      
      Need to use GemmPipelineAGmemBGmemCRegV1 for now,
      since GemmKernel is now supporting also non-K major vector reads.
      
      ---------
      Co-authored-by: default avatarjakpiase <jakub.piasecki@amd.com>
      39dc25a9
  6. 22 Jan, 2025 1 commit
  7. 21 Jan, 2025 1 commit
    • Mateusz Ozga's avatar
      CK-Tile Grouped GEMM refactor and post PR fixes (#1756) · 3c93d3c4
      Mateusz Ozga authored
      * Grouped gemm simple code refactor
      
      * Offset invoker
      
      * Invoke generic Run, and replace name of parrtitioner variable
      
      * Tests fix type
      
      * Removed namespaces
      
      * Add template param to avoid implicit cast
      
      * Remove generic function
      
      * Constant value
      
      * underline enum to int16_t
      
      * Generalize partitioner function
      
      * Remove whitespaces
      
      * Rename function
      
      * Using support
      
      * Clang-format
      
      * Clang-format
      
      * Fn-partitioner description fn
      
      * Typo
      
      * Typo 2
      
      * Better description
      
      * Better description
      
      * Refactor after review
      
      * Use ctr instead of set fn
      
      * Inovke ctr and typo
      
      * Comments
      
      * Remove unnecessary comment
      
      * Review, remove modulo
      3c93d3c4
  8. 16 Jan, 2025 1 commit
  9. 15 Jan, 2025 1 commit
    • ruanjm's avatar
      [CK_TILE] Add Various Fusion Functions to RMSNorm (#1802) · 04dd3148
      ruanjm authored
      
      
      * Add shortcut to RMSNorm
      
      * Modify test for adding shortcut for RMSNorm
      
      * Add fused parameter into tests
      
      * 1. Add YDataType. 2. rmsnorm2d_fwd_traits_ from rmsnorm2d_fwd.hpp to rmsnorm2d_fwd_api.cpp and rmsnorm2d_fwd_instance_common.hpp
      
      * 1. Supports various stride and percisions.
      
      * Add support of Epilogue
      
      * Add fuse and epilogue support to rmsnorm ref
      
      * Modify rmsnorm example
      
      * Refactor tests/examples
      
      * Bug fix for newly added tests/examples
      
      * Bug fix for new tests 2
      
      * Modify smoke test scripts
      
      remove dbg code
      
      * Supports non-smooth dyanmic quant
      
      * Update Rmsnorm2dFwd::GetName()
      
      * rename xscale and prec_sx to smoothscale and prec_sm
      
      Bug fix after rename
      
      Remove files
      
      * change example_rmsnorm2d_fwd.cpp
      
      * update performance calculator
      
      * Fix issue in two-pass when fuse add is enabled
      
      * Remove comment of beta
      
      ---------
      Co-authored-by: default avatarrocking <ChunYu.Lai@amd.com>
      04dd3148
  10. 13 Jan, 2025 2 commits
    • Thomas Ning's avatar
      CK Tile GEMM CICD fixed & register block method refactor (#1776) · 5d671a5f
      Thomas Ning authored
      * refactor the block_gemm_areg_breg_creg_v1 and add the v2 policy with 2x2 warp gemm
      
      * Finished the 2x2 warp gemm policy and the block selection mechanism
      
      * Clang format
      
      * address poyen's comment
      
      * Address feedbacks
      
      * Fixed the compilation issue
      
      * Change the function name
      5d671a5f
    • Qianfeng's avatar
      Update for fmha_fwd qs_ks_vs pipeline (#1810) · 3d50f57f
      Qianfeng authored
      
      
      * Update for fmha_fwd qs_ks_vs pipeline
      
      * Remove _builtin_amdgcn_sched_barrier(0)
      
      * Move p_compute to p converting earlier for trying to increase vgprs re-using
      
      * Enable GetQKBlockGemm to use WarpGemm-16x16x16 for QLoadOnce==false situation
      
      * Re-add __builtin_amdgcn_sched_barrier(0)
      
      ---------
      Co-authored-by: default avatarPo Yen Chen <PoYen.Chen@amd.com>
      3d50f57f
  11. 08 Jan, 2025 11 commits
  12. 07 Jan, 2025 1 commit
    • Po Yen Chen's avatar
      [CK_TILE] fmha fwd splitkv optimization for decode (seqlen_q=1) (#1789) · 24b12d04
      Po Yen Chen authored
      
      
      * Update license year
      
      * Add initial code to override decode problem
      
      * Fix splitkv traits/args overriding error
      
      * Reshape and transpose lse for decode
      
      * Remove debug code
      
      * Prettify example code
      
      * Use better function name
      
      * Add kMergeNumHeadGroupsSeqLenQ flag
      
      Kernel user can use this switch to turn on/off optimization for
      some problem sizes
      
      * Add missing flag declarations
      
      * Default turn off kMergeNumHeadGroupsSeqLenQ in codegen
      
      * Group similar statements together
      
      * Remove assumption of seqlen_q=1
      
      * Remove kMergeNumHeadGroupsSeqLenQ from splitkv combine kernel
      
      * Support kMergeNumHeadGroupsSeqLenQ=true in fmha splitkv kernel
      
      * Run kMergeNumHeadGroupsSeqLenQ=true kernels when need
      
      * Fix group mode block skip logics
      
      * Undo changes of normal fwd kernel
      
      * Update in GridSize() and using GridSize() for splitkv kernel (#1799)
      
      ---------
      Co-authored-by: default avatarQianfeng <qianfeng.zhang@amd.com>
      24b12d04
  13. 03 Jan, 2025 1 commit
  14. 29 Dec, 2024 1 commit
    • Qianfeng's avatar
      Remove using partitioner for all fmha kernels (#1778) · 4e076909
      Qianfeng authored
      * Remove using tile partitioner for fmha_fwd_kernel
      
      * Remove using tile partitioner for fmha_fwd_splitkv and splitkv-combine kernels
      
      * Remove using tile partitioner for fmha_fwd_appendkv kernel
      
      * Unify the format of GetTileIndex
      4e076909
  15. 28 Dec, 2024 1 commit
  16. 23 Dec, 2024 1 commit
  17. 20 Dec, 2024 2 commits
    • carlushuang's avatar
      hot-fix (#1768) · 1c45ca35
      carlushuang authored
      1c45ca35
    • Po Yen Chen's avatar
      [CK_TILE] Add fmha fwd N-Warp S-Shuffle pipeline (fmha fwd splitkv pipeline variant) (#1705) · 37cdbf4f
      Po Yen Chen authored
      
      
      * Add check for zero values
      
      * Add static assertions
      
      * Remove invalid option '-e' in smoke_test.sh
      
      * Use correct path of smoke_test.sh
      
      * Avoid zero-sized shared memory array
      
      * Add warning comment
      
      * Replace expr by integer_divide_ceil() call
      
      * Use more readable constant names
      
      * Write down assumption as static assertion
      
      * Add more diagnostic error messages
      
      * Fix wrong BlockWarps when using default pipeline policy
      
      * Add more static assertions for A LDS desc
      
      * Allow using vector size < 8 for data type fp16/bf16
      
      * Align vector size between DRAM dist & LDS desc
      
      * Remove no-longer used func decl
      
      * Fix wrong displayed piepline name
      
      * Undo policy template changes for tile_example_gemm_basic
      
      * Add missing space and make error message stands out
      
      * Unify print precision
      
      * Add missing include directive <iomanip>
      
      * Replace constant 64 by get_warp_size() call
      
      * Replace constant 128 by named variable: BankLength
      
      * Add kAMBlock/kBNBlock attributes
      
      * Allow usig different A/B warp dist for multiple blocks
      
      * Add helper function to get warp dist encodings
      
      * Add 4x64x4 fp16 warp gemm attribute impl
      
      * Complete the A/B warp dist encoding logic
      
      * Fix wrong thread mapping for C matrix
      
      * Use smaller vector size for small tile
      
      * Add static assert to block unsupported warp gemm impl
      
      * Extract common code out as helper method
      
      * Add 4x64x16 fp16 warp gemm type alias
      
      * Add comment to warning developers
      
      * Undo WarpGemmAtrributeMfma<> changes
      
      * Use more clear static assertion error message
      
      * Add trivial wrapper to get warp dstr encodings
      
      * Only transpose warp gemm result if it's square
      
      * Fix compilation error
      
      * Support multi-block warp gemm (on N direction)
      
      * Remove duplicated code
      
      * Fix output encoding of warp gemm
      
      * Fix wrong shape of WarpGemmAtrributeMfmaIterateK<>
      
      * Remove unused code
      
      * Fix wrong shape of WarpGemmAttributeMfmaImplF16F16F32M4N64K4
      
      * Add type config for bf16_t
      
      * Add 4x64x16 bf16 warp gemm
      
      * Update WarpGemmAtrributeMfmaIterateKAndTransposedCDistribution
      
      * Add 64x4x4 fp16/bf16 warp gemm impl
      
      * Add 64x4x16 fp16/bf16 warp gemm
      
      * Add static assertion for better error diagnostic
      
      * Get Q dram dstr directly form block gemm
      
      * Add missing header: fused_moe.hpp
      
      * Allow specifying different warp-gemm for gemm0 & gemm1
      
      * Store P matrix into LDS before gemm1
      
      * Fix inconsistant kernel name
      
      * Remove constraint on gemm0 & gemm1 block warps
      
      * Remove unsupported vector size from checking list
      
      * Allow using 4x64x16 warp gemm for gemm0
      
      * Finish policy customization
      
      * Finish pipeline modification
      F#
      
      * Use block warps in codegen
      
      * Fix wrong rank of m_lds_window origin
      
      * Use better distributed tensor
      
      * Make P-store earlier
      
      * Remove duplicated experssions
      
      * Remove unnecessary tile window
      
      * Create new files for new splitkv pipeline
      
      * Separate old/new pipeline codegen logic
      
      * Sync changes form develop
      
      * Undo gemm kernel/pipeline changes
      
      * Undo gemm example changes
      
      * Remove blank lines
      
      * Fix typo
      
      * Use new warp gemm interface
      
      * Fix link error
      
      * Fix wrong pipeline tag
      
      * Fix more link error
      
      * Avoid unnecessary padding
      
      * Always use vector load for K
      
      * Padding on fastest dimension when necessary
      
      * Force padding Q on hdim_q
      
      * Set high dimension padding flag to false
      
      * Re-format headers
      
      * Use warps=<1, 4, 1> for both gemm0 & gemm1
      
      * Fix complilation errors
      
      * Remove m/l shuffle logics
      
      * Ignore duplicate data when write lse_acc
      
      * Use gemm0 block warps as lds tile width
      
      * Remove hard-coded numbers
      
      * Fix wrong distribution width
      
      * Remove unnecessary code
      
      * Add s_barrier before writing to LDS
      
      * Store Q into LDS before gemm0
      
      * Fix wrong Q tile size
      
      * Use simple Q lds descriptor for debuging
      
      * Use more realistic Q lds descriptor
      
      * Add comment & use better variable name
      
      * Make Q lds space not overlapped with others
      
      * Remove unnecessary block_tile_reduce_sync() call
      
      * Move Q load statements
      
      * Move block_sync_lds() right before use
      
      * Re-order instructions
      
      * Remove necessary lambda expression
      
      * Use 8 threads on kMaxSplits direction while doing reduction
      
      * Tiny correction for using 8 threads on kMaxSplits direction for combine kernel
      
      * Padding num_split direction of o_acc tile window to 4x
      
      * Update splitkv combine pipeline design
      
      * Add kN1 back to splitkv combine pipeline problem
      
      * Fix compilation errors
      
      * Add missing template parameter
      
      * Fix wrong splitkv combine kernel name
      
      * Fix wrong origin
      
      * Fix wrong LDS descriptor shape
      
      * Fix sync & reduction logics
      
      * Remove unnecessary static assertions
      
      * Extract tile size computation logics
      
      * Make sure we can reuse padding flags in combine kernels
      
      * Rename variables
      
      * Use OaccDataType in BlockFmhaSplitKVCombinePipelineTileSizes<>
      
      * Remove unnecessary static assertion
      
      * Fix function name typo
      
      * Add constraint on kN1 template parameter
      
      * Hide K tile loading latency in earlier iteration
      
      * Fix wrong splitkv kernel name
      
      * Use s_shuffling to replace p_shuffling which removes the needs of cross-warp reduction
      
      * Rename pipeline
      
      * Fix wrong pipeline name attribute
      
      * Add GetAlignmentQ() for NWarpSShuffle pipeline
      
      * Separate Q tile into dram tile & register tile concepts
      
      * Remove non-squre warp gemm transpose c type alias
      
      * Fallback tile size changes for fmha fwd splitkv
      
      * Remove redundant change
      
      * Refine naming for the S tile
      
      * Use better naming of the S tile dstr (read from lds)
      
      * Share Q lds with K lds
      
      * Tiny change
      
      * Fix with using static_for for passing CI checking
      
      ---------
      Co-authored-by: default avatarQianfeng Zhang <Qianfeng.Zhang@amd.com>
      37cdbf4f
  18. 18 Dec, 2024 1 commit
    • aledudek's avatar
      [CK TILE] Refactor GemmKernel to be reused by other GEMM related operators (#1730) · 453ca373
      aledudek authored
      * Gemm Kernel Refactor part1
      
      * Gemm Kernel Refactor common gemm pipeline part2
      
      * [CK TILE] Refactor batched gemm to reuse GemmKernel
      
      * [CK TILE] Refactor GemmKernel - review changes part1
      
      * [CK TILE] Refactor GemmKernel - references fix
      
      * [CK TILE] Refactor GemmKernel - naming changes, add problem
      
      * [CK_TILE] Refactor GemmKernel - update tests
      
      * [CK_TILE] Refactor GemmKernel - review changes
      
      * [CK_TILE] Refactor GemmKernel - update test
      
      * [CK_TILE] Refactor GemmKernel - constness fixes
      
      * [CK_TILE] Refactor GemmKernel - update tests
      453ca373
  19. 17 Dec, 2024 1 commit
  20. 15 Dec, 2024 1 commit
  21. 13 Dec, 2024 1 commit
  22. 12 Dec, 2024 1 commit
    • carlushuang's avatar
      [CK_TILE] naive attn (#1708) · 77a38e02
      carlushuang authored
      * add reference attention fwd
      
      * refactor addresser
      
      * update
      
      * paged, and i8 reflect-quant
      
      * lets call it forward-quant
      
      * fix error in decode variation
      
      * update naive-attn
      
      * fix page table
      
      * fix build err
      77a38e02
  23. 06 Dec, 2024 1 commit
  24. 05 Dec, 2024 1 commit