Skip to content

Commit 172674e

Browse files
authored
[BUILD][TRITON] Sync with triton main and use pyproject.toml (#51)
1 parent d742ddb commit 172674e

File tree

4 files changed

+46
-21
lines changed

4 files changed

+46
-21
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,32 @@ The best part about this tool is that while it does focus on visualizing GPU ope
4343
## Getting Started
4444

4545
### Prerequisites
46+
4647
- Python installed (preferably the latest available version).
4748
- [Triton](https://github.com/openai/triton/blob/main/README.md) installed. Follow the installation instructions in the linked repository.
4849

4950
Upon successfully installing Triton, install Torch using the following command:
51+
5052
```sh
5153
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121
5254
```
5355

5456
Upon successful installation of Torch make sure to uninstall `pytorch-triton` using the following command:
57+
5558
```sh
5659
pip uninstall pytorch-triton
5760
```
61+
5862
### Installation of Triton-Viz
63+
5964
Clone the repository to your local machine:
6065

6166
```sh
6267
git clone https://github.com/Deep-Learning-Profiling-Tools/triton-viz.git
6368
cd triton-viz
6469
pip install -e .
6570
```
71+
6672
You're all set!
6773

6874
## Working with Examples
@@ -71,10 +77,13 @@ You're all set!
7177
cd examples
7278
python <file_name>.py
7379
```
80+
7481
## More Puzzles
82+
7583
If you're interested in fun puzzles to work with in Triton, do check out: [Triton Puzzles](https://github.com/srush/Triton-Puzzles)
7684

7785
## License
86+
7887
Triton-Viz is licensed under the MIT License. See the [LICENSE](LICENSE) for details.
7988

8089
## Publication

pyproject.toml

+32
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
11
[tool.ruff]
22
ignore = ["E731"]
3+
4+
[build-system]
5+
requires = ["setuptools>=42", "wheel"]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "triton-viz"
10+
version = "1.1.1"
11+
description = "A visualization tool for Triton"
12+
authors = [
13+
{name = "Deep Learning Profiling Tools Team", email = "[email protected]"}
14+
]
15+
readme = "README.md"
16+
license = {text = "MIT"}
17+
requires-python = ">=3.7"
18+
classifiers = [
19+
"Programming Language :: Python :: 3",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: OS Independent",
22+
]
23+
dependencies = [
24+
"setuptools",
25+
"triton",
26+
"gradio",
27+
"pyarrow",
28+
"pre-commit",
29+
"pytest",
30+
"chalk-diagrams @ git+https://github.com/chalk-diagrams/chalk.git"
31+
]
32+
33+
[project.urls]
34+
homepage = "https://github.com/Deep-Learning-Profiling-Tools/triton-viz"

setup.py

+3-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
1-
from setuptools import setup, find_packages
1+
# setup.py
2+
from setuptools import setup
23

3-
setup(
4-
name="triton-viz",
5-
version="1.1.1",
6-
packages=find_packages(),
7-
description="A visualization tool for Triton",
8-
author="Deep Learning Profiling Tools Team",
9-
author_email="[email protected]",
10-
url="https://github.com/Deep-Learning-Profiling-Tools/triton-viz",
11-
install_requires=[
12-
"setuptools",
13-
"triton",
14-
"gradio",
15-
"chalk-diagrams @ git+https://github.com/chalk-diagrams/chalk.git",
16-
"pyarrow",
17-
"pre-commit",
18-
"pytest",
19-
],
20-
)
4+
setup()

triton_viz/interpreter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from triton.runtime.interpreter import (
1818
GridExecutor,
1919
_implicit_cvt,
20-
RESERVED_KWS,
2120
interpreter_builder,
2221
InterpretedFunction,
2322
)
@@ -136,7 +135,8 @@ def _check_storage_contiguous(tensor):
136135

137136
def _grid_executor_call(self, *args_dev, **kwargs):
138137
# Removes reserved keywords from kwargs
139-
kwargs = {k: v for k, v in kwargs.items() if k not in RESERVED_KWS}
138+
argspec = inspect.getfullargspec(self.fn)
139+
kwargs = {k: v for k, v in kwargs.items() if k in argspec.args}
140140
if kwargs.pop("warmup", False):
141141
return
142142
args_hst, kwargs_hst = self._init_args_hst(args_dev, kwargs)

0 commit comments

Comments
 (0)