1. 21 Nov, 2024 1 commit
  2. 12 Nov, 2024 1 commit
  3. 11 Nov, 2024 1 commit
  4. 09 Nov, 2024 2 commits
    • dummycoderfe's avatar
      Ck tile/moe sorting (#1624) · bec6fbc6
      dummycoderfe authored
      
      
      * add moe_sorting & check ok
      
      * fix comments & typo
      
      * Run remod.py under include/ck_tile & example/ck_tile directories
      
      * format codes
      
      * fix output ci check bug
      
      * fix moe sorting readme and error commit file
      
      * use magiv div to accelerate compute
      
      * add an loop unroll for moe lds ops
      
      * add extblocksnel to set zeros for moebufs
      
      * [Ck_tile] moe set zero run ok, add size check and fix ref check
      
      * [Ck_tile]fix moe_sorting fuse set_zero remod
      
      * [Ck_tile] change name style, fix zero buffer size err, change folder
      
      * [Ck_tile] moe_sorting: fix name style
      
      * [Ck_tile] moe_sorting, remove useless params in traits
      
      * [Ck_tile] change outputtile cnt * unit_size; change output buf alloc
      
      ---------
      Co-authored-by: default avatardummycoderfe <noplydummmycoder@163.com>
      Co-authored-by: default avatarPo Yen, Chen <PoYen.Chen@amd.com>
      Co-authored-by: default avatarcarlushuang <carlus.huang@amd.com>
      bec6fbc6
    • Po Yen Chen's avatar
  5. 08 Nov, 2024 1 commit
  6. 05 Nov, 2024 1 commit
    • Juan Manuel Martinez Caamaño's avatar
      [generate.py] Override blob list if it already exists (#1635) · 464abd23
      Juan Manuel Martinez Caamaño authored
      Before, generate.py appended the list at the end of the output file.
      When running the cmake configuration steps multiple times on the
      examples, the blob list (such as fwd_blob_list.txt) would grow at every
      configuration.
      `library/src/tensor_operation_instance/gpu/mha/CMakeLists.txt` worked around
      this issue by removing the output file if it exists.
      
      Now, generate.py overrides the content of the output file.
      There is no need for the workaround in the CMakeLists.txt;
      and the issue is solved for the example projects too.
      464abd23
  7. 02 Nov, 2024 1 commit
  8. 01 Nov, 2024 2 commits
    • rocking's avatar
      [Ck_tile] smoothquant (#1617) · fbd65454
      rocking authored
      
      
      * fix compile error
      
      * fix typo of padding
      
      * Add smoothquant op
      
      * Add smoothquant instance library
      
      * refine type
      
      * add test script
      
      * Re-generate smoothquant.hpp
      
      * Always use 'current year' in copyright
      
      * use Generic2dBlockShape instead
      
      * Add vector = 8 instance back
      
      * Find exe path automatically
      
      * Simplify the api condition
      
      * Remove debugging code
      
      * update year
      
      * Add blank line between function declaration
      
      * explicitly cast return value to dim3
      
      * refine return value
      
      * Fix default warmup and repeat value
      
      * Add comment
      
      * refactor sommthquant cmake
      
      * Add README
      
      * Fix typo
      
      ---------
      Co-authored-by: default avatarPo Yen, Chen <PoYen.Chen@amd.com>
      fbd65454
    • carlushuang's avatar
      [layernorm] hot fix (#1620) · 550248de
      carlushuang authored
      * hot fix ln
      
      * some rename
      550248de
  9. 31 Oct, 2024 1 commit
    • carlushuang's avatar
      [CK_TILE] layernorm support fused-quant/fused-add (#1604) · c3a4800c
      carlushuang authored
      * add prenorm/postnorm support, refactor using generate.py
      
      * update README
      
      * update README
      
      * fix format
      
      * update some description and fix format
      
      * update format
      
      * format
      
      * use non-raw for loading
      
      * format and update n4096
      
      * dynamic-quant ready
      
      * update readme
      
      * support fused dynamic-quant
      
      * update fused-quant, with smooth
      
      * update README
      
      * update args
      
      * update some based on comment
      c3a4800c
  10. 30 Oct, 2024 3 commits
    • Adam Osewski's avatar
      [CK-Tile] Universal gemm memory bound pipeline (#1558) · 24d996aa
      Adam Osewski authored
      * CK-Tile GEMM with memory bound pipeline.
      
      * Memory bound gemm pipeline.
      
      * Fix not closed namespace.
      
      * Block gemm mem pipeline draft.
      
      * Do not use ck_tile:: within ck_tile namespace.
      
      * Refactoring & Move Layout info to pipeline problem.
      
      * Get hot loop and TailNum information before lunching kernel.
      
      * Fixes in pipeline.
      
      * Add comment to load_tile_raw and change variable naming style.
      
      * Few small changes & formatting.
      
      * Do not use macro.
      
      * Add gtests.
      
      * Use AccDataType for Output of MFMA instruction.
      
      * Formatting.
      
      * Refactor gemm examples.
      
      * Switch over to current block gemm.
      
      * Use currently available pipeline policy.
      
      * Refactoring and review comment.s
      
      * Fixes after merge.
      
      * Add missing include.
      
      * Add load tile overload which accepts output tensor as parameter.
      
      * This give 8% perf boost at the cost of using more registers.
      
      * Rename example.
      
      * Small changes.
      
      * Fix compilation err and lower K.
      
      * Support different layouts for A/B
      
      * Fix vector size for different layouts.
      
      * Rename Alignment into VectorSize
      
      * Unblock tests.
      24d996aa
    • rocking's avatar
      [Ck tile] support rmsnorm and related fusion (#1605) · 3d609534
      rocking authored
      * Add reduce2d new api
      
      * Prevent user use cross warp reduction
      
      * Fix bug of std caculation
      
      * Add rmsnorm2d
      
      * Add rmsnorm small example
      
      * Remove static assert to prevent compile fail
      
      * Add script to test performance and correctness
      
      * Add missing cmake change
      
      * refine naming
      
      * refine example of rmsnorm
      
      * Fix bug of rmsnorm
      
      * Refine naming
      
      * Fix cmake
      
      * clang format
      
      * Refine pipeline name
      
      * Add add_rmsnorm2d_rdquant kernel
      
      * Add reduce op
      
      * host verification
      
      * Fix bug of one pass pipeline
      
      * Refine tile size
      
      * Add two pass pipeline
      
      * Rename two pass to three pass
      
      * Fix bug of kSaveX == false
      
      * Add instance library
      
      * Add test script
      
      * Fix bug of x verification
      
      * Add save_x to trait
      
      * Add README
      
      * Move reduce2d into reduce folder
      
      * Fix bug of welford when number of m warp > 1
      
      * remove reduncant comment
      
      * 1. move 06_rmsnorm2d to 10_rmsnorm2d
      2. move 07_add_rmsnorm2d_rdquant to 11_add_rmsnorm2d_rdquant
      
      * clang format and add missing header
      
      * Add host validation of add + layernorm2d + rsquant
      
      * Revert "Add host validation of add + layernorm2d + rsquant"
      
      This reverts commit 936cb457978b928b90eff89a08fcdb7dc8bbed67.
      
      * Remove deprecated flag
      3d609534
    • Qianfeng's avatar
      [CK_TILE] Add fmha fwd headdim96 support (#1608) · 86322218
      Qianfeng authored
      
      
      * Add ceil_to_qualified_tile_length()
      
      * Rename kK0BlockLength to kQKHeaddim
      
      * Add kSubQKHeaddim concept to support headdim96
      
      * Fix in math.hpp to avoid using __half interfaces
      
      * Add LdsBufferSequence instance for headdim96
      
      * Update in fmha_fwd/fmha_fwd_splitkv codegen to support hd96 testing
      
      * Disable hd96 instance generation in codegen fmha_fwd and fmha_fwd_splitkv to save compiling time
      
      * Reformat one file
      
      * Fix text alignment in fmha_fwd_splitkv.py
      
      ---------
      Co-authored-by: default avatarPo Yen Chen <PoYen.Chen@amd.com>
      86322218
  11. 29 Oct, 2024 1 commit
  12. 26 Oct, 2024 2 commits
    • carlushuang's avatar
      topk_softmax (#1592) · b098b71b
      carlushuang authored
      * topk_softmax
      
      * remove some file
      
      * fix atomix linear_offset
      
      * address various comment, and change sfc get_index api to static(tuple)
      b098b71b
    • Po Yen Chen's avatar
      [CK_TILE] More fmha splitkv optimizations (#1588) · 54f0e6f4
      Po Yen Chen authored
      * Use pre-defined constants for readability
      
      * Use vector write for o_acc tensor
      
      * Remove no-longer used policy method
      
      * Deprecate no-longer used policy/pipeline
      
      * Specify gemm0/gemm1 block warps separately in codegen
      
      * Fix wrong ps_idx creation logic
      
      * Add single-warp block gemm
      
      * Supoprt single-warp gemm0
      
      * Make MakeCBlockTile() as static method
      
      * Use MakeCBlockTile() to get underlying tile distribution
      
      * Use kNumGemm1Warps to compute # threads for gemm1
      
      * Put normal case in the if clause
      
      * Refine fmha splitkv block mapping
      
      * Refine & fix the lse_acc/o_acc layout
      
      * Fix wrong LDS size for K tile
      
      * Use kK0=64 for hdim=128,256 fmha splitkv kernels
      
      * Use kK1=64 for hdim=32,64,128 fmha splitkv kernels
      
      * Undo kK0/kK1 changes
      
      * Use more reasonable GetAlignmentV() computation
      
      * Using store_tile() in fmha splitkv kernel epilogue
      54f0e6f4
  13. 22 Oct, 2024 1 commit
    • ltqin's avatar
      update layernorm (#1570) · 0394f8a7
      ltqin authored
      * port layernorm
      
      * change warp_welford.hpp
      
      * Update warpshuffle
      
      * 1. Add save mean and save std back
      2. Move construction of tensor_view and tile_window to operator()
      
      * refine welford max count calculation
      
      * unify layernorm api
      
      * Rename file
      
      * Remove save mean and inv std
      
      * Revert "refine welford max count calculation"
      
      This reverts commit 02236580
      
      .
      
      * Fix order of parameter
      
      * refine welford max count calculation again
      
      * Remove fp32 instances
      
      * Fix bug of padding
      
      * refactor api
      
      * Support bf16
      
      * Extract common function
      
      * Refine arg of operator()
      
      * Add kMThreadPerBlock to template parameter
      
      * clang format
      
      * Refine variable name
      
      * Refine file name
      
      * remove redundant line
      
      * refactor layernorm2d pipeline and add block-per-block utility
      
      * fix name
      
      * rename more
      
      * add more block-per-tile instance
      
      * remove duplicated define
      
      * update instance for 2048, 1024 case
      
      * support up to 2048 now
      
      * opt loading
      
      * add n1536
      
      * Add two pass pipeline
      
      * format
      
      * Fix incorrect type
      
      * parallel compilation
      
      * Use smaller N
      
      * fix 2p pass
      
      * Support Repeat_M in distribution
      
      * Refine nameing
      
      * Add reduce example
      
      ---------
      Co-authored-by: default avatarletaoqin <letaoqin@amd.com>
      Co-authored-by: default avataraska-0096 <haocwang@amd.com>
      Co-authored-by: default avatarrocking <ChunYu.Lai@amd.com>
      Co-authored-by: default avatarcarlushuang <carlus.huang@amd.com>
      0394f8a7
  14. 21 Oct, 2024 1 commit
    • Po Yen Chen's avatar
      [CK_TILE] Optimize fmha splitkv & splitkv combine kernels (#1577) · 95e722a3
      Po Yen Chen authored
      * Use smaller width for lse_accum dist tensor
      
      * Update pipeline comment
      
      * Fix wrong distribution for lse_accum
      
      * Remove duplicate dim in lse_accum dist encoding
      
      * Decide fmha splitkv combine kernel kBlockSize by kM0
      
      * Remove assumption of MPerThread=1
      
      * Add log<4> & log<8> specialization
      
      * Enlarge occupancy array
      
      * Fix vector size for small tile
      
      * Add support for kMaxSplits=8
      
      * Re-format gemm.hpp
      
      * Use 16x16x16 warp gemm for fwd_splitkv
      
      * Centralize policy code changes
      
      * Leave fp8/bf8 tile settings unchanged
      95e722a3
  15. 15 Oct, 2024 1 commit
  16. 10 Oct, 2024 1 commit
    • Thomas Ning's avatar
      Ck tile gemm cshuffle & CK Tile GEMM restructure (#1535) · 6f27bc98
      Thomas Ning authored
      
      
      * ake the cshuffle compilable
      
      * modify Mhe reference on gpu and cpu. Correaccess of cshuffle
      
      * fix the cpu reference code
      
      * Complete the in tile shuffle logic
      
      * restructure the kernel template input
      
      * change the naming pattern of ck_tile gemm pipeline
      
      * Re-format files using remod.py
      
      * Solve the fmha conflict with gemm
      
      * Comment Addressed from Carlus
      
      ---------
      Co-authored-by: default avatarPo Yen, Chen <PoYen.Chen@amd.com>
      6f27bc98
  17. 08 Oct, 2024 2 commits
  18. 07 Oct, 2024 1 commit
  19. 04 Oct, 2024 1 commit
    • kylasa's avatar
      Adding seed and offset pointer support to the philox random number generator. (#1523) · c24fae23
      kylasa authored
      
      
      * Adding seed and offset pointer support to the philox random number generator.
      
      * Separating seed and offset pointer checks with different condition statements.
      
      * Changes include, adding support for device seed and offset pointers, union is used to store seed/offset values and device pointers to minimize device SGPRs.
      
      * Correcting a typo in the readme file
      
      * Re-format files using remod.py
      
      * Use STL type for API parameters
      
      * Use simpler struct design for drop_seed & drop_offset
      
      * Undo unnecessary changes
      
      * Sync kargs style for fmha_fwd.hpp/.cpp
      
      * Use templated union to reduce code
      
      * Use structured binding to make code more readable
      
      ---------
      Co-authored-by: default avatarSudhir Kylasa <sukylasa@amd.com>
      Co-authored-by: default avatarPo Yen Chen <PoYen.Chen@amd.com>
      c24fae23
  20. 01 Oct, 2024 1 commit
    • Po Yen Chen's avatar
      [CK_TILE] Change output accum tensor layout of fmha fwd split-kv & combine kernels (#1527) · a1c07e8d
      Po Yen Chen authored
      * Use same layout for o_acc and o tensor
      
      * Use better param names in partitioner
      
      * Remove redundant kargs 'max_seqlen_q'
      
      * Use better param names in splitkv kernel
      
      * Add comment for additional kernel arguments
      
      * Sync empty loop early return logics between pipelines
      
      * Pass more arguments to cmake in scripts
      
      * Align backslashes
      
      * Fix wrong o_acc tensor view strides
      
      * Change o_acc layout if o_perm=0
      
      * Handle whole row masked via attn_bias
      
      * Use use vector width = 1 for o_acc
      
      * Use more even split sizes
      a1c07e8d
  21. 27 Sep, 2024 1 commit
  22. 26 Sep, 2024 1 commit
  23. 18 Sep, 2024 1 commit
  24. 14 Sep, 2024 1 commit
  25. 13 Sep, 2024 1 commit
    • Jun Liu's avatar
      Customize filesystem in CK for legacy systems (#1509) · 81bc1496
      Jun Liu authored
      
      
      * Legacy support: customized filesystem
      
      * Update cmakefile for python alternative path
      
      * fix build issues
      
      * CK has no boost dependency
      
      * More fixes to issues found on legay systems
      
      * fix clang format issue
      
      * Check if blob is correctly generated in cmake
      
      * fix the python issues
      
      * add a compiler flag for codegen when using alternative python
      
      * use target_link_options instead of target_compile_options
      
      ---------
      Co-authored-by: default avatarillsilin <Illia.Silin@amd.com>
      81bc1496
  26. 07 Sep, 2024 1 commit
    • Thomas Ning's avatar
      Ck tile gemm example (#1488) · caacd388
      Thomas Ning authored
      
      
      * Checkpoint: Finished with the tile example & kernel verification, working on the different matrix layout
      
      * Finished the Matrix Layout feature set up. Note: Need to modify the inner block to solve the shuffle problem in the future.
      
      * Fix: Clang Format, API fixed from fmha
      
      * fix with better naming convention
      
      * revert back the pipeline code of fmha
      
      * Fixed: Addressed the comments and merge the GEMM shape of GEMM Operator and FMHA Operator to one.
      
      * clang format with the reference_gemm file
      
      * convert the clang format with the remod.py
      
      * Changed the format and variable name of the kernel gemm_shape and partitioner
      
      ---------
      Co-authored-by: default avatarthomasning <thomasning@banff-cyxtera-s70-4.ctr.dcgpu>
      caacd388
  27. 29 Aug, 2024 1 commit
  28. 28 Aug, 2024 1 commit
    • Po Yen Chen's avatar
      [CK_TILE] Add PagedAttention kernels (#1387) · c1569892
      Po Yen Chen authored
      
      
      * Use dictionary to config all the functions
      
      * Add init codegen logic for fmha fwd appendkv
      
      * Call HIP_CHECK_ERROR() macro to get real source info
      
      * Setup meaningfull arguments
      
      * Sync kernel name with the codegen
      
      * Add knew/vnew tensors to the kernel argument
      
      * Fix wrong K values after appending
      
      * Fix vnew append errro
      
      * Extract common logics
      
      * Fix Vnew tile dstr for row major case
      
      * Conditionally add fwd_splitkv API in fmha_fwd example
      
      * Conditionally add call to fmha_fwd_splitkv()
      
      * Remove "EXAMPLE_" prefix of cmake variables
      
      * Regsiter API handlers automatically
      
      * Early return if 0 < s_k_new is not supported
      
      * Show message if we are ignoring option
      
      * Unify CMakeLists.txt coding style
      
      * Set num_splits=1 if split-kv is not supported
      
      * Add length/stride getters for HostTensor
      
      * Add RoPE example utilities
      
      * Add reference_rotary_position_embedding() (not implemented)
      
      * Finish reference_rotary_position_embedding() impl
      
      * Fix typo of HostTensor<>::get_length()
      
      * Fix compilation errors
      
      * Fix wrong answer when interleaved=false
      
      * Fix wrong answer when interleaved=true
      
      * Append K/V in the host verification code
      
      * Simplify K appending logics
      
      * Simplify v_host_ref definition
      
      * Reduce input/output dimensions
      
      * Rename function: add "batched" prefix
      
      * Apply RoPE on host side
      
      * Rename RoPE utility function
      
      * Fix wrong tensor size
      
      * Avoid invoking deprecated method 'find_module'
      
      * Pass RoPE kernel args
      
      * Create Rotary Cos/Sin tile windows in kernel
      
      * Add compute data type alias for RoPE
      
      * Randomly generate seqlen_knew if needed
      
      * Fix seqlen_knew enabling check logic
      
      * Add minimum seqlen_k to generate compliance kvcache
      
      * Fix compilation error in debug mode
      
      * Fix wrong boundaries
      
      * Fix wrong seqlen_k for kvcache
      
      * Rename variables used in distributio encoding
      
      * Fix rotary cos/sin tensor/tile size
      
      * Add constraint to the rotary_dim option
      
      * Remove unused inner namespace
      
      * Add dram distribution for rotary_cos/rotary_sin (interleaved)
      
      * Only apply interleaved RoPE on Knew for now
      
      * Fix wrong thread starting offset
      
      * Instantiate multiple kernels for RoPE approaches
      
      * Clean-up pipeline
      
      * Fix error in RoPE host reference
      
      * Handle RoPE half-rotated logics
      
      * Support 8x rotary_dim under half-rotated RoPE
      
      * Add comment
      
      * Apply elementwise function to the loaded tiles
      
      * Unify parameter/variable naming style
      
      * Remove constness from q_ptr
      
      * Add code blocks for q_tile
      
      * Apply RoPE to q_tile
      
      * Remove debug print code in kernel
      
      * Fix wrong knew/vnew appending positions
      
      * Use better naming for tile indices
      
      * Add make_tile_window() for adding distribution only
      
      * Skip code if # of block is more than needed
      
      * Move thread locating logics into policy
      
      * Remove always true static_assert()
      
      * Rename header
      
      * Rename RotaryEmbeddingEnum
      
      * Extract rotary embedding logic out
      
      * Re-order parameters
      
      * Align naming of some tile size constants
      
      * Rename more tile size constants
      
      * Fix wrong grid size
      
      * Fix wrong shape of knew_host/vnew_host
      
      * Fix wrong index into knew_host/vnew_host
      
      * Fix wrong rotary_cos/rotary_sin memory size for Q
      
      * Extract Q/Knew vector size to helper methods
      
      * Use different rotary_cos/rotary_sin distr for Q/Knew
      
      * Update host/device specifiers
      
      * Fix wrong data type for Q rotary_cos/rotary_sin
      
      * Remove RoPEComputeDataType type alias
      
      * Shift rotary_cos/rotary_sin by cache_seqlen_k
      
      * Add comment for why I just 't' for all padding flags
      
      * Align commit message to the real comment
      
      * Fix wrong pipeline
      
      * Rename utility function
      
      * Disable host verification if API not exist
      
      * Fix wrong rope key for fp8 pipeline
      
      * Allow only apply RoPE on Q (without append KV)
      
      * Add append-kv smoke tests
      
      * Remove debug statements
      
      * Remove more debug statements
      
      * Re-arrange the 'set +x' command
      
      * Remove no-longer used method in pipeline
      
      * Add missing init code
      
      * Refine pipeline padding settings
      
      * Enlarge rotary_dim limit (8 -> 16)
      
      * Enlarge KPerThread for rotary_interleaved=false
      
      * Update rotary_dim range in smoke_test_fwd.sh
      
      * Add template argument 'kIsPagedKV' for splitkv kernels
      
      * Launch splitkv kernel if given page_block_size
      
      * Fix wrong kernel name
      
      * Fix seqlen_k_min for pre-fill case (1 -> 0)
      
      * Add copy_const<> type trait
      
      * Add another make_tile_window()
      
      * Introduce 'TileWindowNavigator' types
      
      * Simplify TileWindowNavigator interfaces
      
      * Fix tile window navigation bugs
      
      * Disable calling fmha_fwd()
      
      * Remove ununnecessary data members
      
      * Simplify more make_tile_window() overloads
      
      * Move V tile through TileWindowNavigator
      
      * Fix uneven split checking logic
      
      * Move code after decide seqlen_q/seqlen_k
      
      * Make sure we always start reading complete tile
      
      * Use 128 as minimus page_block_size
      
      * Fix wrong origin for bias
      
      * Add batch_stride_k/batch_stride_v in group mode
      
      * Unify origin
      
      * Add missing kernel arguments for group mode
      
      * Add paged-kv codegen logic for appendkv kernels
      
      * Add block_table kernel args for appendkv kernel
      
      * Add tile navigators to the appendkv kernel
      
      * Fix wrong tensor descriptor lengths
      
      * Pass re-created tile window to pipeline
      
      * Fix wrong strides for appendkv kernel
      
      * Allow transit tile_window to another page-block
      
      * Handle cross-page-block write
      
      * Donot perform write again if already in last page-block
      
      * Always add fmha_fwd() api
      
      * Add missing group mode argument
      
      * Remove debug macro usages
      
      * Rename option s_k_new to s_knew
      
      * Separate splitkv/non-splitkv args/traits
      
      * Remove fmha_fwd_dispatch()
      
      * Fix compilation errors
      
      * Remove dropout code in splitkv kernel
      
      * Allow problem types without define kHasDropout attr
      
      * Use generic lambda to init traits objects
      
      * Separate more non-splitkv & splitkv traits/args
      
      * Display more info for specific kernels
      
      * Show more detailed warning message
      
      * Rename 'max_num_blocks' to 'max_num_page_blocks'
      
      * Remove no-longer used pipeline files
      
      * Wrap code by #if directives
      
      * Move functors to the begining of validation code
      
      * Use generic lambda to init all the api traits/args
      
      * Fix wrong seqlen for kvcache
      
      * Add missing comment
      
      * Rename TileWindowNavigator to PageBlockNavigator
      
      * Only expose necessary methods (not attributes)
      
      * Re-order pipeline paremeters
      
      * Refine smoke_test_fwd.sh
      
      * Fix wrong arugment count
      
      * Make tile window directly via PageBlockNavigator
      
      * Remove unused template paremeter
      
      * Remove group mode from appendkv kernel
      
      * Fix skcheck logic
      
      * Fix wrong syntax in skcheck expr
      
      * Use meaningful options in smoke test
      
      * Remove options
      
      * Fix formatting
      
      * Fix more format
      
      * Re-organize bash functions
      
      * Pass cache_batch_idx to kernels
      
      * Support cache_batch_idx in example
      
      * Fix compilation error
      
      * Add more appendkv test
      
      * Add more case for appendkv
      
      * Fix unexisted attribute
      
      * Remove 0 < seqlen_knew constraint
      
      * Clarify the case in warning message
      
      * Remove macro checking
      
      * Force batch mode when invoking appendkv & splitkv apis
      
      * Fix mode overriding logics
      
      * Fix wrong parameter name
      
      * Randomize seqlen_k if use kvcache
      
      * Use randomized seqlen_k for kvcache
      
      * Avoid using too small rotary_cos & rotary_sin
      
      * Rename parameter
      
      * Add seqlen_q & seqlen_k rules
      
      * Add comment
      
      * Add more comments
      
      * Fix compilation errors
      
      * Fix typo in comment
      
      * Remove type argument
      
      * Avoid seqlen_k=0 for kvcache
      
      * Revert "Avoid seqlen_k=0 for kvcache"
      
      This reverts commit 21c4df89e416182e8e9bc78e67bd4b98dbb6c88d.
      
      * Fix wrong uneven split checking logics
      
      * Only randomize kvcache seqlen_k if 1 < batch
      
      * Return earlier if split is empty
      
      * Revert "Only randomize kvcache seqlen_k if 1 < batch"
      
      This reverts commit b9a4ab0d7e3c2beecc0fccafd2a13259dd06299c.
      
      * Re-order seqlen_k_start adjustment logics
      
      * Fix compilation errors
      
      * Re-format script
      
      * Find executable from folder automatically
      
      * Fix kvcache seqlen_k generating logic
      
      * Make comment more clear
      
      * Fix wrong knew/vew appending logic on host
      
      * Add s_barrier to sync threads
      
      * Revert "Add s_barrier to sync threads"
      
      This reverts commit d3f550f30c0a4d9df15c613015d5dff268d6746d.
      
      * Support only using 1 row of rotary_cos/rotary_sin
      
      * Rotate Q in different way
      
      * Unify tensor view creation logics
      
      * Fix wrong argument
      
      * Add mask to switch how we use the rotary_cos/sin
      
      * Move attr from traits to problem
      
      * Move has_mask to fmha_fwd_appendkv_args
      
      * Support use uint32_t as SAD operand in Alibi<>
      
      * Use sad_u32() in splitkv kernels
      
      * Store tensor views in PageBlockNavigator
      
      * Use stored tensor view to update tile windows
      
      * Enlarge tensor view size
      
      * Remove debug code
      
      * Fix wrong tensor view size
      
      * Wrap tensor view into PageBlockNavigator
      
      * Add DataType member to PageBlockNavigator
      
      * Remove unnecessary member functions
      
      * Refind macro use
      
      * Fix typo
      
      * Add blank line between directives and actual code
      
      * Re-format files
      
      * Remove type in comment
      
      ---------
      Co-authored-by: default avatarcarlushuang <carlus.huang@amd.com>
      Co-authored-by: default avatarrocking <ChunYu.Lai@amd.com>
      c1569892
  29. 16 Aug, 2024 1 commit
    • Dan Yao's avatar
      [CK_TILE] FA bwd kernels optimization (#1397) · 79a5d9c1
      Dan Yao authored
      
      
      * tmp save
      
      * fix batch deterministic bugs
      
      * fix group deterministic bugs
      
      * codegen update
      
      * reorder files
      
      * bias support
      
      * hd256 bias support
      
      * bwd smoke test update
      
      * simplify convert dq
      
      * fix hd256 dropout scratch
      
      * do{}while() -> while(){}
      
      * comments
      
      * remove FmhaBwdTilePartitioner
      
      * save clear_tile
      
      * refactor dropout
      
      * code cleanup
      
      * code cleanup
      
      * comments
      
      * fix epilogue problem
      
      * fix fwd dropout
      
      * group convert_dq opt
      
      * fix dq alignment
      
      * Do not store storerandval in bwd for flash attention integration
      
      * fix hd32 error and boost performance
      
      * revert
      
      * Remove duplicated WarpGemm definitions in the policy file
      
      * dropout patch for mrepeat 16*16
      
      * code sync up
      
      * dq_acc stride
      
      * dq_acc stride stuff
      
      * codegen update
      
      * fwd dropout revert
      
      * fix hd128 scratches and boost performance
      
      * receipt 3 for simplified smoke test
      
      * more strides for fa integration
      
      * fix hd64 scratches and boost performance
      
      * non-iglp pipeline for headdim padding cases
      
      * dpad same as dvpad for flash attention integration
      
      * unpadded lse&d for group mode
      
      * Support unpad layout for group lse
      
      * Support unpad lse layout for splitkv
      
      * Fix stride for splitkv kernel
      
      * fix unpadded lse issue in fwd splitkv
      
      * comment
      
      * solve lds read&write conflicts
      
      * rename
      
      * bias rename
      
      * tile index revert
      
      ---------
      
      Co-authored-by: danyao12 <danyao12>
      Co-authored-by: default avatarrocking <ChunYu.Lai@amd.com>
      Co-authored-by: default avatarQianfeng Zhang <Qianfeng.Zhang@amd.com>
      79a5d9c1
  30. 07 Aug, 2024 1 commit
    • Illia Silin's avatar
      Run CK_TILE FMHA benchmarks and collect the performance data. (#1447) · 12c1f68d
      Illia Silin authored
      * run ck_tile benchmarks after the smoke tests and store logs
      
      * change the path of fmha benchmark logs
      
      * change the way of stashig ck_tile fmha logs
      
      * prevent the errors in stages where no logs are generated
      
      * fix the ck_tile fmha log names and headers
      
      * generate the fmha performance logs in the root folder
      
      * change jenkins scrip arguments format
      
      * use exact file names for stashing
      
      * modify scripts to process FMHA performance results
      
      * unstash FMHA logs before parsing them
      12c1f68d
  31. 31 Jul, 2024 1 commit
  32. 11 Jul, 2024 1 commit
    • Illia Silin's avatar
      Add CK_TILE tests to daily CI builds. (#1381) · 98a01bbc
      Illia Silin authored
      * add ck_tile tests to CI
      
      * build and run ck_tile tests on gfx90a and gfx942 in parallel
      
      * fix groovy syntax
      
      * turn ck_tile tests OFF by default
      
      * skip creating the build folder
      
      * build ck_tile examples with 64 threads
      
      * build ck_tile examples with cmake-ck-dev.sh script
      
      * add video group to docker on mi300
      
      * do not retry to rebuild the early CI stages
      
      * help prevent jenkins false failure
      
      * restore cron trigger
      98a01bbc
  33. 08 Jul, 2024 1 commit
    • carlushuang's avatar
      [CK_TILE] wa prec, remove sgpr offset for inline asm (#1356) · 8182976c
      carlushuang authored
      
      
      * wa prec, remove sgpr offset for inline asm
      
      * macro for set tile
      
      * ignore unused param if no kernel instances in host API
      
      * fix more prec issue
      
      * cache buffer resource
      
      * fix
      
      * support pre-nop
      
      * clear tile by vector type members
      
      * add workaround to reduce scratch memory
      
      * conditionally enable workaround code
      
      * enable workaround start from certain build version
      
      * fallback set_tile() implementation from certain build version
      
      * undo template argument changes
      
      * put dummy asm in load_raw()
      
      * fix comments, refactor s_nop inside buffer_load
      
      ---------
      Co-authored-by: default avatarPoYen, Chen <PoYen.Chen@amd.com>
      8182976c
  34. 26 Jun, 2024 1 commit
    • Po Yen Chen's avatar
      [CK_TILE] fmha forward split-kv + combine kernels (#1338) · 0cb2e06d
      Po Yen Chen authored
      
      
      * FA fwd dropout
      
      * FA bwd
      
      * epilogue reuse
      
      * CMakeLists update
      
      * [CK_TILE] support alibi (#1269)
      
      * add alibi support
      
      * fix code
      
      * update code based on comment
      
      * Support more hdim
      
      * fix fp8 bias
      
      * support seqlen_k=0 case
      
      * remove unused printf
      
      * fix format
      
      ---------
      Co-authored-by: default avatarrocking <ChunYu.Lai@amd.com>
      
      * now fwd/bwd can build
      
      * bwd alibi
      
      * add bwd validation stream_config
      
      * update generated filenames
      
      * update bwd kernel launch
      
      * CK_TILE_HOST_DEVICE in philox
      
      * Transpose -> transpose
      
      * format
      
      * format
      
      * format
      
      * Generate the instance for FA required
      
      * format
      
      * fix error in WarpGemm
      
      * Add num_splits option and dummy split-kv api method
      
      * Generate fmha_fwd_splitkv()
      
      * Add SplitKV kernel codegen logics
      
      * Add SplitKV combine kernel codegen logics
      
      * Fix mismatched return type
      
      * Clean-up code
      
      * Replace sentinel value before storing
      
      * Fix wrong layout of LSE/LSEacc/Oacc
      
      * Format codes
      
      * Fix o_acc memory error
      
      * Fix wrong kBlockSize used in policy
      
      * Reduce # of combine kernels
      
      * Fix split-kv combine kernel name
      
      * Fix wrong LDS indexing logics
      
      * Fix wrong loop counter step logic
      
      * Undo vector size changes
      
      * Remove no-longer used field
      
      * Remove in-consistent comment
      
      * Remove debug statements in example
      
      * Remove more debug statements
      
      * Add constness to local variables
      
      * Clearn up generate.py
      
      * Fix unstable clang-format comment
      
      * Remove unused include directive
      
      * Use shorter template parameter name
      
      * Enable non-split-kv blobs
      
      * Update license date
      
      * Print num_splits conditionally
      
      * Undo disabling data types
      
      * Remove unnessary tile size for fp8
      
      * Fix wrong pipeline args for fp8
      
      * Fix example output format
      
      * Remove more debug code in combine pipeline
      
      * Add stride kernel arguments for LSE/O acc workspace
      
      * Re-order split-kv pipeline call operator arguments
      
      * Pass LSE/O strides in kernel argument
      
      * Re-order pipeline call operator arguments
      
      * Use tensor_descriptor to locate LSEacc elements
      
      * Support providing invalid element for tensor view
      
      * Set invalid element value for LSEacc tensor view
      
      * Remove hand-written store_tile() code
      
      * Remove necessary value-overwrite logic
      
      * Add transposed lds descriptor
      
      * Support load_tile() for tile_window_with_static_lengths<>
      
      * Undo removing necessary value-overwrite logic
      
      * Use read descriptor to locate lds elements
      
      * Simplify pipeline source code
      
      * Add constraint to kMaxSplits
      
      * Default use kMaxSplits=64 in generate.py
      
      * Revert "Add constraint to kMaxSplits"
      
      This reverts commit 0a2132d758042e6fb0292f4e354909b8a4d1c118.
      
      * Revert "Default use kMaxSplits=64 in generate.py"
      
      This reverts commit c7d9c80b77320aec6559222bed7d47adcaefe4e3.
      
      * Decide alignment by the padding parameter
      
      * Remove no-longer used utility functions
      
      * Remove not-working code
      
      * Add comment & remove no-longer used code
      
      * Fix computation errors
      
      * Add heuristic to override num_splits option
      
      * Add constraint to kMaxSplits
      
      * Fix compilation error
      
      * Clean up pipeline code
      
      * Wrap pointer access as lambda function
      
      * Rename confusing methods
      
      * Use kLogMasSplits as template parameter
      
      * Finish splitkv combine kernel codegen
      
      * Update kMaxSplits limit
      
      * Use smaller kM0 for splitkv combine kernel
      
      * Ignore droupout flag in splitkv pipeline
      
      * Unify flag usage
      
      * Add back flag kStoreLSE
      
      * Merge lambda calls in pipeline
      
      * Fix compilation errors
      
      * Avoid all empty splits
      
      * Always check for empty loop in splitkv pipelines
      
      * Re-order parameters
      
      * Remove redundant p_drop option check
      
      * Add traits/problem for fwd splitkv kernel
      
      * Conditionally enable uneven split boundary checks
      
      * Add comment for the splitkv traits field
      
      * Change even split criteria
      
      * Re-order statements
      
      * Refine occupancy value for hdim=128&256
      
      * Refine occupancy value for hdim=32&64
      
      * Remove redundant kernel argument
      
      * Separate fmha bwd codegen logics
      
      * Separate fmha fwd codegen logics
      
      * Remove redundant direction parameter in fwd&bwd codegen logics
      
      * Support generate multiple APIs for an example
      
      * Let 'api' an alias of 'direction' option
      
      * Remove choices for the 'direction' option
      
      * Use dictionary to config all the functions
      
      * Move fmha splitkv codegen logics to other file
      
      * Add fwd_splitkv api for tile_example_fmha_fwd
      
      ---------
      
      Co-authored-by: danyao12 <danyao12>
      Co-authored-by: default avatarcarlushuang <carlus.huang@amd.com>
      Co-authored-by: default avatarrocking <ChunYu.Lai@amd.com>
      Co-authored-by: default avatarJing Zhang <jizhan@amd.com>
      0cb2e06d