ai-nic-perf-profiler is an observability-oriented toolkit for correlating NIC hardware counters with distributed training performance regressions. The goal is to help operators identify whether slowdowns are caused by fabric topology issues, RDMA tuning mismatches, SR-IOV partition constraints, or other network-level bottlenecks.
Modern GPU clusters often show throughput degradation during distributed training, but the root cause is not always obvious. This project provides a lightweight profiling scaffold for collecting network-related signals and associating them with training performance indicators so teams can make more informed tuning and capacity decisions.
- Capture NIC-oriented metrics such as packet activity and throughput-related observations
- Model profile samples that can be paired with distributed training performance data
- Provide a simple command-line entry point for running and inspecting a profile session
- Offer a Python package structure that can grow into richer collectors, exporters, and analysis routines
src/ai_nic_perf_profiler/— core Python package for configuration, metrics, profiling, and CLI entry pointstests/— smoke and regression tests for the profiler packageexamples/— example scripts that demonstrate basic usageconfigs/— sample configuration files for runtime settingsscripts/— operational helper scripts for running the profilerdocs/— architecture notes and design context
From the repository root:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtTo install the package in editable mode:
pip install -e .Run the profiler entry point:
PYTHONPATH=src python3 -m ai_nic_perf_profilerYou can also invoke the helper script:
bash scripts/run_profiler.shA minimal example is available in examples/basic_usage.py. It creates a profiler instance, records a few sample observations, and prints a summary.
To export Grafana-friendly metrics, run the CLI with both a JSON report and a Prometheus metrics file:
PYTHONPATH=src python3 -m ai_nic_perf_profiler \
--report-path report.json \
--metrics-path metrics.promThe generated metrics file exposes throughput and latency samples in a Prometheus-compatible format that can be scraped by a Prometheus server and visualized in Grafana.
The default configuration lives in configs/default.yaml. The current scaffold supports:
sample_interval— interval between collected samplesreport_path— output destination for generated reportsenable_diagnostics— toggle for enabling extra diagnostics
The current implementation is intentionally small and modular:
ProfilerConfigdefines runtime settingsSamplerepresents a single metric observationMetricCollectorstores and summarizes samplesPerfProfilerorchestrates recording and reportingcli.pyprovides the command-line interface
This structure is designed to be extended with real NIC collector integrations and richer analysis logic over time.
Run the test suite with:
PYTHONPATH=src python3 -m pytest -qThe current scaffold has been verified by compiling the source tree and executing a minimal in-memory profiling run successfully.
Potential next steps for the project include:
- integration with real NIC telemetry sources
- support for richer time-series analysis and anomaly detection
- export to JSON, CSV, or Prometheus-compatible formats
- visualization and reporting dashboards
- cluster-level correlation with training job metadata
Contributions are welcome. If you are extending the profiler, please keep the package modular, document new behavior clearly, and add tests for any new functionality.