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

Function count_lanes

advanced_source/cuda_graph_annotations_tutorial.py:512–519  ·  view source on GitHub ↗

Count kernels per lane (tid).

(trace)

Source from the content-addressed store, hash-verified

510def compare_traces(raw_trace, annotated_trace):
511 """Compare kernel distribution before and after annotation."""
512 def count_lanes(trace):
513 """Count kernels per lane (tid)."""
514 counter = Counter(
515 event["tid"]
516 for event in trace["traceEvents"]
517 if event.get("cat") == "kernel"
518 )
519 return dict(sorted(counter.items()))
520
521 raw_lanes = count_lanes(raw_trace)
522 annotated_lanes = count_lanes(annotated_trace)

Callers 1

compare_tracesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected