Skip to content

Commit

Permalink
Merge branch 'main' into dvartanians/fix_yolov4_faster_webdemo
Browse files Browse the repository at this point in the history
  • Loading branch information
dvartaniansTT authored Dec 12, 2024
2 parents 0c884bf + 660d249 commit ce06d62
Show file tree
Hide file tree
Showing 99 changed files with 2,682 additions and 643 deletions.
3 changes: 0 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ Checks: >
-bugprone-unhandled-self-assignment,
-bugprone-unused-raii,
-cert-env33-c,
-cert-err09-cpp,
-cert-err33-c,
-cert-err34-c,
-cert-err58-cpp,
-cert-err61-cpp,
-cert-flp30-c,
-cert-msc30-c,
-cert-msc32-c,
Expand Down Expand Up @@ -121,7 +119,6 @@ Checks: >
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-redundant-expression,
-misc-throw-by-value-catch-by-reference,
-misc-unconventional-assign-operator,
-misc-uniqueptr-reset-release,
-misc-unused-parameters,
Expand Down
6 changes: 6 additions & 0 deletions .github/actions/prepare-metal-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: "Whether to load with profiler"
required: false
default: 'false'
python-version:
description: 'Which version of Python to use to run the tests.'
required: false
default: '3.8'

runs:
using: "composite"
Expand All @@ -25,6 +29,8 @@ runs:
shell: bash
run: tar -xvf ttm_${{ inputs.arch }}.tar
- uses: ./.github/actions/install-python-deps
with:
python-version: ${{ inputs.python-version }}
- name: Collect Workflow Telemetry
if: ${{ !cancelled() }}
uses: catchpoint/workflow-telemetry-action@v2
12 changes: 12 additions & 0 deletions .github/workflows/_build-wheels-impl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ jobs:
os: ${{ inputs.os }}
- name: Clean up dirty files
run: git clean -f -d
- name: Set Python Version
id: python-version
run: |
if [[ "${{ inputs.os }}" == "ubuntu-20.04" ]]; then
echo "python-version=3.8" >> $GITHUB_ENV
elif [[ "${{ inputs.os }}" == "ubuntu-22.04" ]]; then
echo "python-version=3.10" >> $GITHUB_ENV
else
echo "Unsupported OS version: ${{ inputs.os }}"
exit 1
fi
- uses: actions/[email protected]
with:
cache: 'pip'
Expand All @@ -47,6 +58,7 @@ jobs:
if: ${{ inputs.from-precompiled }}
with:
arch: ${{ inputs.arch }}
python-version: ${{ env.python-version }}
- name: Set precompiled dir for precompile builds
if: ${{ inputs.from-precompiled }}
# TT_FROM_PRECOMPILED_DIR env variable allows us to not re-run the full C++ build and instead
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/blackhole-post-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
with:
os: "ubuntu-20.04-amd64"
os: "ubuntu-22.04-amd64"
arch: '["blackhole"]'
build-docker: false
build-wheels:
needs: build-artifact
uses: ./.github/workflows/_build-wheels-impl.yaml
with:
os: "ubuntu-20.04"
os: "ubuntu-22.04"
arch: "blackhole"
from-precompiled: true
# build-artifact-profiler:
Expand All @@ -58,15 +58,15 @@ jobs:
arch: blackhole
runner-label: BH
timeout: 30
os: "ubuntu-20.04"
os: "ubuntu-22.04"
fd-unit-tests:
needs: build-wheels
uses: ./.github/workflows/fast-dispatch-build-and-unit-tests.yaml
secrets: inherit
with:
arch: blackhole
runner-label: BH
os: "ubuntu-20.04"
os: "ubuntu-22.04"
# FD C++ Unit Tests
cpp-unit-tests:
needs: build-artifact
Expand All @@ -76,7 +76,7 @@ jobs:
arch: blackhole
runner-label: BH
timeout: 60
os: "ubuntu-20.04"
os: "ubuntu-22.04"

# profiler-regression:
# needs: build-artifact-profiler
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-and-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ jobs:
-e TT_METAL_SLOW_DISPATCH_MODE=1
-e LD_LIBRARY_PATH=${{ github.workspace }}/build/lib
run_args: |
python3 -m pip install -r $(pwd)/tt_metal/python_env/requirements-dev.txt
pip install --force-reinstall pip==21.2.4
pip install -r tt_metal/python_env/requirements-dev.txt
pip install -e .
./tests/scripts/run_tests.sh --tt-arch ${{ inputs.arch }} --pipeline-type post_commit --dispatch-mode slow
- uses: ./.github/actions/slack-report
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/cpp-post-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ jobs:
-e ARCH_NAME=${{ inputs.arch }}
-e LD_LIBRARY_PATH=${{ github.workspace }}/build/lib
run_args: |
python3 -m pip install -r $(pwd)/tt_metal/python_env/requirements-dev.txt
python3 -m pip install -e .
pip install --force-reinstall pip==21.2.4
pip install -r tt_metal/python_env/requirements-dev.txt
pip install -e .
${{ matrix.test-group.cmd }}
- uses: ./.github/actions/slack-report
if: ${{ failure() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perf-device-models-impl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
test-info: [
{name: "GS", arch: grayskull, runs-on: ["perf-no-reset-grayskull", "bare-metal", "in-service"], machine-type: "bare_metal", timeout: 40},
{name: "N300 WH B0", arch: wormhole_b0, runs-on: ["N300", "pipeline-perf", "bare-metal", "in-service"], machine-type: "bare_metal", timeout: 30},
{name: "N300 WH B0", arch: wormhole_b0, runs-on: ["N300", "pipeline-perf", "bare-metal", "in-service"], machine-type: "bare_metal", timeout: 40},
]
name: "${{ matrix.test-info.name }} device perf"
env:
Expand Down
15 changes: 8 additions & 7 deletions docs/source/tt-metalium/tools/kernel_print.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Note that the core coordinates are logical coordinates, so worker cores and ethe

.. code-block::
export TT_METAL_DPRINT_CORES=0,0 # required, x,y OR (x1,y1),(x2,y2),(x3,y3) OR (x1,y1)-(x2,y2) OR all OR worker OR dispatch
export TT_METAL_DPRINT_ETH_CORES=0,0 # optional, x,y OR (x1,y1),(x2,y2),(x3,y3) OR (x1,y1)-(x2,y2) OR all OR worker OR dispatch
export TT_METAL_DPRINT_CHIPS=0 # optional, comma separated list of chips
export TT_METAL_DPRINT_RISCVS=BR # optional, default is all RISCs. Use a subset of BR,NC,TR0,TR1,TR2
export TT_METAL_DPRINT_FILE=log.txt # optional, default is to print to the screen
export TT_METAL_DPRINT_ONE_FILE_PER_RISC=1 # optional, splits DPRINT data on a per-RISC basis into files under $TT_METAL_HOME/generated/dprint/. Overrides TT_METAL_DPRINT_FILE.
export TT_METAL_DPRINT_CORES=0,0 # required, x,y OR (x1,y1),(x2,y2),(x3,y3) OR (x1,y1)-(x2,y2) OR all OR worker OR dispatch
export TT_METAL_DPRINT_ETH_CORES=0,0 # optional, x,y OR (x1,y1),(x2,y2),(x3,y3) OR (x1,y1)-(x2,y2) OR all OR worker OR dispatch
export TT_METAL_DPRINT_CHIPS=0 # optional, comma separated list of chips
export TT_METAL_DPRINT_RISCVS=BR # optional, default is all RISCs. Use a subset of BR,NC,TR0,TR1,TR2
export TT_METAL_DPRINT_FILE=log.txt # optional, default is to print to the screen
export TT_METAL_DPRINT_PREPEND_DEVICE_CORE_RISC=0 # optional, enabled by default. Prepends prints with <device id>:(<core x>, <core y>):<RISC>:.
export TT_METAL_DPRINT_ONE_FILE_PER_RISC=1 # optional, splits DPRINT data on a per-RISC basis into files under $TT_METAL_HOME/generated/dprint/. Overrides TT_METAL_DPRINT_FILE and disables TT_METAL_DPRINT_PREPEND_DEVICE_CORE_RISC.
To generate kernel debug prints on the device, include the ``debug/dprint.h`` header and use the APIs defined there.
An example with the different features available is shown below:
Expand Down Expand Up @@ -122,4 +123,4 @@ formats for printing from CBs are ``DataFormat::Float32``, ``DataFormat::Float16
}

.. note::
Note that the DPRINT buffer for a RISC is flushed when ``ENDL()`` is called, a ``\n`` character is read, or the device that the RISC belongs to is closed.
The DPRINT buffer for a RISC is only flushed when ``ENDL()`` is called, a ``\n`` character is read, or the device that the RISC belongs to is closed.
2 changes: 1 addition & 1 deletion docs/source/ttnn/ttnn/get_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Get started with the Falcon 7B demo. Navigate to the `Falcon 7B demo folder
for details.

You can also check our demos for
`ResNet <https://github.com/tenstorrent/tt-metal/tree/main/models/demos/resnet>`_,
`ResNet <https://github.com/tenstorrent/tt-metal/tree/main/models/demos/ttnn_resnet>`_,
`BERT <https://github.com/tenstorrent/tt-metal/tree/main/models/demos/metal_BERT_large_11>`_,
`Mistral 7B <https://github.com/tenstorrent/tt-metal/tree/main/models/demos/wormhole/mistral7b>`_,
and
Expand Down
34 changes: 24 additions & 10 deletions models/demos/wormhole/stable_diffusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,36 @@ Inputs by default are provided from `input_data.json`. If you wish to change the
>
> If you are using Wormhole, you must set the `WH_ARCH_YAML` environment variable.
>
> ```
> ```sh
> export WH_ARCH_YAML=wormhole_b0_80_arch_eth_dispatch.yaml
> ```
To run the demo, make sure to build the project, activate the environment, and set the appropriate environment variables.
For more information, refer [installation and build guide](https://github.com/tenstorrent/tt-metal/blob/main/INSTALLING.md).
Use `pytest --disable-warnings --input-path="models/demos/wormhole/stable_diffusion/demo/input_data.json" models/demos/wormhole/stable_diffusion/demo/demo.py::test_demo` to run the demo.
If you wish to run the demo with a different input use `pytest --disable-warnings --input-path="<address_to_your_json_file.json>" models/demos/wormhole/stable_diffusion/demo/demo.py::test_demo`
If you would like to run an interactive demo which will prompt you for the input, use `pytest models/demos/wormhole/stable_diffusion/demo/demo.py::test_interactive_demo`
Our second demo is designed to run poloclub/diffusiondb dataset, run this with `pytest --disable-warnings models/demos/wormhole/stable_diffusion/demo/demo.py::test_demo_diffusiondb`.
If you wish to run for `num_prompts` samples and `num_inference_steps` denoising steps, use `pytest --disable-warnings models/demos/wormhole/stable_diffusion/demo/demo.py::test_demo_diffusiondb[<num_prompts>-<num_inference_steps>]`
```sh
pytest --disable-warnings --input-path="models/demos/wormhole/stable_diffusion/demo/input_data.json" models/demos/wormhole/stable_diffusion/demo/demo.py::test_demo
```
If you wish to run the demo with a different input:
```sh
pytest --disable-warnings --input-path="<address_to_your_json_file.json>" models/demos/wormhole/stable_diffusion/demo/demo.py::test_demo

```
If you would like to run an interactive demo which will prompt you for the input:
```sh
pytest models/demos/wormhole/stable_diffusion/demo/demo.py::test_interactive_demo
```

Our second demo is designed to run poloclub/diffusiondb dataset, run this with:
```sh
pytest --disable-warnings models/demos/wormhole/stable_diffusion/demo/demo.py::test_demo_diffusiondb
```

If you wish to run for `num_prompts` samples and `num_inference_steps` denoising steps:
```sh
pytest --disable-warnings models/demos/wormhole/stable_diffusion/demo/demo.py::test_demo_diffusiondb[<num_prompts>-<num_inference_steps>]
```

Note: ttnn stable diffusion utilizes `PNDMScheduler` and requires `num_inference_steps to be greater than or equal to 4`. [Reference](https://arxiv.org/pdf/2202.09778)

Expand Down
Loading

0 comments on commit ce06d62

Please sign in to comment.