From e96ba741820d9e433d3702e8b165bb9a8ee6e06b Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 10:05:41 +0800 Subject: [PATCH 01/14] update latest ggml --- sense-voice/csrc/third-party/ggml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sense-voice/csrc/third-party/ggml b/sense-voice/csrc/third-party/ggml index 475e012..5ceeadd 160000 --- a/sense-voice/csrc/third-party/ggml +++ b/sense-voice/csrc/third-party/ggml @@ -1 +1 @@ -Subproject commit 475e01227333a3a29ed0859b477beabcc2de7b5e +Subproject commit 5ceeaddc68cb9f60a80c0ed70750a3cc79fb85e1 From 5bf1d4c73b5b5e3d738875ad350db0ec6fc41b01 Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 11:47:44 +0800 Subject: [PATCH 02/14] use ubuntu-22.04 instead of ubuntu-latest --- .github/workflows/build.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0ce8d97..9bf6471 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,8 +5,8 @@ env: ubuntu_image: "ubuntu:22.04" jobs: - ubuntu-latest: - runs-on: ubuntu-latest + ubuntu-22: + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -53,8 +53,8 @@ jobs: make - ubuntu-latest-gcc: - runs-on: ubuntu-latest + ubuntu-22-gcc: + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -84,8 +84,8 @@ jobs: make ctest -L gh --output-on-failure' - ubuntu-latest-clang: - runs-on: ubuntu-latest + ubuntu-22-clang: + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -116,8 +116,8 @@ jobs: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang make' - ubuntu-latest-gcc-sanitized: - runs-on: ubuntu-latest + ubuntu-22-gcc-sanitized: + runs-on: ubuntu-22.04 strategy: fail-fast: false From b17646cd0c6539ba12a1300908eed788aeb3feba Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 11:53:10 +0800 Subject: [PATCH 03/14] install libsdl2 for stream --- .github/workflows/build.yaml | 8 ++++---- README-EN.md | 1 + README.md | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9bf6471..6041caf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,7 +27,7 @@ jobs: -w /workspace ${{ env.ubuntu_image }} /bin/sh -c ' set -e apt update - apt install -y build-essential git cmake + apt install -y build-essential git cmake libsdl2-dev git config --global --add safe.directory /workspace git config --global --add safe.directory /workspace/sense-voice/csrc/third-party/ggml git submodule sync && git submodule update --init --recursive @@ -76,7 +76,7 @@ jobs: -w /workspace ${{ env.ubuntu_image }} /bin/sh -c ' set -e apt update - apt install -y build-essential cmake git + apt install -y build-essential libsdl2-dev cmake git git config --global --add safe.directory /workspace git config --global --add safe.directory /workspace/sense-voice/csrc/third-party/ggml git submodule sync && git submodule update --init --recursive @@ -109,7 +109,7 @@ jobs: -w /workspace ${{ env.ubuntu_image }} /bin/sh -c ' set -e apt update - apt install -y clang build-essential cmake git + apt install -y clang build-essential libsdl2-dev cmake git git config --global --add safe.directory /workspace git config --global --add safe.directory /workspace/sense-voice/csrc/third-party/ggml git submodule sync && git submodule update --init --recursive @@ -139,7 +139,7 @@ jobs: -w /workspace ${{ env.ubuntu_image }} /bin/sh -c ' set -e apt update - apt install -y build-essential cmake git + apt install -y build-essential libsdl2-dev cmake git git config --global --add safe.directory /workspace git config --global --add safe.directory /workspace/sense-voice/csrc/third-party/ggml git submodule sync && git submodule update --init --recursive diff --git a/README-EN.md b/README-EN.md index 5f7b135..0e22abf 100644 --- a/README-EN.md +++ b/README-EN.md @@ -115,6 +115,7 @@ sense_voice_full_with_state: decoder audio use 1.011289 s, rtf is 0.182323. ### Streaming Speech Recognition ```bash +sudo apt install libsdl2-dev ./bin/sense-voice-stream -m /path/gguf-fp16-sense-voice-small.bin ``` ## Acknowledgements diff --git a/README.md b/README.md index e881b38..482ae12 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,9 @@ sense_voice_full_with_state: decoder audio use 1.011289 s, rtf is 0.182323. ``` ### 流式语音识别识别 + ```bash +sudo apt install libsdl2-dev ./bin/sense-voice-stream -m /path/gguf-fp16-sense-voice-small.bin ``` From a04cff252b340c9078306c40f48e36bacb67b345 Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 12:10:18 +0800 Subject: [PATCH 04/14] disable GGML_NATIVE build with gcc --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6041caf..2d79093 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,7 +31,7 @@ jobs: git config --global --add safe.directory /workspace git config --global --add safe.directory /workspace/sense-voice/csrc/third-party/ggml git submodule sync && git submodule update --init --recursive - cmake . + cmake -DGGML_NATIVE=OFF . make' macOS-latest: @@ -80,7 +80,7 @@ jobs: git config --global --add safe.directory /workspace git config --global --add safe.directory /workspace/sense-voice/csrc/third-party/ggml git submodule sync && git submodule update --init --recursive - cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} + cmake . -DGGML_NATIVE=OFF -DCMAKE_BUILD_TYPE=${{ matrix.build }} make ctest -L gh --output-on-failure' From ba054f6f4020ad3cb26052a91d5d79655118142d Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 13:05:03 +0800 Subject: [PATCH 05/14] disable GGML_NATIVE in msys2 --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2d79093..b1d0d4f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -294,7 +294,7 @@ jobs: shell: msys2 {0} run: | git submodule sync && git submodule update --init --recursive - cmake -B build -DGGML_OPENBLAS=ON + cmake -B build -DGGML_OPENBLAS=ON -DGGML_NATIVE=OFF cmake --build build --config ${{ matrix.build }} -j $(nproc) windows: @@ -486,8 +486,8 @@ jobs: - name: Build run: | - export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} git submodule sync && git submodule update --init --recursive + export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} cmake -S . -B build \ -DCMAKE_BUILD_TYPE=${{ matrix.build }} \ -DGGML_CANN=on \ From 9a51821b1e028d1d813f419bd62a493d2c236b74 Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 13:27:42 +0800 Subject: [PATCH 06/14] add git sync in cann --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b1d0d4f..fab3e34 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -486,7 +486,7 @@ jobs: - name: Build run: | - git submodule sync && git submodule update --init --recursive + cd /__w/SenseVoice.cpp/SenseVoice.cpp/sense-voice && git submodule sync && git submodule update --init --recursive export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} cmake -S . -B build \ -DCMAKE_BUILD_TYPE=${{ matrix.build }} \ From 98bdb9ecca9fdb29c20c28cc51fa61c1e22cd812 Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 13:37:30 +0800 Subject: [PATCH 07/14] modify workdir --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fab3e34..7555a0d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -486,7 +486,7 @@ jobs: - name: Build run: | - cd /__w/SenseVoice.cpp/SenseVoice.cpp/sense-voice && git submodule sync && git submodule update --init --recursive + cd /__w/SenseVoice.cpp/SenseVoice.cpp && git submodule sync && git submodule update --init --recursive export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} cmake -S . -B build \ -DCMAKE_BUILD_TYPE=${{ matrix.build }} \ From f9cf4c35baaaa38e54bcf54c4cc9f8c712a05f56 Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 14:16:59 +0800 Subject: [PATCH 08/14] update cann action --- .github/workflows/build.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7555a0d..48aebc2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -478,7 +478,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + with: + submodules: true + fetch-depth: 0 - name: Dependencies run: | yum update -y @@ -486,7 +488,9 @@ jobs: - name: Build run: | - cd /__w/SenseVoice.cpp/SenseVoice.cpp && git submodule sync && git submodule update --init --recursive + cd $GITHUB_WORKSPACE + git submodule sync + git submodule update --init --recursive export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} cmake -S . -B build \ -DCMAKE_BUILD_TYPE=${{ matrix.build }} \ From 370640ecee772da003f8ff6a651ecd22edc8316a Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 14:19:56 +0800 Subject: [PATCH 09/14] sync Submodules in cann action --- .github/workflows/build.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 48aebc2..09ccfea 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -478,9 +478,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 + - name: Dependencies run: | yum update -y From 4ade64f877714e2701035d1000f1398500fc32bb Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 15:48:55 +0800 Subject: [PATCH 10/14] add debug action --- .github/workflows/build.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 09ccfea..52a7491 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -484,9 +484,26 @@ jobs: yum update -y yum install -y git gcc gcc-c++ make cmake + - name: Start SSH via ngrok + uses: P3TERX/ssh2actions@main + with: + mode: ngrok + env: + # After sign up on the https://ngrok.com + # You can find this token here: https://dashboard.ngrok.com/auth/your-authtoken + NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }} + + # ngrok server region [us, eu, au, ap, sa, jp, in] (optional, default: us) + # You can find this server region here: https://ngrok.com/docs#global-locations + NGROK_REGION: us + + # This password you will use when authorizing via SSH + SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} + + - name: Build run: | - cd $GITHUB_WORKSPACE + cd $GITHUB_WORKSPACE && ls -al git submodule sync git submodule update --init --recursive export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} From d349a59830d09f09d5ff9c8e4e011e696755fa6f Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 15:57:55 +0800 Subject: [PATCH 11/14] add unzip in debug action --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 52a7491..6bb74cc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -482,7 +482,7 @@ jobs: - name: Dependencies run: | yum update -y - yum install -y git gcc gcc-c++ make cmake + yum install -y git gcc gcc-c++ make cmake unzip sudo - name: Start SSH via ngrok uses: P3TERX/ssh2actions@main From 2bcff13c11e061eac6a14a19cf25c91086888f25 Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 16:04:59 +0800 Subject: [PATCH 12/14] add screen and passwd in cann debug action --- .github/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6bb74cc..1374db6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -482,7 +482,9 @@ jobs: - name: Dependencies run: | yum update -y - yum install -y git gcc gcc-c++ make cmake unzip sudo + yum -y install epel-release + yum update -y + yum install -y git gcc gcc-c++ make cmake unzip sudo passwd screen - name: Start SSH via ngrok uses: P3TERX/ssh2actions@main From 055883f4f6fc3665ee1de8a172e84cf7233cba10 Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 16:08:32 +0800 Subject: [PATCH 13/14] remove epel-release in cann debug action --- .github/workflows/build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1374db6..6ebcf20 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -481,8 +481,6 @@ jobs: - name: Dependencies run: | - yum update -y - yum -y install epel-release yum update -y yum install -y git gcc gcc-c++ make cmake unzip sudo passwd screen From 64e38aace467840c859248ddb0c25f80b1dd1adf Mon Sep 17 00:00:00 2001 From: lovemefan Date: Thu, 6 Feb 2025 17:28:27 +0800 Subject: [PATCH 14/14] add action debug --- .github/workflows/build-debug.yaml | 37 ++++++++++++++++++++++++++++++ .github/workflows/build.yaml | 19 +-------------- 2 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/build-debug.yaml diff --git a/.github/workflows/build-debug.yaml b/.github/workflows/build-debug.yaml new file mode 100644 index 0000000..bcacfb7 --- /dev/null +++ b/.github/workflows/build-debug.yaml @@ -0,0 +1,37 @@ +name: CI-debug +on: + workflow_dispatch: + inputs: + debug_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false + +jobs: + openEuler-latest-cmake-cann: + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + defaults: + run: + shell: bash -el {0} + runs-on: ubuntu-24.04-arm + strategy: + matrix: + cann: + - '8.0.rc3.beta1-910b-openeuler22.03-py3.10' + device: + - 'ascend910b3' + build: + - 'Release' + container: ascendai/cann:${{ matrix.cann }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Dependencies + run: | + yum update -y + yum install -y git gcc gcc-c++ make cmake + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6ebcf20..6d81123 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -482,24 +482,7 @@ jobs: - name: Dependencies run: | yum update -y - yum install -y git gcc gcc-c++ make cmake unzip sudo passwd screen - - - name: Start SSH via ngrok - uses: P3TERX/ssh2actions@main - with: - mode: ngrok - env: - # After sign up on the https://ngrok.com - # You can find this token here: https://dashboard.ngrok.com/auth/your-authtoken - NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }} - - # ngrok server region [us, eu, au, ap, sa, jp, in] (optional, default: us) - # You can find this server region here: https://ngrok.com/docs#global-locations - NGROK_REGION: us - - # This password you will use when authorizing via SSH - SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} - + yum install -y git gcc gcc-c++ make cmake - name: Build run: |