BOS Whisper Tiny on N1A0
Scope
- Checkpoint:
openai/whisper-tiny - Platform: BOS N1A0 / Blackhole, 4 x 5 compute-core grid
- Primary validated demo workload target: single device, batch size 1, greedy decode,
language=en,task=transcribe. The model implementation has batch-size-2 test coverage, but the demo CLI currently restricts execution to batch size 1. Batch size 4 is currently unsupported on N1A0/A0 due to L1 circular-buffer capacity limits.
Environment Setup
export TT_METAL_HOME=</path/to/tt-metal-e2>
cd $TT_METAL_HOME
source env_set.sh
How to Run
Run a single user demo inference:
cd $TT_METAL_HOME
python3 -m models.bos_model.audio.whisper.demo.demo \
--audio-path models/bos_model/audio/whisper/tests/data/
For replicated-input batch inference, use --batch-size.
Note: The same input utterance is repeated
batch_sizetimes across the batch. This does not combine distinct user audio files, such as[audio_A, audio_B], into one batch. The primary validated target is batch size 1; batch size 4 is currently unsupported.
cd $TT_METAL_HOME
python3 -m models.bos_model.audio.whisper.demo.demo \
--audio-path models/bos_model/audio/whisper/tests/data/ \
--batch-size 1
Supported CLI Arguments
Demo: models.bos_model.audio.whisper.demo.demo
| Argument | Default | Supported values | Notes |
|---|---|---|---|
--model-name | openai/whisper-tiny | Hugging Face repo or local model identifier. Only Whisper-Tiny is supported for now. | README examples and current validation target use Whisper Tiny. |
--audio-path | bundled Whisper test WAV | readable WAV path or directory containing WAV files | Input audio for transcription or translation. WAV files in a directory are processed separately, not combined into one batch. |
--language | en | free-form language token string | Passed through to the Whisper processor/generation path. |
--task | transcribe | transcribe, translate | Controls decoder prefix tokens. |
--max-new-tokens | 32 | positive integer | Caps generated decoder tokens. |
--execution-mode | no_trace_single_cq | no_trace_single_cq, trace_single_cq, no_trace_2cq, trace_2cq | Public runtime-selection interface for BOS execution behavior. |
--token-selection-mode | device_greedy | host_full_logits, device_greedy | Selects where greedy token choice is performed. |
--precision-mode | bf8_fast_lm_head_ffn_self_attn_layout_fast | bf16, bf8_fast_lm_head, bf8_fast_lm_head_ffn, bf8_fast_lm_head_ffn_self_attn_layout_fast, decoder BF8 experiment modes | Selects the default optimized path or the BF16 fallback path. |
--offline | off | flag | Uses local Hugging Face artifacts only. |
--prompt | unset | string | Optional decoder prompt text. |
--json | off | flag | Emits machine-readable output payloads. |
--num-devices | 1 | 1 | The batch-size-1 demo workload is restricted to a single device. |
Advanced demo flags:
| Argument | Default | Supported values | Notes |
|---|---|---|---|
--benchmark | off | flag | Switches the demo entrypoint into repeated-run benchmark mode. |
--warmup-runs | 3 | non-negative integer | Used only with --benchmark. |
--measured-runs | 20 | positive integer | Used only with --benchmark. |
--batch-size | 1 | 1 | Controls replicated-input batch inference by repeating the current input waveform batch_size times; it does not batch distinct audio files together. The primary validated target is batch size 1. Batch size 4 is currently unsupported. |
--trial-id | unset | integer | Primarily used by the matrix runner's child-process orchestration. |
--order-index | unset | integer | Primarily used by the matrix runner's child-process orchestration. |
--random-seed | unset | integer | Primarily used by the matrix runner's child-process orchestration. |
--benchmark-result-file | unset | file path | Primarily used by the matrix runner's child-process orchestration. |
Matrix benchmark: models.bos_model.audio.whisper.demo.benchmark_matrix
| Argument | Default | Supported values | Notes |
|---|---|---|---|
--model-name | openai/whisper-tiny | Hugging Face repo or local model identifier | Passed through to each child benchmark process. |
--audio-path | bundled Whisper test WAV | readable WAV path | Shared input audio for each trial/mode combination. |
--language | en | free-form language token string | Passed through to child demo runs. |
--task | transcribe | transcribe, translate | Passed through to child demo runs. |
--max-new-tokens | 32 | positive integer | Passed through to child demo runs. |
--execution-modes | all modes | no_trace_single_cq, trace_single_cq, no_trace_2cq, trace_2cq | One or more execution modes to benchmark. |
--num-trials | 10 | positive integer | Number of fresh-process trial rounds. |
--warmup-runs-per-trial | 5 | non-negative integer | Warmup runs performed inside each child process. |
--measured-runs-per-trial | 30 | positive integer | Timed runs performed inside each child process. |
--baseline-mode | no_trace_single_cq | same choices as --execution-modes | Baseline for paired comparisons in aggregate reports. |
--random-seed | 42 | integer | Controls deterministic per-trial mode ordering. |
--output-dir | required | writable directory path | Stores per-process JSON, logs, and aggregate outputs. |
--offline | off | flag | Uses local Hugging Face artifacts only. |
--prompt | unset | string | Optional decoder prompt text for all child runs. |
--token-selection-mode | host_full_logits | host_full_logits, device_greedy | Passed through to child demo runs. |
--num-devices | 1 | 1 | Passed through to each child process; the demo CLI currently accepts only one device. |
--overwrite | off | flag | Reuses an existing non-empty output directory after cleanup. |
The public CLI surfaces above are sourced from the current argparse definitions in the demo and matrix entrypoints. If new modes or flags are added later, update those parsers first and then refresh this README section.
BF8 fast-mode runner: models.bos_model.audio.whisper.demo.benchmark_bf8_fast_mode
| Argument | Default | Supported values | Notes |
|---|---|---|---|
--mode | validate | oracle, validate, benchmark, benchmark-child, all | Builds PyTorch oracle, validates TT outputs, or runs clean process-level benchmarks. |
--precision-mode | bf8_fast_lm_head | Any mode from tt.precision.resolve_precision_config | Single candidate mode. |
--precision-modes | unset | comma-separated precision modes | Used for candidate sweeps and benchmark matrices. |
--decoder-layers | all | all or comma-separated layer IDs | Restricts decoder BF8 experiments to selected layers. |
--audio-path | all local test WAVs for validation | repeatable WAV path | Repeating this flag creates a heterogeneous batch for benchmark-child/benchmark. |
--include-b2 | off | flag | Adds the mandatory heterogeneous B2 validation pair. |
--local-files-only | off | flag | Uses local Hugging Face artifacts only. |
--warmup-runs | 5 | non-negative integer | Per child process in benchmark mode. |
--measured-runs | 30 | positive integer | Per child process in benchmark mode. |
--processes | 5 | positive integer | Independent child processes in benchmark mode. |
--output-dir | artifacts/whisper_bf8_fast_mode | writable directory | Stores oracle, validation records, benchmark summaries, and cache artifacts. |
Benchmark
Single-mode benchmark:
HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 \
python -m models.bos_model.audio.whisper.demo.demo \
--model-name openai/whisper-tiny \
--audio-path models/bos_model/audio/whisper/tests/data/1298409023920250606.wav \
--execution-mode no_trace_single_cq \
--token-selection-mode device_greedy \
--precision-mode bf8_fast_lm_head_ffn_self_attn_layout_fast \
--offline \
--benchmark \
--warmup-runs 10 \
--measured-runs 100 \
--json
This path now emits per-run raw measurements plus a per-process summary. The timed benchmark sections call ttnn.synchronize_device(...) before the timer starts and after the model call finishes so the reported wall-clock values include submitted async device work instead of only host dispatch time.
Metric notes:
model_only_latency_msincludes host feature extraction and model execution, but excludes WAV file read and process/device/model initialization.end_to_end_latency_msincludes WAV file read, host feature extraction, and model execution for one inference run, but still excludes process/device/model initialization.total_decode_latency_msanddecode_token_counttrack only the timed decode loop. If the first generated token is emitted during prefix prefill, that first token is excluded from those two fields.decode_latency_ms_per_token = total_decode_latency_ms / decode_token_count.p10top90shows the middle 80% range of process-median observations; a narrower range means less between-process spread.coefficient_of_variationisstddev / abs(mean)and is reported asnullwhen the mean is effectively zero.- Longer audio usually makes decoder-throughput comparisons more stable because more decode steps are observed per run.