Metadata-Version: 2.4
Name: gwatch
Version: 0.0.4
Summary: G-Watch is a toolbox for GPU profiling and program analysis.
Home-page: https://github.com/G-Watch/G-Watch
Author: Zhuobin Huang
Author-email: zhuobin@u.nus.edu
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: prettytable
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# G-Watch

<div align="center" style="display: flex; margin:10px;">
    <img src="https://github.com/G-Watch/G-Watch/raw/main/docs/logo.jpg" style="width: 350px; margin: 0px; padding: 0px;" />
</div>

***G-Watch*** is a toolbox for GPU profiling and program analysis.
It features rich **Profiling** capabilities on both NVIDIA and AMD GPUs.
Additionally,
G-Watch offers **Program Analysis** tools for inspecting compiler-generated GPU binaries,
facilitating secondary development tasks such as register analysis and binary instrumentation.

## Features

We would release guidance for using G-Watch soon,
currently please take refer to [examples](https://github.com/G-Watch/G-Watch/tree/main/examples)


## Installation

### Install from package

You can install G-Watch directly from PyPI:

```bash
# prerequisites for gwatch
apt-get update
apt-get install -y  python3 python3-pip libelf-dev protobuf-compiler libwebsockets-dev libnuma-dev
```

``` bash
# install from PyPI source
pip install gwatch==0.0.2
```

### Install from source [CUDA]

1. Clone this repository
    ```bash
    git clone --recursive https://github.com/G-Watch/G-Watch-dev.git
    ```

2. Start official nvidia container for building and testing
    ```bash
    cd scripts/docker
    bash run_cuda_12_8.sh -s 1  # start and enter a container with id 1

    # don't need to run, just noted here
    bash run_cuda_12_8.sh -e 1  # enter a container with id 1
    bash run_cuda_12_8.sh -c 1  # close and remove a container with id 1
    ```

3. Install prerequisites
    ```bash
    # inside the container
    apt-get update
    apt-get install -y  git pkg-config python3 python3-pip cmake meson build-essential libeigen3-dev \
                        python3-dev wget libelf-dev libwebsockets-dev libnuma-dev protobuf-compiler \
                        gdb curl libcurl4-openssl-dev xxd libdwarf-dev python-is-python3
    pip3 install perfetto PyYAML tqdm pyyaml packaging loguru PrettyTable matplotlib pandas ninja==1.11.1.3 --break-system-packages

    # for most of our test workloads, we use PyTorch, so it's recommended to install torch as well
    # https://pytorch.org/get-started/locally/
    pip3 install torch torchvision torchaudio --break-system-packages
    ```

4. Build and install python package from source
    ```bash
    # inside the container
    cd /root

    python3 setup.py clean  

    # build and install gwatch
    python3 setup.py install
    ```


### Install from source [ROCm]

1. Clone this repository
    ```bash
    git clone --recursive https://github.com/G-Watch/G-Watch-dev.git
    ```

2. Start official nvidia container for building and testing
    ```bash
    cd scripts/docker
    bash run_rocm_7_2.sh -s 1  # start and enter a container with id 1

    # don't need to run, just noted here
    bash run_rocm_7_2.sh -e 1  # enter a container with id 1
    bash run_rocm_7_2.sh -c 1  # close and remove a container with id 1
    ```

3. Install prerequisites
    ```bash
    # inside the container
    apt-get update
    apt-get install -y  git pkg-config python3 python3-pip cmake meson build-essential libeigen3-dev \
                        python3-dev wget libelf-dev libwebsockets-dev libnuma-dev protobuf-compiler \
                        gdb curl libcurl4-openssl-dev xxd libdwarf-dev python-is-python3 libdw-dev libsqlite3-dev
    pip3 install perfetto PyYAML tqdm pyyaml packaging loguru PrettyTable matplotlib pandas ninja==1.11.1.3 --break-system-packages

    # for most of our test workloads, we use PyTorch, so it's recommended to install torch as well
    # https://pytorch.org/get-started/locally/
    pip3 install torch torchvision --index-url https://download.pytorch.org/whl/rocm7.1
    ```


4. Build and install python package from source
    ```bash
    # inside the container
    cd /root

    python3 setup.py clean  

    # build and install gwatch
    python3 setup.py install
    ```
