MCPcopy Create free account
hub / github.com/pytorch/executorch / build_src_df

Function build_src_df

examples/arm/visualize.py:185–202  ·  view source on GitHub ↗

Merge source table with performance metrics and total NPU cycles. Returns a tuple of (src_df, cmd_to_op_df) where df_cmd_to_op is needed for unmapped op tracking.

(tables: Tables, perf_df: pd.DataFrame)

Source from the content-addressed store, hash-verified

183
184
185def build_src_df(tables: Tables, perf_df: pd.DataFrame) -> pd.DataFrame:
186 """
187 Merge source table with performance metrics and total NPU cycles.
188 Returns a tuple of (src_df, cmd_to_op_df) where df_cmd_to_op is needed for unmapped op tracking.
189 """
190 return pd.merge(
191 tables.source.rename(columns={"id": "source_id"})[["ext_key", "source_id"]],
192 perf_df,
193 on="source_id",
194 how="left",
195 ).merge(
196 tables.perf[["source_id", "npu_cycles"]]
197 .groupby("source_id")
198 .sum(numeric_only=True)
199 .reset_index(),
200 on="source_id",
201 how="left",
202 )
203
204
205def get_model_node_data(df: pd.DataFrame) -> ndb.ModelNodeData:

Callers 1

build_overlay_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected