Skip to content

Commit

Permalink
custom signal handler
Browse files Browse the repository at this point in the history
  • Loading branch information
chenhu-wang committed Sep 21, 2023
1 parent b00fbd0 commit 2a4d9b1
Show file tree
Hide file tree
Showing 16 changed files with 446 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/common/snippets/src/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Generator::LoweringResult Generator::generate(lowered::LinearIR& linear_ir, cons
if (config.m_save_expressions)
lowered_saved = linear_ir;

lowered_saved = linear_ir;

return { target->get_snippet() };
}

Expand Down
4 changes: 4 additions & 0 deletions src/plugins/intel_cpu/src/emitters/x64/jit_bf16_emitters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class jit_uni_vcvtneps2bf16 : public jit_emitter {

size_t get_inputs_num() const override { return 1; }

void print_debug_info() const override {
std::cerr << "ERROR is from jit_uni_vcvtneps2bf16." << "\n";
}

private:
void emit_impl(const std::vector<size_t>& in_vec_idxs, const std::vector<size_t>& out_vec_idxs) const override {
if (host_isa_ == dnnl::impl::cpu::x64::avx512_core) {
Expand Down
10 changes: 10 additions & 0 deletions src/plugins/intel_cpu/src/emitters/x64/jit_conversion_emitters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ void jit_convert_truncation_emitter::dword2int8(const std::vector<size_t> &in_ve
}
}

void jit_convert_truncation_emitter::print_debug_info() const {
std::cerr << "ERROR is from jit_convert_truncation_emitter." << "\n";
std::cerr << "input_type:" << input_type << " output_type" << output_type << "\n";
}

jit_convert_saturation_emitter::jit_convert_saturation_emitter(jit_generator *host, cpu_isa_t host_isa,
const std::shared_ptr<ngraph::Node>& node, Precision exec_prc)
: jit_convert_emitter(host, host_isa, node, exec_prc) {
Expand Down Expand Up @@ -331,5 +336,10 @@ size_t jit_convert_saturation_emitter::aux_vecs_count() const {
return output_type == ov::element::u8 && host_isa_ == dnnl::impl::cpu::x64::avx512_core? 1 : 0;
}

void jit_convert_saturation_emitter::print_debug_info() const {
std::cerr << "ERROR is from jit_convert_saturation_emitter." << "\n";
std::cerr << "input_type:" << input_type << " output_type" << output_type << "\n";
}

} // namespace intel_cpu
} // namespace ov
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class jit_convert_truncation_emitter : public jit_convert_emitter {
public:
jit_convert_truncation_emitter(dnnl::impl::cpu::x64::jit_generator *host, dnnl::impl::cpu::x64::cpu_isa_t host_isa,
const std::shared_ptr<ngraph::Node>& n, InferenceEngine::Precision exec_prc = InferenceEngine::Precision::FP32);
void print_debug_info() const override;

private:
void emit_impl(const std::vector<size_t>& in, const std::vector<size_t>& out) const override;
Expand All @@ -69,6 +70,7 @@ class jit_convert_saturation_emitter : public jit_convert_emitter {
public:
jit_convert_saturation_emitter(dnnl::impl::cpu::x64::jit_generator *host, dnnl::impl::cpu::x64::cpu_isa_t host_isa,
const std::shared_ptr<ngraph::Node>& n, InferenceEngine::Precision exec_prc = InferenceEngine::Precision::FP32);
void print_debug_info() const override;

private:
void emit_impl(const std::vector<size_t>& in, const std::vector<size_t>& out) const override;
Expand Down
10 changes: 10 additions & 0 deletions src/plugins/intel_cpu/src/emitters/x64/jit_dnnl_emitters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,21 @@ void jit_dnnl_emitter::emit_data() const {
}
}

void jit_dnnl_emitter::print_debug_info() const {
std::cerr << "ERROR is from jit_dnnl_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}

jit_dnnl_aux_emitter::jit_dnnl_aux_emitter(jit_generator *host, cpu_isa_t host_isa,
dnnl_alg_kind_t algKind, float inpAlpha, float inpBeta,
InferenceEngine::Precision exec_prc)
: jit_dnnl_emitter(host, host_isa, algKind, inpAlpha, inpBeta, exec_prc) {
}

void jit_dnnl_aux_emitter::print_debug_info() const {
std::cerr << "ERROR is from jit_dnnl_aux_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}

} // namespace intel_cpu
} // namespace ov
3 changes: 3 additions & 0 deletions src/plugins/intel_cpu/src/emitters/x64/jit_dnnl_emitters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class jit_dnnl_emitter : public jit_emitter {

static std::set<std::vector<element::Type>> get_supported_precisions(const std::shared_ptr<ngraph::Node>& node = nullptr);

void print_debug_info() const override;

protected:
jit_dnnl_emitter(dnnl::impl::cpu::x64::jit_generator *host, dnnl::impl::cpu::x64::cpu_isa_t host_isa,
dnnl_alg_kind_t algKind, float inpAlpha, float inpBeta,
Expand All @@ -47,6 +49,7 @@ class jit_dnnl_aux_emitter : public jit_dnnl_emitter {
jit_dnnl_aux_emitter(dnnl::impl::cpu::x64::jit_generator *host, dnnl::impl::cpu::x64::cpu_isa_t host_isa,
dnnl_alg_kind_t algKind, float inpAlpha, float inpBeta,
InferenceEngine::Precision exec_prc = InferenceEngine::Precision::FP32);
void print_debug_info() const override;

private:
};
Expand Down
48 changes: 48 additions & 0 deletions src/plugins/intel_cpu/src/emitters/x64/jit_dnnl_ext_emitters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class jit_relu_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_relu_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_sigmoid_emitter : public jit_dnnl_emitter {
Expand All @@ -35,6 +39,10 @@ class jit_sigmoid_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_sigmoid_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_tanh_emitter : public jit_dnnl_emitter {
Expand All @@ -48,6 +56,10 @@ class jit_tanh_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_tanh_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_elu_emitter : public jit_dnnl_emitter {
Expand All @@ -61,6 +73,10 @@ class jit_elu_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_elu_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_exp_emitter : public jit_dnnl_emitter {
Expand All @@ -74,6 +90,10 @@ class jit_exp_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_exp_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_abs_emitter : public jit_dnnl_emitter {
Expand All @@ -87,6 +107,10 @@ class jit_abs_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_abs_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_clamp_emitter : public jit_dnnl_emitter {
Expand All @@ -101,6 +125,10 @@ class jit_clamp_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_clamp_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_swish_emitter : public jit_dnnl_emitter {
Expand All @@ -115,6 +143,10 @@ class jit_swish_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_swish_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_hswish_emitter : public jit_dnnl_emitter {
Expand All @@ -129,6 +161,10 @@ class jit_hswish_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_hswish_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_gelu_v0_emitter : public jit_dnnl_emitter {
Expand All @@ -140,6 +176,10 @@ class jit_gelu_v0_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_gelu_v0_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_gelu_v7_emitter : public jit_dnnl_emitter {
Expand All @@ -158,6 +198,10 @@ class jit_gelu_v7_emitter : public jit_dnnl_emitter {

set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_gelu_v7_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

class jit_round_emitter : public jit_dnnl_emitter {
Expand All @@ -179,6 +223,10 @@ class jit_round_emitter : public jit_dnnl_emitter {
dnnl_eltwise_round_half_to_even;
set_injector();
}
void print_debug_info() const override {
std::cerr << "ERROR is from jit_round_emitter." << "\n";
std::cerr << "dnnl_alg_kind:" << kind << " alpha" << alpha << " beta" << beta << "\n";
}
};

} // namespace intel_cpu
Expand Down
Loading

0 comments on commit 2a4d9b1

Please sign in to comment.