feat(431): add SI profiling helper scripts for TT-Metal profiling on IRD systems#433
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new tools/si_profiling_helpers/ bundle to standardize TT-Metal/TTNN profiling workflows on IRD systems, covering initial build, per-login environment setup, and a multi-pass tracy-based profiler runner.
Changes:
- Added
setup-step-1-fresh-build.shto build tt-metal with profiler support, create a venv, and build tt-npe with clang-20. - Added
setup-step-2-new-login.shto configure per-session environment variables and source tt-npe tooling. - Added
run-ttnn-profiler.pyto run tracy-based profiling in raw/perf/NOC-trace modes with pytest integration, dry-run, and optional cleanup, plus a README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| tools/si_profiling_helpers/setup-step-1-fresh-build.sh | One-time build/bootstrap script for tt-metal + venv + tt-npe (clang-20). |
| tools/si_profiling_helpers/setup-step-2-new-login.sh | Per-shell-session environment setup (venv, TT_METAL_HOME, PYTHONPATH, tt-npe ENV_SETUP). |
| tools/si_profiling_helpers/run-ttnn-profiler.py | Tracy wrapper to run TTNN profiling in multiple modes with optional pytest integration/cleanup. |
| tools/si_profiling_helpers/README.md | Documentation and recommended workflow for copying and using the helper scripts on IRD systems. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Build tt-metal with profiler support enabled | ||
| ./build_metal.sh --enable-profiler | ||
|
|
||
| # Create Python virtual environment | ||
| ./create_venv.sh | ||
|
|
||
| # Build tt-npe with clang-20 compiler | ||
| cd ../tt-npe | ||
| CMAKE_C_COMPILER=clang-20 CMAKE_CXX_COMPILER=clang++-20 CMAKE_MAKE_PROGRAM=make bash build-npe.sh |
| @@ -0,0 +1,431 @@ | |||
| #!/usr/bin/env python | |||
| # - Required build dependencies must be installed | ||
|
|
||
| # Build tt-metal with profiler support enabled | ||
| ./build_metal.sh --enable-profiler |
There was a problem hiding this comment.
There's no longer an option for enable-profiler in latest build_metal.sh script
|
|
||
| # Create Python virtual environment | ||
| ./create_venv.sh | ||
|
|
There was a problem hiding this comment.
After I created the virtual environment I needed to activate it for next step (tt-npe build)
source python_env/bin/activate
|
|
||
| # Build tt-npe with clang-20 compiler | ||
| cd ../tt-npe | ||
| CMAKE_C_COMPILER=clang-20 CMAKE_CXX_COMPILER=clang++-20 CMAKE_MAKE_PROGRAM=make bash build-npe.sh |
There was a problem hiding this comment.
I didn't have to include the env overrides because I simply activate the Python venv in tt-metal first and then simply ran build-npe.sh and it worked without problems for me
898f138 to
ec62283
Compare
…IRD systems Adds tools/si_profiling_helpers/ with setup and profiler runner scripts to standardize TT-Metal profiling workflows on IRD systems, reducing error-prone manual setup steps. - run-ttnn-profiler.py: python3 shebang; argv list + shell=False to avoid shell injection; per-mode subdirs (raw/, perf/, trace/) so tracy passes don't collide; create output-dir before tracy runs; fix --command help text; resolve output_dir with realpath() to prevent path traversal - setup-step-1-fresh-build.sh: set -euo pipefail for fail-fast behaviour; remove obsolete --enable-profiler flag (profiler support always on) - setup-step-2-new-login.sh: sanity check for tt-metal root; prepend to PYTHONPATH instead of overwriting it Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ec62283 to
e937db7
Compare
Summary
tools/si_profiling_helpers/with three scripts and a README to standardize TT-Metal profiling workflows on IRD systemssetup-step-1-fresh-build.sh: one-time build of tt-metal + tt-npe with profiler support (clang-20)setup-step-2-new-login.sh: per-session env setup (venv, TT_METAL_HOME, PYTHONPATH, NPE tools)run-ttnn-profiler.py: multi-mode tracy profiler runner (raw, NOC traces, perf counters) with pytest integration, dry-run, and optional cleanupTest plan
setup-step-1-fresh-build.shfrom tt-metal directorysetup-step-2-new-login.shin a new shell and verify env vars are setrun-ttnn-profiler.py --dryrunto verify command constructionrun-ttnn-profiler.pyagainst a known TTNN test and verify profiler output directories are created--basic-only,--disable-logging,--cleanupflags and verify each behaves correctlyCloses #431
🤖 Generated with Claude Code