Skip to content

Conversation

@aobolensk
Copy link
Contributor

Details:

Unify verbose emitters across different platforms:

  • unify the interface for jit_emitter_info_t (introduce jit_emitter_info_base) across x64/aarch64/riscv64
  • make verbose utils common

Tickets:

  • N/A

@aobolensk aobolensk requested review from a team as code owners February 3, 2026 14:54
@aobolensk aobolensk changed the title [Snippets][CPU] Refactor Snippets verbose utils to shared common helpers [Snippets][CPU] Refactor verbose utils to shared common helpers Feb 3, 2026
@github-actions github-actions bot added category: CPU OpenVINO CPU plugin category: build OpenVINO cmake script / infra labels Feb 3, 2026
@aobolensk aobolensk force-pushed the snippets-cpu-deduplicate-verbose branch 2 times, most recently from 727b3d4 to 811822c Compare February 3, 2026 15:46
Comment on lines 22 to 48
std::string format_memory_emitter_info(const MemoryEmitter* emitter) {
std::stringstream ss;
ss << " src_precision:" << emitter->src_prc << " dst_precision:" << emitter->dst_prc
<< " load/store_element_number:" << emitter->count << " byte_offset:" << emitter->compiled_byte_offset;
return ss.str();
}

/**
* @brief Format kernel emitter common info
*
* This function formats common kernel emitter information that is shared across
* all architectures.
*/
template <typename KernelEmitter>
std::string format_kernel_emitter_info(const KernelEmitter* emitter) {
std::stringstream ss;
ss << " jcp.exec_domain:" << vector_to_string(emitter->jcp.exec_domain) << " num_inputs:" << emitter->num_inputs
<< " num_outputs:" << emitter->num_outputs << " num_unique_buffers:" << emitter->num_unique_buffers
<< " data_ptr_regs_idx:" << vector_to_string(emitter->data_ptr_regs_idx);
return ss.str();
}

/**
* @brief Format segfault detector emitter info
*/
template <typename SegfaultDetectorEmitter>
std::string format_segfault_detector_info(const SegfaultDetectorEmitter* emitter) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like these helpers are not used anywhere. Could you please double check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked, they are indeed unused, removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But shouldn't we reuse them for all 3 platforms instead of removing? As it is done for memory emitters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The print content seems to be different on different platforms. So it is not as a straightforward as there

@github-actions github-actions bot removed the category: build OpenVINO cmake script / infra label Feb 3, 2026
@aobolensk aobolensk force-pushed the snippets-cpu-deduplicate-verbose branch from bd8d2e3 to 1bdf9b6 Compare February 3, 2026 17:30
@aobolensk aobolensk force-pushed the snippets-cpu-deduplicate-verbose branch from 080aa84 to e755a53 Compare February 3, 2026 18:25
Comment on lines 22 to 48
std::string format_memory_emitter_info(const MemoryEmitter* emitter) {
std::stringstream ss;
ss << " src_precision:" << emitter->src_prc << " dst_precision:" << emitter->dst_prc
<< " load/store_element_number:" << emitter->count << " byte_offset:" << emitter->compiled_byte_offset;
return ss.str();
}

/**
* @brief Format kernel emitter common info
*
* This function formats common kernel emitter information that is shared across
* all architectures.
*/
template <typename KernelEmitter>
std::string format_kernel_emitter_info(const KernelEmitter* emitter) {
std::stringstream ss;
ss << " jcp.exec_domain:" << vector_to_string(emitter->jcp.exec_domain) << " num_inputs:" << emitter->num_inputs
<< " num_outputs:" << emitter->num_outputs << " num_unique_buffers:" << emitter->num_unique_buffers
<< " data_ptr_regs_idx:" << vector_to_string(emitter->data_ptr_regs_idx);
return ss.str();
}

/**
* @brief Format segfault detector emitter info
*/
template <typename SegfaultDetectorEmitter>
std::string format_segfault_detector_info(const SegfaultDetectorEmitter* emitter) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But shouldn't we reuse them for all 3 platforms instead of removing? As it is done for memory emitters

Comment on lines 25 to 44
static std::string init_info_jit_load_memory_emitter(const jit_load_memory_emitter* emitter) {
std::stringstream ss;
std::string memory_emitter_info = init_info_jit_memory_emitter(emitter);
std::string memory_emitter_info = snippets_common::format_memory_emitter_info(emitter);
ss << "Emitter_type_name:jit_load_memory_emitter" << memory_emitter_info;
return ss.str();
}

static std::string init_info_jit_load_broadcast_emitter(const jit_load_broadcast_emitter* emitter) {
std::stringstream ss;
std::string memory_emitter_info = init_info_jit_memory_emitter(emitter);
std::string memory_emitter_info = snippets_common::format_memory_emitter_info(emitter);
ss << "Emitter_type_name:jit_load_broadcast_emitter" << memory_emitter_info;
return ss.str();
}

static std::string init_info_jit_store_memory_emitter(const jit_store_memory_emitter* emitter) {
std::stringstream ss;
std::string memory_emitter_info = init_info_jit_memory_emitter(emitter);
std::string memory_emitter_info = snippets_common::format_memory_emitter_info(emitter);
ss << "Emitter_type_name:jit_store_memory_emitter" << memory_emitter_info;
return ss.str();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this code is also duplicated across the platforms. Can we move it to verbose_utils maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done

@praasz praasz added this to the 2026.1 milestone Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: CPU OpenVINO CPU plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants