Skip to content

Conversation

@mergennachin
Copy link
Contributor

@mergennachin mergennachin commented Jan 15, 2026


DYLD_LIBRARY_PATH=/usr/lib ./cmake-out/examples/models/parakeet/parakeet_runner \
  --model_path examples/models/parakeet/parakeet_metal_optimized_argmax/parakeet_tdt.pte \
  --data_path examples/models/parakeet/parakeet_metal_optimized_argmax/aoti_metal_blob.ptd \
  --audio_path examples/models/parakeet/output.wav \
  --tokenizer_path examples/models/parakeet/parakeet_metal_optimized_argmax/tokenizer.model \
  --repeat 5 --warmup_repeat 3

Here's the output on M1 laptop

https://gist.github.com/mergennachin/a0ffb2b95bb398031ab420e4ec60f499

Copilot AI review requested due to automatic review settings January 15, 2026 22:36
@mergennachin mergennachin requested a review from lucylq as a code owner January 15, 2026 22:36
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 15, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16641

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (2 Unrelated Failures)

As of commit 6534ac7 with merge base d58c8ee (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 15, 2026
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Parakeet model runner to improve timing instrumentation and make it more representative for benchmarking. The changes introduce a ParakeetRunner class that encapsulates model loading and inference, adds granular timing measurements for different pipeline stages, and supports warmup and repeated inference runs.

Changes:

  • Introduced ParakeetRunner class to encapsulate model, tokenizer, and configuration
  • Added detailed timing instrumentation (preprocessor, encoder, decoder components)
  • Added --repeat and --warmup_repeat flags for benchmarking

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
examples/models/parakeet/main.cpp Refactored to use ParakeetRunner class with timing instrumentation and benchmarking support
examples/models/parakeet/README.md Updated documentation for new flags and corrected default tokenizer path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +584 to +585
const int num_iterations = std::max(1, FLAGS_repeat);
const int num_warmup = std::max(1, FLAGS_warmup_repeat);
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using std::max(1, ...) ensures values are at least 1, but FLAGS_repeat and FLAGS_warmup_repeat are already defined with default value 1. If the intent is to guard against negative values, consider adding validation with clear error messages instead of silently clamping to 1. This would make invalid input more obvious to users.

Suggested change
const int num_iterations = std::max(1, FLAGS_repeat);
const int num_warmup = std::max(1, FLAGS_warmup_repeat);
if (FLAGS_repeat <= 0) {
ET_LOG(
Error,
"Invalid value for --repeat: %d. Expected a positive integer.",
FLAGS_repeat);
return 1;
}
if (FLAGS_warmup_repeat <= 0) {
ET_LOG(
Error,
"Invalid value for --warmup_repeat: %d. Expected a positive integer.",
FLAGS_warmup_repeat);
return 1;
}
const int num_iterations = FLAGS_repeat;
const int num_warmup = FLAGS_warmup_repeat;

Copilot uses AI. Check for mistakes.
@mergennachin mergennachin marked this pull request as draft January 15, 2026 22:46
} timing;
};

class ParakeetRunner {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reinventing asr runner from first principals lol

result.tokens, *tokenizer_);

// Compute timestamps
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just defensive llm stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants