text stringlengths 0 2.2M |
|---|
// Store all rows of a tile
|
void jit_avx512_core_amx_1x1_fwd_kernel_t::store_output_vectors(
|
int ocb, int osb) {
|
if (is_bf16()) {
|
store_output_vectors_bf16(ocb, osb);
|
} else {
|
store_output_vectors_int8(ocb, osb);
|
}
|
}
|
// Store single row
|
void jit_avx512_core_amx_1x1_fwd_kernel_t::store_output_vector(
|
const Zmm zmm_out, int ocb, int h, int w) {
|
if (is_bf16()) {
|
store_output_vector_bf16(zmm_out, ocb, h, w);
|
} else {
|
store_output_vector_int8(zmm_out, ocb, h, w);
|
}
|
}
|
void jit_avx512_core_amx_1x1_fwd_kernel_t::prepare_output() {
|
for (int osb = 0; osb < jcp.nb_os_blocking; osb++)
|
for (int ocb = 0; ocb < jcp.nb_oc_blocking; ocb++)
|
tilezero(Tmm(get_out_tensor(osb, ocb)));
|
}
|
void jit_avx512_core_amx_1x1_fwd_kernel_t::store_output(
|
bool do_store, bool has_tail) {
|
auto store_output_subblock = [=](int ocb, int osb) {
|
const int wsp_offset = jcp.typesize_acc
|
* (osb * jcp.nb_oc_blocking * jcp.max_width * jcp.oc_block
|
+ ocb * jcp.max_width * jcp.oc_block);
|
tilestored(ptr[wsp_ptr + stride_seq + wsp_offset],
|
Tmm(get_out_tensor(osb, ocb)));
|
// preserve registers used by binary post_ops injector
|
const injector_utils::conditional_register_preserve_guard_t
|
cond_register_guard(jcp.with_binary, this,
|
{bin_injector_helper_reg_1, bin_injector_helper_reg_2});
|
is_buffer_empty_ = false;
|
is_store_done_ = (do_store) ? true : false;
|
for (int j = 0; j < jcp.tile_width && do_store; j++) {
|
int oh_ = ((osb * jcp.tile_width + j) / jcp.ow);
|
int ow_ = ((osb * jcp.tile_width + j) % jcp.ow);
|
auto addr = ptr[wsp_ptr + jcp.typesize_acc * (j * jcp.oc_block)
|
+ wsp_offset];
|
const Zmm zmm_r = zmm_out(j);
|
vmovups(zmm_r, addr);
|
if (!jcp.is_fast_postops) store_output_vector(zmm_r, ocb, oh_, ow_);
|
}
|
if (do_store && jcp.is_fast_postops) store_output_vectors(ocb, osb);
|
};
|
auto store_output_block = [=](int os_b = 1) {
|
if (jcp.src_zero_point) {
|
mov(reg_src_zero_point, ptr[param1 + GET_OFF(src_zero_point)]);
|
mov(reg_zp_compensation, ptr[param1 + GET_OFF(zp_compensation)]);
|
vpbroadcastd(zmm_src_zp, EVEX_compress_addr(reg_src_zero_point, 0));
|
}
|
if (jcp.dst_zero_point) {
|
mov(reg_dst_zero_point, ptr[param1 + GET_OFF(dst_zero_point)]);
|
vcvtdq2ps(zmm_dst_zp,
|
EVEX_compress_addr(reg_dst_zero_point, 0, true));
|
}
|
for (int ocb = 0; ocb < jcp.nb_oc_blocking; ocb++)
|
for (int osb = 0; osb < os_b; osb++)
|
store_output_subblock(ocb, osb);
|
};
|
Label label_oc_store, label_done;
|
if (check_last_sb_) {
|
mov(reg_last_h, ptr[param1 + GET_OFF(last_h)]);
|
cmp(reg_last_h, 1);
|
je(label_oc_store, T_NEAR);
|
}
|
store_output_block(jcp.nb_os_blocking);
|
jmp(label_done, T_NEAR);
|
L(label_oc_store);
|
store_output_block();
|
L(label_done);
|
update_buffer_pointers();
|
}
|
void jit_avx512_core_amx_1x1_fwd_kernel_t::icb_loop(bool do_store) {
|
enum tiles_cfg_t { cfg_tiles, cfg_tiles_tail };
|
enum restore_tiles_t { write_tiles, read_tiles };
|
auto tdpbxxd = [=](const Tmm &x1, const Tmm &x2, const Tmm &x3) {
|
if (jcp.src_dt == data_type::bf16 && jcp.wei_dt == data_type::bf16) {
|
tdpbf16ps(x1, x2, x3);
|
} else if (jcp.src_dt == data_type::u8 && jcp.wei_dt == data_type::u8) {
|
tdpbuud(x1, x2, x3);
|
} else if (jcp.src_dt == data_type::u8 && jcp.wei_dt == data_type::s8) {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.