/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ref/naive_attention.hpp File Reference

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ref/naive_attention.hpp File Reference#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ref/naive_attention.hpp File Reference
naive_attention.hpp File Reference
#include "ck_tile/core.hpp"
#include "ck_tile/host/host_tensor.hpp"
#include "ck_tile/host/kernel_launch.hpp"
#include <thread>
#include <string>

Go to the source code of this file.

Classes

struct  ck_tile::naive_attention_fwd_args
 
struct  ck_tile::naive_attention_fwd_traits
 
struct  ck_tile::naive_attention_fwd_kernel_traits< variation_, quant_algo_ >
 
struct  ck_tile::naive_attention_fwd_kernel< QType, KType, VType, OType, AccType, KVScaleType, QLayout, KLayout, VLayout, OLayout, KScaleLayout, VScaleLayout, Traits >
 
struct  ck_tile::naive_attention_fwd_kernel< QType, KType, VType, OType, AccType, KVScaleType, QLayout, KLayout, VLayout, OLayout, KScaleLayout, VScaleLayout, Traits >::scale_max< T_ >
 
struct  ck_tile::naive_attention_fwd_kernel< QType, KType, VType, OType, AccType, KVScaleType, QLayout, KLayout, VLayout, OLayout, KScaleLayout, VScaleLayout, Traits >::scale_max< int8_t >
 
struct  ck_tile::naive_attention_fwd_kernel< QType, KType, VType, OType, AccType, KVScaleType, QLayout, KLayout, VLayout, OLayout, KScaleLayout, VScaleLayout, Traits >::scale_max< fp8_t >
 
struct  ck_tile::naive_attention_fwd_kernel< QType, KType, VType, OType, AccType, KVScaleType, QLayout, KLayout, VLayout, OLayout, KScaleLayout, VScaleLayout, Traits >::addresser< T, Layout >
 
struct  ck_tile::naive_attention_fwd_kernel< QType, KType, VType, OType, AccType, KVScaleType, QLayout, KLayout, VLayout, OLayout, KScaleLayout, VScaleLayout, Traits >::page_addresser< T, Layout >
 
struct  ck_tile::naive_attention_fwd_kernel< QType, KType, VType, OType, AccType, KVScaleType, QLayout, KLayout, VLayout, OLayout, KScaleLayout, VScaleLayout, Traits >::kvscale_addresser< T, Layout >
 

Namespaces

 ck_tile
 

Macros

#define CK_TILE_DISPATCH_NAIVE_ATTEN_FWD_INTERNAL_()
 
#define CK_TILE_DISPATCH_NAIVE_ATTEN_FWD_LAOYUT_()
 

Enumerations

enum class  ck_tile::naive_attention_layout_enum {
  ck_tile::DEFAULT ,
  ck_tile::BSHD ,
  ck_tile::BHSD ,
  ck_tile::BS3HD ,
  ck_tile::PHSD ,
  ck_tile::PHDSX ,
  ck_tile::PHDS ,
  ck_tile::SCALE_HS ,
  ck_tile::SCALE_SH
}
 
enum class  ck_tile::naive_attention_variation_enum {
  ck_tile::FLASH_BATCHED = 0 ,
  ck_tile::FLASH_GROUPED ,
  ck_tile::DECODE_PAGED
}
 
enum class  ck_tile::naive_attention_quant_algo {
  ck_tile::NO = 0 ,
  ck_tile::KV_8BIT_PERHEAD = 1 ,
  ck_tile::KV_8BIT_PERTOKEN = 2
}
 

Functions

CK_TILE_HOST float ck_tile::naive_attention_fwd (naive_attention_fwd_traits t, naive_attention_fwd_args a, ck_tile::stream_config s)
 

Macro Definition Documentation

◆ CK_TILE_DISPATCH_NAIVE_ATTEN_FWD_INTERNAL_

#define CK_TILE_DISPATCH_NAIVE_ATTEN_FWD_INTERNAL_ ( )
Value:
{ \
using ktraits_ = naive_attention_fwd_kernel_traits< \
static_cast<naive_attention_variation_enum>(variation_), \
static_cast<naive_attention_quant_algo>(quant_algo_)>; \
using k_ = naive_attention_fwd_kernel<q_type_, \
k_type_, \
v_type_, \
o_type_, \
acc_type_, \
kvscale_type_, \
q_layout_, \
k_layout_, \
v_layout_, \
o_layout_, \
k_scale_layout_, \
v_scale_layout_, \
ktraits_>; \
dim3 grids = k_::get_grid_size(a); \
ck_tile::make_kernel(k_{}, grids, k_::get_block_size(), 0, a)); \
}
CK_TILE_HOST auto make_kernel(KernelImpl, dim3 grid_dim, dim3 block_dim, std::size_t lds_byte, Args... args)
Definition: kernel_launch.hpp:40
CK_TILE_HOST float launch_kernel(const stream_config &s, Callables &&... callables)
Definition: kernel_launch.hpp:140
__device__ index_t get_grid_size()
Definition: get_id.hpp:60
__device__ index_t get_block_size()
Definition: get_id.hpp:62
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1249

◆ CK_TILE_DISPATCH_NAIVE_ATTEN_FWD_LAOYUT_

#define CK_TILE_DISPATCH_NAIVE_ATTEN_FWD_LAOYUT_ ( )