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 00b7804 + 860f392 commit 0c884bf
Show file tree
Hide file tree
Showing 51 changed files with 2,601 additions and 620 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/package-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
with:
name: changelog
- name: Assert wheels exist
run: ls -arhl metal_libs-*+*.whl
run: ls -arhl ttnn-*+*.whl
- name: Release
# A major release has not been tagged yet, so we need to do this to avoid
# Node 16 deprecation warning message
Expand All @@ -178,7 +178,7 @@ jobs:
README.md
INSTALLING.md
infra/machine_setup/scripts/setup_hugepages.py
metal_libs-*+*.whl
ttnn-*+*.whl
fail_on_unmatched_files: true
create-docker-release-image:
needs: [
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ttnn-run-sweeps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ on:
- ALL SWEEPS (Nightly)
- add
- tilize
- tilize_with_val_padding
- untilize
- untilize_with_unpadding
- ccl.line_all_gather
- ccl.all_gather_n300
- ccl.all_gather_n300_focused
Expand Down
10 changes: 5 additions & 5 deletions docs/source/ttnn/ttnn/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ Pointwise Unary
ttnn.asinh
ttnn.atan
ttnn.atanh
ttnn.bitwise_and
ttnn.bitwise_or
ttnn.bitwise_xor
ttnn.bitwise_not
ttnn.bitwise_left_shift
ttnn.bitwise_right_shift
Expand Down Expand Up @@ -162,7 +159,6 @@ Pointwise Unary
ttnn.normalize_global
ttnn.normalize_hw
ttnn.polygamma
ttnn.pow
ttnn.prelu
ttnn.rad2deg
ttnn.rdiv
Expand All @@ -175,7 +171,6 @@ Pointwise Unary
ttnn.remainder
ttnn.round
ttnn.rsqrt
ttnn.rsub
ttnn.selu
ttnn.sigmoid
ttnn.sigmoid_accurate
Expand Down Expand Up @@ -309,10 +304,14 @@ Pointwise Binary
ttnn.logical_or_
ttnn.logical_xor_
ttnn.rpow
ttnn.rsub
ttnn.ldexp
ttnn.logical_and
ttnn.logical_or
ttnn.logical_xor
ttnn.bitwise_and
ttnn.bitwise_or
ttnn.bitwise_xor
ttnn.logaddexp
ttnn.logaddexp2
ttnn.hypot
Expand All @@ -335,6 +334,7 @@ Pointwise Binary
ttnn.maximum
ttnn.minimum
ttnn.outer
ttnn.pow
ttnn.polyval
ttnn.scatter
ttnn.atan2
Expand Down
35 changes: 35 additions & 0 deletions models/demos/wormhole/distilbert/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Distilbert Model

# Platforms:
WH N300, N150

## Introduction
DistilBERT is a transformers model, smaller and faster than BERT, which was pretrained on the same corpus in a self-supervised fashion, using the BERT base model as a teacher. The DistilBERT Question Answering model is fine-tuned specifically for the task of extracting answers from a given context, making it highly efficient for question-answering applications.

# Details
The entry point to distilebert model is distilbert_for_question_answering in `models/demos/wormhole/distilbert/tt/ttnn_optimized_distilbert.py`. The model picks up certain configs and weights from huggingface pretrained model. We have used `distilbert-base-uncased-distilled-squad` version from huggingface as our reference.

This model, located in `models/demos/wormhole`, supports functionality on both N150 and N300 devices, depending on availability. If the device is N300, the weights and inputs are distributed across the device, allowing the model to run in parallel.

## Sequence Size: 384

Sequence size determines the maximum length of input sequences processed by the model, optimizing performance and compatibility. It's recommended to set the `sequence_size` to 384

## Batch size: 8

Batch Size determines the number of input sequences processed simultaneously during training or inference, impacting computational efficiency and memory usage. It's recommended to set the `batch_size` to 8

Use `pytest --disable-warnings models/demos/wormhole/distilbert/demo/demo.py::test_demo[wormhole_b0-True-models.demos.wormhole.distilbert.tt.ttnn_optimized_distilbert-8-distilbert-base-uncased-distilled-squad-models/demos/wormhole/distilbert/demo/input_data.json]` to run the ttnn_optimized_distilbert demo.


If you wish to run the demo with a different input, change the pytest fixture input_loc to the desired location and use `pytest --disable-warnings models/demos/wormhole/distilbert/demo/demo.py::test_demo[wormhole_b0-True-models.demos.wormhole.distilbert.tt.ttnn_optimized_distilbert-8-distilbert-base-uncased-distilled-squad-<path to input file>]`. This file is expected to have exactly 8 inputs.

Our second demo is designed to run SQuADV2 dataset, run this with `pytest --disable-warnings models/demos/wormhole/distilbert/demo/demo.py::test_demo_squadv2[wormhole_b0-True-3-8-models.demos.wormhole.distilbert.tt.ttnn_optimized_distilbert-distilbert-base-uncased-distilled-squad]`.

If you wish to run for `n_iterations` samples, use `pytest --disable-warnings models/demos/wormhole/distilbert/demo/demo.py::test_demo_squadv2[wormhole_b0-True-<n_iterations>-8-models.demos.wormhole.distilbert.tt.ttnn_optimized_distilbert-distilbert-base-uncased-distilled-squad]`

## Inputs

The demo receives inputs from respective input_data.json by default. To modify the inputs or specify a different path, adjust the input_path parameter in the command accordingly. It's recommended to avoid direct modifications to the input_data.json file.

# Owner Sudharsan Vijayaraghavan
Loading

0 comments on commit 0c884bf

Please sign in to comment.