Skip to content

Commit ccf8cb8

Browse files
authored
[LLGA] add RECORD_FUNCTION in bridge code (#143)
1 parent e5b8f20 commit ccf8cb8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

torch_ipex/csrc/jit/codegen/onednn/interface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ void fuseGraph(std::shared_ptr<Graph> &g) {
9191
Operation createLlgaKernel(const Node *node) {
9292
auto kernel = std::make_shared<fuser::onednn::LlgaKernel>(node);
9393
return [kernel](Stack *stack) {
94+
#if defined(IPEX_PROFILE_OP)
9495
RECORD_FUNCTION(kernel->profileName(), std::vector<c10::IValue>());
96+
#endif
9597
kernel->run(*stack);
9698
return 0;
9799
};
@@ -105,6 +107,9 @@ RegisterOperators LLGAFusionGroupOp({
105107

106108
Operation createLlgaGuardKernel(const Node *node) {
107109
return [node](Stack *stack) {
110+
#if defined(IPEX_PROFILE_OP)
111+
RECORD_FUNCTION(fuser::onednn::LlgaGuardName(), std::vector<c10::IValue>());
112+
#endif
108113
GRAPH_DEBUG("Guarding node: ", node->kind().toQualString());
109114
std::vector<TypePtr> types = node->tys(attr::types);
110115
const auto num_inputs = types.size();

torch_ipex/csrc/jit/codegen/onednn/kernel.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ ArgSpecs LlgaKernel::specializeOutputSpecs(const partition &partition,
124124
std::tuple<RunArgs, RunArgs>
125125
LlgaKernel::prepareRunArgs(const TensorArgs &inputs,
126126
TensorArgs &outputs) const {
127+
#if defined(IPEX_PROFILE_OP)
128+
RECORD_FUNCTION("LLGA_bridge::prepareRunArgs", std::vector<c10::IValue>({}));
129+
#endif
127130
RunArgs runInputs, runOutputs;
128131
for (size_t i = 0; i < nInputs_; i++) {
129132
auto spec = inputSpecs_[i];

0 commit comments

Comments
 (0)