Repository navigation
Add CI to export Whisper models to Ascend NPU - #3008
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis pull request introduces a new Whisper model export workflow for Ascend NPU alongside a new Python generator script that creates model configuration matrices. It updates existing export workflows (Paraformer, SenseVoice, Zipformer) with artifact cleanup and publishing stages to HuggingFace and ModelScope repositories. Minor debug logging is added to test and export scripts. Changes
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant PyGen as Python Generator
participant Matrix as Build Matrix
participant Exporter as Export Container
participant HF as HuggingFace
participant MS as ModelScope
GH->>PyGen: Invoke generate_whisper.py
PyGen->>PyGen: Enumerate CANN/SOC versions
PyGen->>PyGen: Generate model combinations
PyGen->>GH: Output JSON matrix
GH->>Matrix: Create matrix job
Matrix->>Exporter: Trigger export job per config
Exporter->>Exporter: Download model weights
Exporter->>Exporter: Export to ONNX
Exporter->>Exporter: Convert ONNX to OM (atc)
Exporter->>Exporter: Package tar.bz2 artifact
Exporter->>HF: Publish with git-lfs
Exporter->>MS: Publish with git-lfs
HF-->>Exporter: Confirm push
MS-->>Exporter: Confirm push
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @csukuangfj, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the continuous integration capabilities by adding support for exporting Whisper speech recognition models to Huawei Ascend NPUs. It introduces a new Python script to systematically generate export configurations across different hardware and software environments, ensuring broader compatibility and streamlined model deployment. Minor adjustments were also made to existing test and export utilities to improve usability and debugging. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a CI workflow to export Whisper models to Ascend NPU. The changes include a new Python script for generating CI matrix configurations and modifications to related test and export scripts. The overall implementation is good, but I've identified a minor issue with a leftover debugging print statement that should be removed to ensure clean CI logs.
| for t in model.sot_sequence: | ||
| token = np.array([[t]], dtype=np.int32) # sot | ||
| mask = causal_mask_1d(offset.item(), model.n_text_ctx) | ||
| print(t, model.sot_sequence, token, mask.shape, len(cross_kv), len(self_kv)) |
You can find them at
https://huggingface.co/k2-fsa/sherpa-onnx-models/tree/main/asr-models/ascend-npu/whisper
or at
https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models-ascend
Summary by CodeRabbit
Release Notes
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.