A streamlined CLI tool for profiling Tenstorrent's TT-Metal tests and extracting device kernel performance metrics
Project description
🚀 ttperf - TT-Metal Performance Profiler
A streamlined CLI tool for profiling Tenstorrent's TT-Metal tests and extracting device kernel performance metrics
✨ Features
- 🔍 Automated Profiling: Seamlessly runs Tenstorrent's TT-Metal profiler with pytest
- 📊 CSV Analysis: Automatically extracts and parses performance CSV files
- ⚡ Real-time Output: Shows profiling progress in real-time
- 📈 Performance Metrics: Calculates total DEVICE KERNEL DURATION
- 🎯 Simple CLI: Easy-to-use command-line interface
- 🛠️ Flexible: Supports named profiles and various test paths
🚀 Quick Start
Installation
# Clone the repository
git clone https://github.com/Aswintechie/ttperf.git
cd ttperf
# Install the package
pip install -e .
Basic Usage
# Run profiling on a specific test
ttperf test_performance.py
# Run with a custom profile name
ttperf my_profile pytest test_performance.py
# Run on a specific test method
ttperf tests/test_ops.py::test_matmul
📋 Usage Examples
Simple Test Profiling
ttperf test_conv.py
Named Profile
ttperf conv_benchmark pytest test_conv.py
Specific Test Method
ttperf tests/ops/test_matmul.py::test_basic_matmul
Output Example
▶️ Running: ./tt_metal/tools/profiler/profile_this.py -n conv_benchmark -c "pytest test_conv.py"
... (profiling output) ...
📁 Found CSV path: /path/to/profile_results.csv
⏱️ DEVICE KERNEL DURATION [ns] total: 1234567.89 ns
🛠️ How It Works
- Command Parsing: Analyzes input arguments to determine profile name and test path
- Profile Execution: Runs the Tenstorrent's TT-Metal profiler with the specified test
- Output Monitoring: Streams profiling output in real-time
- CSV Extraction: Parses the output to find the generated CSV file path
- Performance Analysis: Reads the CSV and calculates total device kernel duration
📊 Performance Metrics
The tool extracts the following key metrics:
- DEVICE KERNEL DURATION [ns]: Total time spent in device kernels
- CSV Path: Location of the detailed profiling results
- Real-time Progress: Live output during profiling
🔧 Requirements
- Python 3.7+
- pandas
- Tenstorrent's TT-Metal development environment
- pytest
📁 Project Structure
ttperf/
├── ttperf.py # Main CLI implementation
├── pyproject.toml # Project configuration
├── README.md # This file
└── .gitignore # Git ignore rules
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🐛 Issues
If you encounter any issues, please create an issue on GitHub.
👨💻 Author
Aswin Z
- GitHub: @Aswintechie
🌟 Acknowledgments
- Tenstorrent's TT-Metal development team for the profiling tools
- Python community for excellent libraries like pandas
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ttperf-0.1.0.tar.gz.
File metadata
- Download URL: ttperf-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59bc78f3e6eccb4da23aafb3a681c2e46d74c0edf9625a5218e6be82efbdea8d
|
|
| MD5 |
08738437603e16652e38e900f454123a
|
|
| BLAKE2b-256 |
fc1dcf19fcb0a35ba722b2b17274d25b1a51a46211111086a55667beb8267d6e
|
File details
Details for the file ttperf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ttperf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed787ece9c33faaeca866a8477baf4be725e491c3cc6ff3dd6ba50baa8c22288
|
|
| MD5 |
9c51a9b7fc1e570bff3d875e738f8d5b
|
|
| BLAKE2b-256 |
2b23c543171d9aa98045aabeb6bcc0adfb64e34ce2a6cf48358b836866b2611f
|