File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
torch_ipex/csrc/jit/codegen/onednn Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ void fuseGraph(std::shared_ptr<Graph>& g) {
49
49
Operation createLlgaKernel (const Node* node) {
50
50
auto kernel = std::make_shared<fuser::onednn::LlgaKernel>(node);
51
51
return [kernel](Stack* stack) {
52
- RECORD_FUNCTION (kernel->debugName (), std::vector<c10::IValue>());
52
+ RECORD_FUNCTION (kernel->profileName (), std::vector<c10::IValue>());
53
53
kernel->run (*stack);
54
54
return 0 ;
55
55
};
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ LlgaKernel::LlgaKernel(const Node* fusionNode)
55
55
graph_ (fusionNode->g (attr::Subgraph)),
56
56
nInputs_(graph_->inputs ().size()),
57
57
nOutputs_(graph_->outputs ().size()),
58
- debugName_(genDebugName()) {
58
+ debugName_(genDebugName()),
59
+ profileName_(genProfileName()) {
59
60
// TODO: This is a workaround to recreate the partitions here.
60
61
// The ideal way is to use the partition serialization API (not available from LLGA now)
61
62
// to carry a serialized string representation from graph rewrite and deserialize it here.
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ class LlgaKernel {
29
29
return debugName_;
30
30
}
31
31
32
+ const std::string& profileName () const {
33
+ return profileName_;
34
+ }
35
+
32
36
private:
33
37
bool useOpaqueLayout (size_t offset) const ;
34
38
@@ -57,6 +61,16 @@ class LlgaKernel {
57
61
return " LlgaPartition_" + std::to_string (debugId++);
58
62
}
59
63
64
+ std::string genProfileName () {
65
+ std::vector<std::string> op_list;
66
+ for (auto * node : graph_->block ()->nodes ()) {
67
+ if (node->kind ().is_aten ()) {
68
+ op_list.push_back (node->kind ().toUnqualString ());
69
+ }
70
+ }
71
+ return c10::Join (" +" , op_list);
72
+ }
73
+
60
74
static dnnl::graph::logical_tensor toLogicalTensor (const ArgSpec& s) {
61
75
return s.logical_tensor ();
62
76
}
@@ -68,6 +82,7 @@ class LlgaKernel {
68
82
int64_t nOutputs_ = 0 ;
69
83
dnnl::graph::partition partition_;
70
84
std::string debugName_;
85
+ std::string profileName_;
71
86
};
72
87
73
88
} // namespace onednn
You can’t perform that action at this time.
0 commit comments