Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Demo changes for tt-buda v0.18.2 #114

Merged
merged 21 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0fad077
Add demo scripts for ssd300resnet50 and yolov6 (pytorch)
kamalrajkannan78 Apr 22, 2024
802fa10
Add tests for retinanet(pytorch)
kamalrajkannan78 May 20, 2024
a0083e6
Patch SSD300-RESNET50's CI failures
kamalrajkannan78 May 21, 2024
1fc4b14
Adjust import path in model script
kamalrajkannan78 May 23, 2024
7e1e37b
Add missed model names in project.toml file
kamalrajkannan78 May 27, 2024
e97ec43
Patch transformers library upgrade CI failures (#89)
kamalrajkannan78 Jun 7, 2024
d72fb1b
Add model demos for Monodle (Pytorch) (#87)
ashokkumarkannan1 Jun 12, 2024
1c74788
Add device_config to test option for customer models (#96)
ashokkumarkannan1 Jun 13, 2024
a5fcb49
patch CI failures for tt_buda_demos Stabilization(30/6/24) (#97)
kamalrajkannan78 Jun 13, 2024
c0b14b8
Fix yolov5 image url issue (#82)
pdeviTT Jun 14, 2024
ae9606f
Fix invalid tests collection (#102)
ashokkumarkannan1 Jun 14, 2024
2f8a5a1
Fix n300 customer pipeline failures (#103)
kamalrajkannan78 Jun 14, 2024
5701848
Patch Customer demos Weekly n300 ci failures (#105)
chandrasekaranpradeep Jun 18, 2024
d9faa64
Remove FPN model test script (#107)
chandrasekaranpradeep Jun 20, 2024
100366b
patch CI failures in tt-buda-demos(Buda release 30.06.24 - Stabilizat…
kamalrajkannan78 Jun 21, 2024
94d2c5e
Fix failure in yolov5 (#109)
meenakshiramanathan1 Jun 26, 2024
a1c652e
Update Buda install steps
milank94 Jul 17, 2024
415df5a
Update all scripts and tests for n300 data parallel mode
mvanniasingheTT Jul 4, 2024
518df55
Remove RetinaNet PyTorch demo
milank94 Jul 18, 2024
0bbfbf5
Update License headers and file
milank94 Jul 18, 2024
99d6420
Add GPL-3.0-only license
milank94 Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,6 @@ distributed as part of the software:

- Olli Huotari - [License available here](https://github.com/holli/yolov3_pytorch/blob/master/LICENSE)
- transformers - [License available here](https://github.com/huggingface/transformers/blob/main/LICENSE)
- monodle - [License available here](https://github.com/xinzhuma/monodle/blob/main/LICENSE)
- NVIDIA Corporation - [License available here](https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/Detection/SSD/LICENSE.md)
- Meituan - [License available here](https://github.com/meituan/YOLOv6/blob/main/LICENSE)
3 changes: 2 additions & 1 deletion check_copyright_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DEFAULT:
allowed_licenses:
- Apache-2.0
- MIT
- GPL-3.0-only

license_for_new_files: Apache-2.0 # License to be used when inserting a new copyright notice

Expand All @@ -29,4 +30,4 @@ ignore: # You can also select ignoring files here
- /CONTRIBUTING.md
- /MAINTAINERS.md
- /model_demos/nlp_demos/falcon/utils/configuration_RW.py

- /model_demos/cv_demos/monodle/utils/model.py
56 changes: 38 additions & 18 deletions first_5_steps/1_install_tt_buda.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,33 @@ PyBuda can be installed using two methods: Docker or Python virtualenv.

If you would like to run PyBuda in a Docker container, then follow the instructions for [PCI Driver Installation](#pci-driver-installation) and [Device Firmware Update](#device-firmware-update) and followed by [Docker Container Installation](#docker-container-installation).

If you would like to run PyBuda in a Python virtualenv, then follow the instructions for the [Setup HugePages](#setup-hugepages), [PCI Driver Installation](#pci-driver-installation), [Device Firmware Update](#device-firmware-update), and [Backend Compiler Dependencies](#backend-compiler-dependencies), followed by the [Tenstorrent Software Package](#tenstorrent-software-package).
If you would like to run PyBuda in a Python virtualenv, then follow the instructions for the [Setup HugePages](#setup-hugepages), [PCI Driver Installation](#pci-driver-installation), [Device Firmware Update](#device-firmware-update), and [Backend Compiler Dependencies](#backend-compiler-dependencies), followed by the [Python Environment Installation](#python-environment-installation).

### Setup HugePages

```bash
NUM_DEVICES=$(lspci -d 1e52: | wc -l)
sudo sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=\"hugepagesz=1G hugepages=${NUM_DEVICES} nr_hugepages=${NUM_DEVICES} iommu=pt\"/g" /etc/default/grub
sudo update-grub
sudo sed -i "/\s\/dev\/hugepages-1G\s/d" /etc/fstab; echo "hugetlbfs /dev/hugepages-1G hugetlbfs pagesize=1G,rw,mode=777 0 0" | sudo tee -a /etc/fstab
sudo reboot
```
1. Download latest [setup_hugepages.py](https://github.com/tenstorrent/tt-metal/blob/main/infra/machine_setup/scripts/setup_hugepages.py) script.

```sh
wget https://raw.githubusercontent.com/tenstorrent/tt-metal/main/infra/machine_setup/scripts/setup_hugepages.py
```

2. Run first setup script.

```sh
sudo -E python3 setup_hugepages.py first_pass
```

3. Reboot

```sh
sudo reboot now
```

4. Run second setup script & check setup.

```sh
sudo -E python3 setup_hugepages.py enable && sudo -E python3 setup_hugepages.py check
```

### PCI Driver Installation

Expand Down Expand Up @@ -106,15 +122,17 @@ Python dependencies. Creating a new virtual environment with PyBuda and librarie

#### Step 1. Navigate to [Releases](https://github.com/tenstorrent/tt-buda/releases)

#### Step 2. Under the latest release, download the `pybuda` and `tvm` and `torchvison` wheel files
#### Step 2. Scroll to find the latest release package in `.zip` format under "Assets" that corresponds to your device and operating system

#### Step 3. Create your Python environment in desired directory
#### Step 3. Download the `.zip` package and unzip to find the `pybuda`, `tvm` and `torchvison` wheel files

#### Step 4. Create your Python environment in desired directory

```bash
python3 -m venv env
```

#### Step 4. Activate environment
#### Step 5. Activate environment

```bash
source env/bin/activate
Expand Down Expand Up @@ -143,7 +161,7 @@ This wheel file installs the Debuda tool designed for debugging purposes.

### Docker Container Installation

Alternatively, PyBuda and its dependencies are provided as Docker images which can run in separate containers.
Alternatively, PyBuda and its dependencies are provided as Docker images which can run in separate containers. The Docker containers can be found under: <https://github.com/orgs/tenstorrent/packages?repo_name=tt-buda>

#### Step 1. Pull the docker image

Expand All @@ -153,26 +171,28 @@ To pull the Docker image, use the following command:
sudo docker pull ghcr.io/tenstorrent/tt-buda/<OS-VERSION>/<TT-DEVICE>:<TAG>
```

Supported OS Versions:
Supported OS `<OS-VERSION>` Versions:

- ubuntu-20-040amd64
- ubuntu-22-040amd64
- ubuntu-20-04-amd64
- ubuntu-22-04-amd64

Supported Tenstorrent Devices:
Supported Tenstorrent `<TT-DEVICE>` Devices:

- gs
- wh
- wh_b0

For example, to run on an Ubuntu version 20.04 on a Grayskull device, use this command:

```bash
sudo docker pull ghcr.io/tenstorrent/tt-buda/ubuntu-20-04-amd64/gs:<TAG>
```

where `<TAG>` is the version number i.e. `v0.12.3`.

#### Step 2. Run the container

```bash
sudo docker run --rm -ti --cap-add=sys_nice --shm-size=4g --device /dev/tenstorrent -v /dev/hugepages-1G:/dev/hugepages-1G -v $(pwd)/:/home/ ghcr.io/tenstorrent/tt-buda/<TAG> bash
sudo docker run --rm -ti --cap-add=sys_nice --shm-size=4g --device /dev/tenstorrent -v /dev/hugepages-1G:/dev/hugepages-1G -v $(pwd)/:/home/ ghcr.io/tenstorrent/tt-buda/<OS-VERSION>/<TT-DEVICE>:<TAG> bash
```

#### Step 3. Change root directory
Expand Down
20 changes: 18 additions & 2 deletions first_5_steps/2_running_nlp_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook serves as a practical guide to getting started running Natural Language Processing (NLP) models on the E75 and E150 AI accelerator hardware using the TT-BUDA compiler stack.\n",
"This notebook serves as a practical guide to getting started running Natural Language Processing (NLP) models on Tenstorrent hardware devices using the TT-BUDA compiler stack. *For detailed information on model compatibility, please refer to the [models support table](../model_demos/README.md#models-support-table) to check which model works with which Tenstorrent device(s).*\n",
"\n",
"The tutorial will walk through an example of running the [BERT](https://en.wikipedia.org/wiki/BERT_(language_model)) model on Tenstorrent AI accelerator hardware. The model weights will be directly downloaded from the [HuggingFace library](https://huggingface.co/docs/transformers/model_doc/bert) and executed through the PyBUDA SDK.\n",
"\n",
Expand Down Expand Up @@ -169,7 +169,23 @@
"source": [
"tt0 = pybuda.TTDevice(\n",
" name=\"tt_device_0\", # here we can give our device any name we wish, for tracking purposes\n",
" arch=pybuda.BackendDevice.Grayskull # we set the target device architecture to compile for\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this example, `tt0` object is created without specifying the device architecture. Pybuda will automatically detectt and define the architecture based on which Tenstorrent device its run on.\n",
"\n",
"### Specifying the Architecture\n",
"If you want to specify the target device architecture, you can pass the `arch` parameter. Here’s how it can be done:\n",
"\n",
"```python\n",
"# Create a TTDevice instance with a specified architecture\n",
"tt0 = pybuda.TTDevice(\n",
" name=\"tt_device_0\", # You can give your device any name for tracking purposes\n",
" arch=pybuda.BackendDevice.Grayskull # Optionally set the target device architecture\n",
")"
]
},
Expand Down
3 changes: 1 addition & 2 deletions first_5_steps/3_running_cv_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook serves as a practical guide to getting started running Computer Vision (CV) models on the E75 and E150 AI accelerator hardware using the TT-BUDA compiler stack.\n",
"This notebook serves as a practical guide to getting started running Computer Vision (CV) models on Tenstorrent hardware devices using the TT-BUDA compiler stack. *For detailed information on model compatibility, please refer to the [models support table](../model_demos/README.md#models-support-table) to check which model works with which Tenstorrent device(s).*\n",
"\n",
"The tutorial will walk through an example of running the [ResNet](https://en.wikipedia.org/wiki/Residual_neural_network) model on Tenstorrent AI accelerator hardware. The model weights will be directly downloaded from the [HuggingFace library](https://huggingface.co/docs/transformers/model_doc/resnet) and executed through the PyBUDA SDK.\n",
"\n",
Expand Down Expand Up @@ -158,7 +158,6 @@
"source": [
"tt0 = pybuda.TTDevice(\n",
" name=\"tt_device_0\", # here we can give our device any name we wish, for tracking purposes\n",
" arch=pybuda.BackendDevice.Grayskull # we set the target device architecture to compile for\n",
")"
]
},
Expand Down
1 change: 0 additions & 1 deletion first_5_steps/4_batched_inputs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@
"source": [
"tt0 = pybuda.TTDevice(\n",
" name=\"tt_device_0\", # here we can give our device any name we wish, for tracking purposes\n",
" arch=pybuda.BackendDevice.Grayskull # we set the target device architecture to compile for\n",
")"
]
},
Expand Down
1 change: 0 additions & 1 deletion first_5_steps/5_serving_tt_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
" # Initialize TTDevice object\n",
" tt0 = pybuda.TTDevice(\n",
" name=\"tt_device_0\", # here we can give our device any name we wish, for tracking purposes\n",
" arch=pybuda.BackendDevice.Grayskull # we set the target device architecture to compile for\n",
" )\n",
"\n",
" # Create PyBUDA module\n",
Expand Down
Loading