Skip to content

Commit

Permalink
[BUILD][TRITON] Sync with triton main and use pyproject.toml (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jokeren authored Nov 26, 2024
1 parent d742ddb commit 172674e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 21 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,32 @@ The best part about this tool is that while it does focus on visualizing GPU ope
## Getting Started

### Prerequisites

- Python installed (preferably the latest available version).
- [Triton](https://github.com/openai/triton/blob/main/README.md) installed. Follow the installation instructions in the linked repository.

Upon successfully installing Triton, install Torch using the following command:

```sh
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121
```

Upon successful installation of Torch make sure to uninstall `pytorch-triton` using the following command:

```sh
pip uninstall pytorch-triton
```

### Installation of Triton-Viz

Clone the repository to your local machine:

```sh
git clone https://github.com/Deep-Learning-Profiling-Tools/triton-viz.git
cd triton-viz
pip install -e .
```

You're all set!

## Working with Examples
Expand All @@ -71,10 +77,13 @@ You're all set!
cd examples
python <file_name>.py
```

## More Puzzles

If you're interested in fun puzzles to work with in Triton, do check out: [Triton Puzzles](https://github.com/srush/Triton-Puzzles)

## License

Triton-Viz is licensed under the MIT License. See the [LICENSE](LICENSE) for details.

## Publication
Expand Down
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
[tool.ruff]
ignore = ["E731"]

[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "triton-viz"
version = "1.1.1"
description = "A visualization tool for Triton"
authors = [
{name = "Deep Learning Profiling Tools Team", email = "[email protected]"}
]
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"setuptools",
"triton",
"gradio",
"pyarrow",
"pre-commit",
"pytest",
"chalk-diagrams @ git+https://github.com/chalk-diagrams/chalk.git"
]

[project.urls]
homepage = "https://github.com/Deep-Learning-Profiling-Tools/triton-viz"
22 changes: 3 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
from setuptools import setup, find_packages
# setup.py
from setuptools import setup

setup(
name="triton-viz",
version="1.1.1",
packages=find_packages(),
description="A visualization tool for Triton",
author="Deep Learning Profiling Tools Team",
author_email="[email protected]",
url="https://github.com/Deep-Learning-Profiling-Tools/triton-viz",
install_requires=[
"setuptools",
"triton",
"gradio",
"chalk-diagrams @ git+https://github.com/chalk-diagrams/chalk.git",
"pyarrow",
"pre-commit",
"pytest",
],
)
setup()
4 changes: 2 additions & 2 deletions triton_viz/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from triton.runtime.interpreter import (
GridExecutor,
_implicit_cvt,
RESERVED_KWS,
interpreter_builder,
InterpretedFunction,
)
Expand Down Expand Up @@ -136,7 +135,8 @@ def _check_storage_contiguous(tensor):

def _grid_executor_call(self, *args_dev, **kwargs):
# Removes reserved keywords from kwargs
kwargs = {k: v for k, v in kwargs.items() if k not in RESERVED_KWS}
argspec = inspect.getfullargspec(self.fn)
kwargs = {k: v for k, v in kwargs.items() if k in argspec.args}
if kwargs.pop("warmup", False):
return
args_hst, kwargs_hst = self._init_args_hst(args_dev, kwargs)
Expand Down

0 comments on commit 172674e

Please sign in to comment.