Skip to content

Commit a8de824

Browse files
FindHaofacebook-github-bot
authored andcommitted
Repo is moved to meta-pytorch (#52)
Summary: This pull request updates the project's URLs and references to reflect its new location under the `meta-pytorch` organization, and includes minor improvements and maintenance. ### Changes - Updated all repository, documentation, and GitHub Pages links from `pytorch-labs` to `meta-pytorch` in: - `README.md` - `pyproject.toml` - `.github/workflows/test.yml` - `tritonparse/tools/decompress_bin_ndjson.py` - `website/src/App.tsx` - Updated `git clone`、`pip install`、GitHub Pages、Issues、Discussions links - Added `.github/copilot-instructions.md` to provide project context for AI assistants. - Minor `.gitignore` update(add `*.mdc`)。 - Minor formatting and comment corrections (e.g., in `decompress_bin_ndjson.py`). Pull Request resolved: #52 Reviewed By: adamomainz Differential Revision: D79746108 Pulled By: FindHao fbshipit-source-id: 8cad84377bb5fd572a36c5b4d882652c274379b8
1 parent 0529d66 commit a8de824

File tree

7 files changed

+69
-22
lines changed

7 files changed

+69
-22
lines changed

.github/copilot-instructions.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copilot Instructions for TritonParse
2+
3+
## Project Overview
4+
- **TritonParse** is a Python tool for visualizing and analyzing Triton kernel compilation and launch traces. It integrates tightly with Triton and PyTorch workflows, providing structured logging and IR comparison.
5+
- The frontend is a React/Vite/TypeScript webapp (see `website/`), while the backend is Python (see `tritonparse/`).
6+
7+
## Key Components
8+
- `tritonparse/structured_logging.py`: Core for logging kernel launches and compilation events, including stack traces and source mapping.
9+
- `tritonparse/utils.py`: Main entry for parsing logs and generating output files (`.ndjson.gz`).
10+
- `tritonparse/sourcemap_utils.py`: Utilities for stack trace analysis, session ID extraction, and source mapping.
11+
- `tests/`: Contains both automated (unittest) and manual test scripts. See `tests/test_tritonparse.py` for main test suite.
12+
- `website/`: Web UI for visualizing trace files. No backend server required; all processing is client-side.
13+
14+
## Developer Workflows
15+
- **Build/Install**: `pip install -e .` (Python ≥3.10, Triton >3.3.1 required)
16+
- **Generate Traces**: Use `tritonparse.structured_logging.init()` in your Triton/PyTorch code, then run `tritonparse.utils.unified_parse()` to produce trace files.
17+
- **Run Tests**: `python -m unittest tests.test_tritonparse -v` (see `tests/README.md` for details)
18+
- **Manual Test**: `python tests/test_add.py` (generates logs and parses them)
19+
- **CI Scripts**: Use `.ci/*.sh` for environment setup, Triton install, and test runs. See `.ci/README.md` for workflow.
20+
21+
## Patterns & Conventions
22+
- **Session ID Extraction**: Session IDs for autotune are derived from stack traces (see `get_autotune_session_id` in `sourcemap_utils.py`). The logic may need to distinguish user code from framework/runtime code.
23+
- **Test Isolation**: Each test defines its own kernel to avoid cache interference. CUDA tests are skipped if no GPU is available.
24+
- **Log Output**: All logs and parsed outputs are written to `tests/parsed_output/` or user-specified directories.
25+
- **Environment Variables**: Commonly used for controlling debug, cache, and device selection (e.g., `TRITONPARSE_DEBUG=1`, `TORCHINDUCTOR_FX_GRAPH_CACHE=0`).
26+
27+
## Integration Points
28+
- **Triton**: Must be installed from source for full feature support. See `pyproject.toml` and README for details.
29+
- **PyTorch**: Used in tests and example kernels.
30+
- **Web UI**: Consumes `.ndjson.gz` trace files for visualization. No server required.
31+
32+
## Troubleshooting
33+
- If logs are missing, check Triton installation and ensure logging is enabled.
34+
- For test failures, verify CUDA availability and correct environment setup.
35+
- Use debug mode (`TRITONPARSE_DEBUG=1`) for verbose output.
36+
37+
## References
38+
- See `README.md` (project root) for quick start, features, and documentation links.
39+
- See `tests/README.md` for test structure and commands.
40+
- See `.ci/README.md` for CI and environment setup scripts.
41+
42+
---
43+
44+
**For new agents:**
45+
- Always check for the latest conventions in the above files before making changes.
46+
- Prefer using provided utility functions and logging mechanisms over custom implementations.
47+
- When analyzing stack traces or session IDs, refer to `sourcemap_utils.py` and related test cases for expected patterns.

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ jobs:
5050
5151
- name: Check code formatting
5252
run: |
53-
make format-check || (echo "❌ Format check failed. Please run 'make format' to fix formatting issues, then commit the changes." && echo "📖 For detailed formatting guide, see: https://github.com/pytorch-labs/tritonparse/wiki/05.-Code-Formatting" && exit 1)
53+
make format-check || (echo "❌ Format check failed. Please run 'make format' to fix formatting issues, then commit the changes." && echo "📖 For detailed formatting guide, see: https://github.com/meta-pytorch/tritonparse/wiki/05.-Code-Formatting" && exit 1)
5454
5555
- name: Check linting
5656
run: |
57-
make lint-check || (echo "❌ Linting failed. Please run 'make format' to fix formatting issues, then commit the changes." && echo "📖 For detailed formatting guide, see: https://github.com/pytorch-labs/tritonparse/wiki/05.-Code-Formatting" && exit 1)
57+
make lint-check || (echo "❌ Linting failed. Please run 'make format' to fix formatting issues, then commit the changes." && echo "📖 For detailed formatting guide, see: https://github.com/meta-pytorch/tritonparse/wiki/05.-Code-Formatting" && exit 1)
5858
5959
test-from-source:
6060
runs-on: 4-core-ubuntu-gpu-t4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ venv/
6767
ENV/
6868
env.bak/
6969
venv.bak/
70-
70+
*.mdc
7171

7272
# end

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# TritonParse
22

33
[![License: BSD-3](https://img.shields.io/badge/License-BSD--3-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
4-
[![GitHub Pages](https://img.shields.io/badge/GitHub%20Pages-Deploy-brightgreen)](https://pytorch-labs.github.io/tritonparse/)
4+
[![GitHub Pages](https://img.shields.io/badge/GitHub%20Pages-Deploy-brightgreen)](https://meta-pytorch.org/tritonparse/)
55

66
**A comprehensive visualization and analysis tool for Triton IR files** — helping developers analyze, debug, and understand Triton kernel compilation processes.
77

8-
🌐 **[Try it online →](https://pytorch-labs.github.io/tritonparse/?json_url=https://pytorch-labs.github.io/tritonparse/dedicated_log_triton_trace_findhao__mapped.ndjson.gz)**
8+
🌐 **[Try it online →](https://meta-pytorch.org/tritonparse/?json_url=https://meta-pytorch.org/tritonparse/dedicated_log_triton_trace_findhao__mapped.ndjson.gz)**
99

1010
## ✨ Key Features
1111

@@ -56,15 +56,15 @@ INFO:tritonparse:Copying parsed logs from /tmp/tmp1gan7zky to /scratch/findhao/t
5656

5757
### 2. Visualize Results
5858

59-
**Visit [https://pytorch-labs.github.io/tritonparse/](https://pytorch-labs.github.io/tritonparse/?json_url=https://pytorch-labs.github.io/tritonparse/dedicated_log_triton_trace_findhao__mapped.ndjson.gz)** and open your local trace files (.ndjson.gz format).
59+
**Visit [https://meta-pytorch.org/tritonparse/](https://meta-pytorch.org/tritonparse/?json_url=https://meta-pytorch.org/tritonparse/dedicated_log_triton_trace_findhao__mapped.ndjson.gz)** and open your local trace files (.ndjson.gz format).
6060

6161
> **🔒 Privacy Note**: Your trace files are processed entirely in your browser - nothing is uploaded to any server!
6262
6363
## 🛠️ Installation
6464

6565
**For basic usage (trace generation):**
6666
```bash
67-
git clone https://github.com/pytorch-labs/tritonparse.git
67+
git clone https://github.com/meta-pytorch/tritonparse.git
6868
cd tritonparse
6969
pip install -e .
7070
```
@@ -80,12 +80,12 @@ pip install triton
8080

8181
| 📖 Guide | Description |
8282
|----------|-------------|
83-
| **[🏠 Wiki Home](https://github.com/pytorch-labs/tritonparse/wiki)** | Complete documentation and navigation |
84-
| **[📦 Installation Guide](https://github.com/pytorch-labs/tritonparse/wiki/01.-Installation)** | Detailed setup for all scenarios |
85-
| **[📋 Usage Guide](https://github.com/pytorch-labs/tritonparse/wiki/02.-Usage-Guide)** | Complete workflow and examples |
86-
| **[🌐 Web Interface Guide](https://github.com/pytorch-labs/tritonparse/wiki/03.-Web-Interface-Guide)** | Master the visualization interface |
87-
| **[🔧 Developer Guide](https://github.com/pytorch-labs/tritonparse/wiki/04.-Developer-Guide)** | Contributing and development setup |
88-
| **[❓ FAQ](https://github.com/pytorch-labs/tritonparse/wiki/06.-FAQ)** | Frequently asked questions |
83+
| **[🏠 Wiki Home](https://github.com/meta-pytorch/tritonparse/wiki)** | Complete documentation and navigation |
84+
| **[📦 Installation Guide](https://github.com/meta-pytorch/tritonparse/wiki/01.-Installation)** | Detailed setup for all scenarios |
85+
| **[📋 Usage Guide](https://github.com/meta-pytorch/tritonparse/wiki/02.-Usage-Guide)** | Complete workflow and examples |
86+
| **[🌐 Web Interface Guide](https://github.com/meta-pytorch/tritonparse/wiki/03.-Web-Interface-Guide)** | Master the visualization interface |
87+
| **[🔧 Developer Guide](https://github.com/meta-pytorch/tritonparse/wiki/04.-Developer-Guide)** | Contributing and development setup |
88+
| **[❓ FAQ](https://github.com/meta-pytorch/tritonparse/wiki/06.-FAQ)** | Frequently asked questions |
8989

9090
## 🛠️ Tech Stack
9191

@@ -103,22 +103,22 @@ Each stage can be inspected and compared to understand optimization transformati
103103

104104
## 🤝 Contributing
105105

106-
We welcome contributions! Please see our **[Developer Guide](https://github.com/pytorch-labs/tritonparse/wiki/04.-Developer-Guide)** for:
106+
We welcome contributions! Please see our **[Developer Guide](https://github.com/meta-pytorch/tritonparse/wiki/04.-Developer-Guide)** for:
107107
- Development setup
108108
- Code formatting standards
109109
- Pull request process
110110
- Architecture overview
111111

112112
## 📞 Support & Community
113113

114-
- **🐛 Report Issues**: [GitHub Issues](https://github.com/pytorch-labs/tritonparse/issues)
115-
- **💬 Discussions**: [GitHub Discussions](https://github.com/pytorch-labs/tritonparse/discussions)
116-
- **📚 Documentation**: [TritonParse Wiki](https://github.com/pytorch-labs/tritonparse/wiki)
114+
- **🐛 Report Issues**: [GitHub Issues](https://github.com/meta-pytorch/tritonparse/issues)
115+
- **💬 Discussions**: [GitHub Discussions](https://github.com/meta-pytorch/tritonparse/discussions)
116+
- **📚 Documentation**: [TritonParse Wiki](https://github.com/meta-pytorch/tritonparse/wiki)
117117

118118
## 📄 License
119119

120120
This project is licensed under the BSD-3 License - see the [LICENSE](LICENSE) file for details.
121121

122122
---
123123

124-
**✨ Ready to get started?** Visit our **[Installation Guide](https://github.com/pytorch-labs/tritonparse/wiki/01.-Installation)** or try the **[online tool](https://pytorch-labs.github.io/tritonparse/)** directly!
124+
**✨ Ready to get started?** Visit our **[Installation Guide](https://github.com/meta-pytorch/tritonparse/wiki/01.-Installation)** or try the **[online tool](https://meta-pytorch.org/tritonparse/)** directly!

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ sorter = "usort"
3131
first_party_detection = false
3232

3333
[project.urls]
34-
"Homepage" = "https://github.com/pytorch-labs/tritonparse"
34+
"Homepage" = "https://github.com/meta-pytorch/tritonparse"

tritonparse/tools/decompress_bin_ndjson.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def decompress_bin_ndjson(input_file: str, output_file: str = None) -> None:
4949
try:
5050
line_count = 0
5151
# Because we use NDJSON format, each line is a complete JSON record.
52-
# It is guruanteed here https://github.com/pytorch-labs/tritonparse/blob/
52+
# It is guruanteed here https://github.com/meta-pytorch/tritonparse/blob/
5353
# c8dcc2a94ac10ede4342dba7456f6ebd8409b95d/tritonparse/structured_logging.py#L320
5454
with gzip.open(input_path, "rt", encoding="utf-8") as compressed_file:
5555
with open(output_path, "w", encoding="utf-8") as output:

website/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ function App() {
386386
{/* GitHub and Wiki Links */}
387387
<div className="flex items-center space-x-4">
388388
<ExternalLink
389-
href="https://github.com/pytorch-labs/tritonparse"
389+
href="https://github.com/meta-pytorch/tritonparse"
390390
title="View on GitHub"
391391
text="GitHub"
392392
icon={
@@ -397,7 +397,7 @@ function App() {
397397
/>
398398

399399
<ExternalLink
400-
href="https://github.com/pytorch-labs/tritonparse/wiki"
400+
href="https://github.com/meta-pytorch/tritonparse/wiki"
401401
title="View Wiki"
402402
text="Wiki"
403403
icon={

0 commit comments

Comments
 (0)