32template <
typename dequant_op_t_,
typename dtype_dequant_,
typename tile_op_t_,
33 typename quant_op_t_,
typename tile_shape_,
typename mem_desc_c_t_,
36 quant_op_t_, arch_tag_, dtype_dequant_>,
37 tile_shape_, mem_desc_c_t_,
38 std::enable_if_t<(arch_tag_ == gpu_arch::Xe)>> {
41 quant_op_t_, arch_tag_, dtype_dequant_>;
48 static constexpr gpu_arch arch_tag = arch_tag_;
49 static constexpr uint32_t barrier_count = 0;
50 static constexpr uint32_t slm_size = mem_desc_c_t::is_local
51 ? tile_shape::wg_tile_size_x * tile_shape::wg_tile_size_y
74 inline arguments_t(
typename dequant_op_t::arguments_t dequant_op_args_,
75 typename tile_op_t::arguments_t tile_op_args_,
76 typename quant_op_t::arguments_t quant_op_args_)
77 : dequant_op_args(dequant_op_args_)
78 , tile_op_args(tile_op_args_)
79 , quant_op_args(quant_op_args_) {}
81 : dequant_op_args(args.dequant_op_args)
82 , tile_op_args(args.tile_op_args)
83 , quant_op_args(args.quant_op_args) {}
87 inline arguments_t &
operator=(
const arguments_t &args) {
88 this->dequant_op_args = args.dequant_op_args;
89 this->tile_op_args = args.tile_op_args;
90 this->quant_op_args = args.quant_op_args;
99 inline void init(
typename dequant_op_t::arguments_t dequant_op_args_,
100 typename tile_op_t::arguments_t tile_op_args_,
101 typename quant_op_t::arguments_t quant_op_args_) {
102 dequant_op_args = dequant_op_args_;
103 tile_op_args = tile_op_args_;
104 quant_op_args = quant_op_args_;
110 static constexpr uint32_t sg_tile_y = tile_shape::sg_tile_size_y;
111 static constexpr uint32_t sg_tile_x = tile_shape::sg_tile_size_x;
112 static constexpr uint32_t wg_size_x = tile_shape::wg_size_x;
113 static constexpr uint32_t wg_size_y = tile_shape::wg_size_y;
114 using dtype_c =
typename mem_desc_c_t::dtype;
115 static constexpr mem_layout mem_layout_c = mem_desc_c_t::layout;
116 static constexpr mem_space mem_space_c = mem_desc_c_t::space;
121 int32_t sg_idx = g.
get_id() % wg_size_x;
122 int32_t sg_idy = g.
get_id() / wg_size_x;
123 int32_t tile_offset_x = sg_idx * sg_tile_x;
124 int32_t tile_offset_y = sg_idy * sg_tile_y;
125 mem_desc_c.update_coord(tile_offset_x, tile_offset_y);
143 template <
typename matAcc_t>
146 uint32_t slm_base = 0, uint32_t nbarrier_base = 0) {
147 update_sg_tile_tdesc(g, mem_desc_c);
148 using mat_tile_desc =
typename matAcc_t::tile_desc;
154 dequant_op_t dequant_op;
156 mat_dequant_t mat_dequant;
157 dequant_op(mat_dequant, matAcc, mem_desc_c.coord, args.dequant_op_args);
159 tile_op(mat_dequant, mem_desc_c.coord, args.tile_op_args, slm_base,
163 quant_op(matC, mat_dequant, mem_desc_c.coord, args.quant_op_args);
166 mat_tile_desc, msg_type_c, arch_tag>;
167 matC_payload_t matC_payload(mem_desc_c);
168 subgroup::tile_store<cache_hint::streaming, cache_hint::write_back>(
typename epilogue_policy::dtype_dequant dtype_dequant
Definition quant_tile_op_xe.hpp:45
mem_desc_c_t_ mem_desc_c_t
Definition quant_tile_op_xe.hpp:47
typename epilogue_policy::quant_op_t quant_op_t
Definition quant_tile_op_xe.hpp:43
typename epilogue_policy::dequant_op_t dequant_op_t
Definition quant_tile_op_xe.hpp:42
__XETLA_API KERNEL_FUNC void operator()(work_group_t &g, matAcc_t &matAcc, mem_desc_c_t mem_desc_c, arguments_t args={}, uint32_t slm_base=0, uint32_t nbarrier_base=0)
Default epilogue.
Definition quant_tile_op_xe.hpp:144
tile_shape_ tile_shape
Definition quant_tile_op_xe.hpp:46
typename epilogue_policy::tile_op_t tile_op_t
Definition quant_tile_op_xe.hpp:44
Is the epilogue functor.
Definition api.hpp:35
#define __XETLA_API
Definition common.hpp:43
#define KERNEL_FUNC
KERNEL_FUNC macro.
Definition common.hpp:39
Definition limitation.hpp:607
mem_space
Definition common.hpp:77
gpu_arch
Definition common.hpp:73
msg_type
Definition common.hpp:78
mem_layout
Definition common.hpp:76
Epilogue functor, specialized for quantization operator.
Definition epilogue_policy.hpp:53
quant_op_t_ quant_op_t
Definition epilogue_policy.hpp:56
dequant_op_t_ dequant_op_t
Definition epilogue_policy.hpp:54
dtype_dequant_ dtype_dequant
Definition epilogue_policy.hpp:58
tile_op_t_ tile_op_t
Definition epilogue_policy.hpp:55
arguments_t(typename dequant_op_t::arguments_t dequant_op_args_, typename tile_op_t::arguments_t tile_op_args_, typename quant_op_t::arguments_t quant_op_args_)
Constructs a new arguments t object.
Definition quant_tile_op_xe.hpp:74
tile_op_t::arguments_t tile_op_args
Is tile_op arguments, could be a single tile_op argument or chained_tile_op_args.
Definition quant_tile_op_xe.hpp:61
quant_op_t::arguments_t quant_op_args
Is quant_op arguments.
Definition quant_tile_op_xe.hpp:64
arguments_t()=default
Constructs a new arguments t object.
arguments_t & operator=(const arguments_t &args)
Definition quant_tile_op_xe.hpp:87
void init(typename dequant_op_t::arguments_t dequant_op_args_, typename tile_op_t::arguments_t tile_op_args_, typename quant_op_t::arguments_t quant_op_args_)
Explicit initialization function.
Definition quant_tile_op_xe.hpp:99
arguments_t(const arguments_t &args)
Definition quant_tile_op_xe.hpp:80
dequant_op_t::arguments_t dequant_op_args
Is dequant_op arguments.
Definition quant_tile_op_xe.hpp:57
Is to illustrate the memory information.
Definition api.hpp:44
Is a struct contains some register file.
Definition api.hpp:99
Define a workgroup scope for a specific problem shape.
Definition work_group.hpp:34
__XETLA_API uint32_t get_id()
Definition work_group.hpp:41