Summary
Profile the self-play and training loops to identify hotspots and gather data to guide optimizations.
Motivation
Profiling is required to prioritize where to optimize (e.g., vectorize training, batch model evaluations, reduce Python loops).
Acceptance criteria / Definition of Done
- Add a profiling script (e.g.,
tools/profile_selfplay.py) that runs a short self-play/training workload and records function-level timings.
- Produce a short report (markdown) listing the top 5 hotspots and one suggested optimization per hotspot.
- Add instructions to
docs/ describing how to reproduce the profiling run locally.
Implementation notes
- Useful tools:
cProfile, pyinstrument, line_profiler, or perf.
- Capture both CPU time and (if present) GPU time (e.g., batch sizes and model forward timings).
- If feasible, include benchmarks before/after a small optimization patch.
Complexity
Medium , research + measurement focused.
Summary
Profile the self-play and training loops to identify hotspots and gather data to guide optimizations.
Motivation
Profiling is required to prioritize where to optimize (e.g., vectorize training, batch model evaluations, reduce Python loops).
Acceptance criteria / Definition of Done
tools/profile_selfplay.py) that runs a short self-play/training workload and records function-level timings.docs/describing how to reproduce the profiling run locally.Implementation notes
cProfile,pyinstrument,line_profiler, orperf.Complexity
Medium , research + measurement focused.