Skip to main content

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_size times 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​

ArgumentDefaultSupported valuesNotes
--model-nameopenai/whisper-tinyHugging Face repo or local model identifier. Only Whisper-Tiny is supported for now.README examples and current validation target use Whisper Tiny.
--audio-pathbundled Whisper test WAVreadable WAV path or directory containing WAV filesInput audio for transcription or translation. WAV files in a directory are processed separately, not combined into one batch.
--languageenfree-form language token stringPassed through to the Whisper processor/generation path.
--tasktranscribetranscribe, translateControls decoder prefix tokens.
--max-new-tokens32positive integerCaps generated decoder tokens.
--execution-modeno_trace_single_cqno_trace_single_cq, trace_single_cq, no_trace_2cq, trace_2cqPublic runtime-selection interface for BOS execution behavior.
--token-selection-modedevice_greedyhost_full_logits, device_greedySelects where greedy token choice is performed.
--precision-modebf8_fast_lm_head_ffn_self_attn_layout_fastbf16, bf8_fast_lm_head, bf8_fast_lm_head_ffn, bf8_fast_lm_head_ffn_self_attn_layout_fast, decoder BF8 experiment modesSelects the default optimized path or the BF16 fallback path.
--offlineoffflagUses local Hugging Face artifacts only.
--promptunsetstringOptional decoder prompt text.
--jsonoffflagEmits machine-readable output payloads.
--num-devices11The batch-size-1 demo workload is restricted to a single device.

Advanced demo flags:

ArgumentDefaultSupported valuesNotes
--benchmarkoffflagSwitches the demo entrypoint into repeated-run benchmark mode.
--warmup-runs3non-negative integerUsed only with --benchmark.
--measured-runs20positive integerUsed only with --benchmark.
--batch-size11Controls 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-idunsetintegerPrimarily used by the matrix runner's child-process orchestration.
--order-indexunsetintegerPrimarily used by the matrix runner's child-process orchestration.
--random-seedunsetintegerPrimarily used by the matrix runner's child-process orchestration.
--benchmark-result-fileunsetfile pathPrimarily used by the matrix runner's child-process orchestration.

Matrix benchmark: models.bos_model.audio.whisper.demo.benchmark_matrix​

ArgumentDefaultSupported valuesNotes
--model-nameopenai/whisper-tinyHugging Face repo or local model identifierPassed through to each child benchmark process.
--audio-pathbundled Whisper test WAVreadable WAV pathShared input audio for each trial/mode combination.
--languageenfree-form language token stringPassed through to child demo runs.
--tasktranscribetranscribe, translatePassed through to child demo runs.
--max-new-tokens32positive integerPassed through to child demo runs.
--execution-modesall modesno_trace_single_cq, trace_single_cq, no_trace_2cq, trace_2cqOne or more execution modes to benchmark.
--num-trials10positive integerNumber of fresh-process trial rounds.
--warmup-runs-per-trial5non-negative integerWarmup runs performed inside each child process.
--measured-runs-per-trial30positive integerTimed runs performed inside each child process.
--baseline-modeno_trace_single_cqsame choices as --execution-modesBaseline for paired comparisons in aggregate reports.
--random-seed42integerControls deterministic per-trial mode ordering.
--output-dirrequiredwritable directory pathStores per-process JSON, logs, and aggregate outputs.
--offlineoffflagUses local Hugging Face artifacts only.
--promptunsetstringOptional decoder prompt text for all child runs.
--token-selection-modehost_full_logitshost_full_logits, device_greedyPassed through to child demo runs.
--num-devices11Passed through to each child process; the demo CLI currently accepts only one device.
--overwriteoffflagReuses 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​

ArgumentDefaultSupported valuesNotes
--modevalidateoracle, validate, benchmark, benchmark-child, allBuilds PyTorch oracle, validates TT outputs, or runs clean process-level benchmarks.
--precision-modebf8_fast_lm_headAny mode from tt.precision.resolve_precision_configSingle candidate mode.
--precision-modesunsetcomma-separated precision modesUsed for candidate sweeps and benchmark matrices.
--decoder-layersallall or comma-separated layer IDsRestricts decoder BF8 experiments to selected layers.
--audio-pathall local test WAVs for validationrepeatable WAV pathRepeating this flag creates a heterogeneous batch for benchmark-child/benchmark.
--include-b2offflagAdds the mandatory heterogeneous B2 validation pair.
--local-files-onlyoffflagUses local Hugging Face artifacts only.
--warmup-runs5non-negative integerPer child process in benchmark mode.
--measured-runs30positive integerPer child process in benchmark mode.
--processes5positive integerIndependent child processes in benchmark mode.
--output-dirartifacts/whisper_bf8_fast_modewritable directoryStores 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_ms includes host feature extraction and model execution, but excludes WAV file read and process/device/model initialization.
  • end_to_end_latency_ms includes WAV file read, host feature extraction, and model execution for one inference run, but still excludes process/device/model initialization.
  • total_decode_latency_ms and decode_token_count track 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.
  • p10 to p90 shows the middle 80% range of process-median observations; a narrower range means less between-process spread.
  • coefficient_of_variation is stddev / abs(mean) and is reported as null when the mean is effectively zero.
  • Longer audio usually makes decoder-throughput comparisons more stable because more decode steps are observed per run.