MCPcopy Create free account
hub / github.com/pytorch/tutorials / save_annotations

Function save_annotations

advanced_source/cuda_graph_annotations_tutorial.py:280–291  ·  view source on GitHub ↗

Save kernel annotations to a pickle file.

(output_dir)

Source from the content-addressed store, hash-verified

278# can find it.
279
280def save_annotations(output_dir):
281 """Save kernel annotations to a pickle file."""
282 output_dir = Path(output_dir)
283 output_dir.mkdir(exist_ok=True, parents=True)
284 annotations_path = output_dir / "kernel_annotations_rank0_fwd_bwd.pkl"
285
286 annotations = dict(get_kernel_annotations())
287 with open(annotations_path, "wb") as f:
288 pickle.dump(annotations, f)
289
290 print(f"Saved {len(annotations)} annotations to {annotations_path}")
291 return annotations_path
292
293###############################################################################
294# Post-Processing: Merging Annotations into Traces

Callers 2

mainFunction · 0.85
_comm_workerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected