oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

Profiling : Custom Flow Graph name does not appear in generated graphml file

Open Pantman opened this issue 1 year ago • 4 comments

Summary

I'm not sure if this is the correct place to report TBB profiler problems, but I couldn't find anywhere else.

I'm attempting to use the Flow Graph Analyzer (FGA) to profile my TBB FlowGraph code. But my custom flowGraph names are not appearing in the generated output.

Version

traceml version : "2020.1.1.17863" graphml version : "2020.1.1.17863" TBB version : "2021.11.0"

Environment

  • 12 core AMD machine
  • Windows 10 Enterprise, v22H2
  • MSVC 4.8.09037

Observed Behavior

I'm using the following API to name my nodes and flow graphs to help with visualization:

oneapi::tbb::profiling::set_name(const graph& g, const char *name)
oneapi::tbb::profiling::set_name(const function_node<Input, Output, Policy>& node, const char *name)

In the generated .graphml file, I see correctly named function nodes, but all my graphs have auto generated names, which makes it hard to navigate.

<graph id="g15">
  <node  id="g15::n29">
    <data key="d0">FirstCustomNodeName</data>
    <data key="d5">tbb</data>
    <data key="d4">function_node</data>
    <port name="input_port_0" type="input" offset="0"/>
    <port name="output_port_0" type="output" offset="0"/>
  </node>
  <node  id="g15::n30">
    <data key="d0">SecondCustomNodeName</data>
    <data key="d5">tbb</data>
    <data key="d4">function_node</data>
    <port name="input_port_0" type="input" offset="0"/>
    <port name="output_port_0" type="output" offset="0"/>
  </node>
  <edge id="g15::e14" target="g15::n30" targetoffset="0" targetport="input_port_0" source="g15::n29" sourceoffset="0" sourceport="output_port_0"/>
</graph>

There is no custom graph name in the xml export. In this case, the graph name appears only as "g15", when it should be "CustomGraphName".

Expected Behavior

I would expect that the graph would have its custom name in the XML, and that name would be used in the FGA tool to identify flowGraphs by name.

Steps To Reproduce

  1. Create a flow graph with one or more nodes
  2. Call set_name on the graph and nodes
  3. Generate the trace output (following instructions in FGA documentation)
  4. Observe output in FGA tool and graphml file.

Pantman avatar Aug 16 '24 16:08 Pantman

Looking further, I noticed that the Flow Graph node execution policy is also missing from the graphml output.

Pantman avatar Aug 16 '24 16:08 Pantman

Another related trace issue - timestamps in FGA on Windows are 100 times too small. E.g. the tool shows the runtime of my trace as 4.6ms, but the actual runtime is 463ms.

There's also a crash bug: In my environment, calling tbb::profiling::event::emit(std::string&), causes FGA to crash when loading the capture.

Pantman avatar Aug 19 '24 20:08 Pantman

@Pantman FYI - see the deprecation notice for Flow Graph Analyzer - https://www.intel.com/content/www/us/en/docs/advisor/user-guide/2024-2/design-and-analyze-flow-graphs.html

omalyshe avatar Aug 23 '24 11:08 omalyshe

Hi @omalyshe,

Thanks for the response. I didn't see that note, that's bad news! I only recently downloaded Intel Advisor, and it was 2024.2 and it still includes FGA. I guess Intel haven't got around to removing it yet.

The page you linked says to check the FAQ for more details, but I can't find it. Do you know where it is? Hopefully the FGA functionality will be integrated into another tool, but maybe this is wishful thinking. I was hoping to make more use of flow graphs, but the documentation is incomplete, and it seems like the tooling is being dropped.

Many thanks!

Pantman avatar Aug 23 '24 17:08 Pantman