chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
name: android
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- 'project/android/**'
|
||||
- '.github/workflows/android.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- 'project/android/**'
|
||||
- '.github/workflows/android.yml'
|
||||
|
||||
concurrency:
|
||||
group: android-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
android_build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: build_android_64
|
||||
run: |
|
||||
cd project/android
|
||||
mkdir build_64
|
||||
cd build_64
|
||||
../build_64.sh -DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true -DLLM_SUPPORT_VISION=true -DMNN_BUILD_OPENCV=true -DMNN_IMGCODECS=true -DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true -DMNN_SUPPORT_BF16=ON
|
||||
- name: build_android_32
|
||||
run: |
|
||||
cd project/android
|
||||
mkdir build_32
|
||||
cd build_32
|
||||
../build_32.sh -DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true -DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true -DLLM_SUPPORT_VISION=true -DMNN_BUILD_OPENCV=true -DMNN_IMGCODECS=true
|
||||
@@ -0,0 +1,63 @@
|
||||
name: Code Format
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check-commit-msg:
|
||||
name: Check Commit Message Format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Validate commit messages
|
||||
run: |
|
||||
errors=0
|
||||
for sha in $(git log --format=%H origin/master..HEAD); do
|
||||
msg=$(git log -1 --format=%s "$sha")
|
||||
# Allow merge commits
|
||||
if echo "$msg" | grep -qE "^Merge "; then
|
||||
continue
|
||||
fi
|
||||
if ! echo "$msg" | grep -qE '^\[[A-Za-z0-9]+:(Feature|Bugfix|Perf|Refact|Style|Doc|Test|Chore)\] .+'; then
|
||||
echo "BAD: $sha $msg"
|
||||
errors=1
|
||||
fi
|
||||
done
|
||||
if [ "$errors" -eq 1 ]; then
|
||||
echo ""
|
||||
echo "Commit message must match: [Module:Type] Description"
|
||||
echo " Module: LLM, CPU, Metal, CUDA, OpenCL, Vulkan, Core, Infra, Doc, etc."
|
||||
echo " Type: Feature, Bugfix, Perf, Refact, Style, Doc, Test, Chore"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check-format:
|
||||
name: Check Changed Lines Format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install clang-format-17
|
||||
run: |
|
||||
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-format-17
|
||||
sudo ln -sf /usr/bin/clang-format-17 /usr/bin/clang-format
|
||||
sudo ln -sf /usr/bin/git-clang-format-17 /usr/bin/git-clang-format
|
||||
- name: Check format of changed lines
|
||||
run: |
|
||||
git clang-format --diff origin/master --extensions cpp,c,h,hpp,cc,m,mm > /tmp/format.diff 2>&1 || true
|
||||
if grep -q "^diff" /tmp/format.diff; then
|
||||
echo "Format issues in changed lines:"
|
||||
cat /tmp/format.diff
|
||||
exit 1
|
||||
fi
|
||||
echo "All changed lines are properly formatted."
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Validate Fastlane metadata
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
paths:
|
||||
- 'apps/Android/MnnLlmChat/app/fastlane/**'
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
paths:
|
||||
- 'apps/Android/MnnLlmChat/app/fastlane/**'
|
||||
|
||||
jobs:
|
||||
go:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Validate Fastlane Supply Metadata
|
||||
uses: ashutoshgngwr/validate-fastlane-supply-metadata@v2
|
||||
with:
|
||||
fastlaneDir: apps/Android/MnnLlmChat/app/fastlane/metadata/android
|
||||
@@ -0,0 +1,88 @@
|
||||
name: internal_pymnn_release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
name: ${{ matrix.arch }} ${{ matrix.build }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { os: ubuntu-latest, arch: x86_64, build: 'cp*-manylinux*' }
|
||||
- { os: ubuntu-24.04-arm, arch: aarch64, build: 'cp*-manylinux*' }
|
||||
- { os: windows-latest, arch: AMD64, build: 'cp*' }
|
||||
- { os: macos-13, arch: x86_64, build: 'cp*' }
|
||||
- { os: macos-14, arch: arm64, build: 'cp*' }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: using msvc
|
||||
if: matrix.os == 'windows-latest'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: using private schema patch
|
||||
if: matrix.os != 'windows-latest'
|
||||
env:
|
||||
PATCH_CONTENT: ${{ secrets.PRIVATE_SCHEMA_PATCH }}
|
||||
run: |
|
||||
patch_file=$(mktemp schema_patch.XXXXXX.diff)
|
||||
echo "$PATCH_CONTENT" > $patch_file
|
||||
git apply $patch_file
|
||||
rm $patch_file
|
||||
git status
|
||||
cd schema
|
||||
ls -lh
|
||||
./generate.sh
|
||||
cd ..
|
||||
git status
|
||||
- name: using private schema patch
|
||||
if: matrix.os == 'windows-latest'
|
||||
env:
|
||||
PATCH_CONTENT: ${{ secrets.PRIVATE_SCHEMA_PATCH }}
|
||||
run: |
|
||||
$patchFile = [System.IO.Path]::GetTempFileName() + ".diff"
|
||||
[System.IO.File]::WriteAllText($patchFile, $env:PATCH_CONTENT)
|
||||
git apply $patchFile
|
||||
Remove-Item $patchFile
|
||||
git status
|
||||
Push-Location schema
|
||||
Get-ChildItem -Name
|
||||
./generate.ps1
|
||||
Set-Location ..
|
||||
git status
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: install pipx
|
||||
if: matrix.os == 'macos-14'
|
||||
run: python -m pip install pipx
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.16.5
|
||||
env:
|
||||
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
|
||||
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
|
||||
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
|
||||
CIBW_BUILD: ${{ matrix.build }}
|
||||
CIBW_BUILD_VERBOSITY: 1
|
||||
CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=2
|
||||
with:
|
||||
package-dir: pymnn/pip_package
|
||||
output-dir: wheelhouse
|
||||
config-file: "{package}/pyproject.toml"
|
||||
|
||||
- name: Show files
|
||||
run: ls -lh wheelhouse
|
||||
shell: bash
|
||||
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifact-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: wheelhouse/*.whl
|
||||
@@ -0,0 +1,44 @@
|
||||
name: ios
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- 'project/ios/**'
|
||||
- '.github/workflows/ios.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- 'project/ios/**'
|
||||
- '.github/workflows/ios.yml'
|
||||
|
||||
concurrency:
|
||||
group: ios-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ios_build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: build-framework
|
||||
run: |
|
||||
brew install coreutils
|
||||
./package_scripts/ios/xcodebuildiOS.sh -o ios_build
|
||||
shell: bash
|
||||
|
||||
- name: show-framework
|
||||
run: |
|
||||
ls -lh ios_build
|
||||
@@ -0,0 +1,51 @@
|
||||
name: linux
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- '.github/workflows/linux.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- '.github/workflows/linux.yml'
|
||||
|
||||
concurrency:
|
||||
group: linux-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
linux_buil_test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: build
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake .. -DMNN_BUILD_TEST=ON -DLLM_SUPPORT_VISION=true -DMNN_BUILD_OPENCV=true -DMNN_IMGCODECS=true -DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true -DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true -DMNN_OPENCL=ON -DMNN_VULKAN=ON
|
||||
make -j4
|
||||
- name: test
|
||||
run: cd build && ./run_test.out
|
||||
|
||||
- name: build_non_sse
|
||||
run: |
|
||||
mkdir build_non_sse && cd build_non_sse
|
||||
cmake -DMNN_BUILD_TEST=ON -DMNN_USE_SSE=OFF ..
|
||||
make -j4
|
||||
- name: test_non_sse
|
||||
run: cd build_non_sse && ./run_test.out
|
||||
|
||||
- name: build_avx512
|
||||
run: |
|
||||
mkdir build_avx512 && cd build_avx512
|
||||
cmake -DMNN_BUILD_TEST=ON -DMNN_AVX512=ON -DMNN_AVX512_VNNI=ON ..
|
||||
make -j4
|
||||
@@ -0,0 +1,24 @@
|
||||
name: LLM Code Review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: LLM Code Review
|
||||
uses: wangzhaode/MNNCodeReviewer@v1.0.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
OPENAI_API_ENDPOINT: https://maas-api.ai-yuanjing.com/openapi/compatible-mode/v1
|
||||
MODEL: glm-5
|
||||
@@ -0,0 +1,37 @@
|
||||
name: macos
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- '.github/workflows/macos.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- '.github/workflows/macos.yml'
|
||||
|
||||
concurrency:
|
||||
group: macos-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
macos_buil_test:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: build
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake .. -DMNN_BUILD_TEST=ON -DLLM_SUPPORT_VISION=true -DMNN_BUILD_OPENCV=true -DMNN_IMGCODECS=true -DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true -DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true -DMNN_OPENCL=ON -DMNN_VULKAN=ON
|
||||
make -j4
|
||||
- name: test
|
||||
run: cd build && ./run_test.out
|
||||
@@ -0,0 +1,232 @@
|
||||
name: mnn_release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- '!Android*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
VERSION: ${{ steps.get_version.outputs.VERSION }}
|
||||
steps:
|
||||
- name: get-version
|
||||
id: get_version
|
||||
run: |
|
||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
||||
# 提取标签版本号
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
# 如果不是标签,则设置版本为 'dev'
|
||||
echo "VERSION=dev" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
linux-release:
|
||||
needs: [setup]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PACKAGENAME: mnn_${{ needs.setup.outputs.VERSION }}_linux_x64_cpu_opencl_vulkan
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: build
|
||||
run: |
|
||||
# j24 -> j4 avoid ld signal 9
|
||||
sed -i "s/-j24/-j4/g" package_scripts/linux/build_lib.sh
|
||||
# LLM (+ vision/audio) is already enabled in build_lib.sh by default.
|
||||
./package_scripts/linux/build_lib.sh -o ${{ env.PACKAGENAME }}/lib -b opencl,vulkan -s -c
|
||||
- name: package
|
||||
run: |
|
||||
rm -f ${{ env.PACKAGENAME }}.zip
|
||||
zip -9 -y -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
|
||||
- name: upload-zip
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifact-${{ env.PACKAGENAME }}
|
||||
path: ${{ env.PACKAGENAME }}.zip
|
||||
|
||||
windows-release:
|
||||
needs: [setup]
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
PACKAGENAME: mnn_${{ needs.setup.outputs.VERSION }}_windows_x64_cpu_opencl_vulkan_avx512
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: using msvc
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: build
|
||||
# LLM (+ vision/audio) + OpenCL + Vulkan + AVX512 are already enabled in
|
||||
# build_lib_release.ps1 by default.
|
||||
run: powershell .\package_scripts\win\build_lib_release.ps1 -path ${{ env.PACKAGENAME }}
|
||||
- name: package
|
||||
run: 7z a -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
|
||||
- name: upload-zip
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifact-${{ env.PACKAGENAME }}
|
||||
path: ${{ env.PACKAGENAME }}.zip
|
||||
|
||||
macos-release:
|
||||
needs: [setup]
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
PACKAGENAME: mnn_${{ needs.setup.outputs.VERSION }}_macos_x64_arm82_cpu_opencl_metal
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: build
|
||||
# Pass release-specific cmake args via `$*` (forwarded to cmake by buildFrameWork.sh).
|
||||
# - MNN_BUILD_LLM=ON implicitly enables MNN_LOW_MEMORY + MNN_SUPPORT_TRANSFORMER_FUSE
|
||||
# - MNN_BUILD_LLM_OMNI=ON implicitly enables MNN_BUILD_OPENCV / MNN_BUILD_AUDIO / MNN_IMGCODECS
|
||||
# which in turn auto-define LLM_SUPPORT_VISION / LLM_SUPPORT_AUDIO inside the llm engine.
|
||||
run: |
|
||||
./package_scripts/mac/buildFrameWork.sh \
|
||||
-DMNN_BUILD_LLM=ON \
|
||||
-DMNN_BUILD_LLM_OMNI=ON
|
||||
- name: package
|
||||
run: |
|
||||
rm -rf ${{ env.PACKAGENAME }}
|
||||
mv MNN-MacOS-CPU-GPU ${{ env.PACKAGENAME }}
|
||||
rm -f ${{ env.PACKAGENAME }}.zip
|
||||
zip -9 -y -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
|
||||
- name: upload-zip
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifact-${{ env.PACKAGENAME }}
|
||||
path: ${{ env.PACKAGENAME }}.zip
|
||||
|
||||
android-release:
|
||||
needs: [setup]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PACKAGENAME: mnn_${{ needs.setup.outputs.VERSION }}_android_armv7_armv8_cpu_opencl_vulkan
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: setup-ndk
|
||||
uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
with:
|
||||
# NDK r27+ is required for 16KB page-size support (Android 15+).
|
||||
# r27 dropped support for API < 21, so 32-bit armv7 must use API >= 21.
|
||||
ndk-version: r27c
|
||||
add-to-path: false
|
||||
- name: build
|
||||
# build.sh already enables LLM + OpenCV + Vulkan + OpenCL + multi-modal by default.
|
||||
# We inject the following extras via sed (script kept unchanged):
|
||||
# * -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON -- enables 16KB page size
|
||||
# (Google Play requirement starting Nov 2025)
|
||||
# * Bump 32-bit armv7 API level android-14 -> android-21 (NDK r27 minimum)
|
||||
env:
|
||||
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
run: |
|
||||
sed -i 's|^CMAKEARGS="\(.*\)"$|CMAKEARGS="\1 -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"|' \
|
||||
package_scripts/android/build.sh
|
||||
sed -i 's|android-14|android-21|g' package_scripts/android/build.sh
|
||||
./package_scripts/android/build.sh -o ${{ env.PACKAGENAME }}
|
||||
- name: package
|
||||
run: |
|
||||
rm -f ${{ env.PACKAGENAME }}.zip
|
||||
zip -9 -y -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
|
||||
- name: upload-zip
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifact-${{ env.PACKAGENAME }}
|
||||
path: ${{ env.PACKAGENAME }}.zip
|
||||
|
||||
harmony-release:
|
||||
needs: [setup]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PACKAGENAME: mnn_${{ needs.setup.outputs.VERSION }}_harmony_arm64_cpu
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: Setup OpenHarmony SDK
|
||||
id: setup-ohos
|
||||
uses: openharmony-rs/setup-ohos-sdk@v1.0.0
|
||||
with:
|
||||
# OpenHarmony 5.0.0 == API 12. Bump when a newer SDK is well tested.
|
||||
version: '5.0.0'
|
||||
- name: build
|
||||
# package_scripts/harmony/build.sh already enables LLM + multi-modal +
|
||||
# ARM82 + SME2 + BF16. It reads $OHOS_SDK_NATIVE (set below) to locate
|
||||
# the OHOS cmake toolchain file.
|
||||
env:
|
||||
OHOS_SDK_NATIVE: ${{ steps.setup-ohos.outputs.ohos_sdk_native }}
|
||||
run: ./package_scripts/harmony/build.sh -o ${{ env.PACKAGENAME }}
|
||||
- name: package
|
||||
run: |
|
||||
rm -f ${{ env.PACKAGENAME }}.zip
|
||||
zip -9 -y -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
|
||||
- name: upload-zip
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifact-${{ env.PACKAGENAME }}
|
||||
path: ${{ env.PACKAGENAME }}.zip
|
||||
|
||||
ios-release:
|
||||
needs: [setup]
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
PACKAGENAME: mnn_${{ needs.setup.outputs.VERSION }}_ios_armv82_cpu_metal
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: build
|
||||
# Pass release-specific cmake args via `$*` (forwarded to cmake by buildiOS.sh).
|
||||
# - MNN_BUILD_LLM=ON implicitly enables MNN_LOW_MEMORY + MNN_SUPPORT_TRANSFORMER_FUSE
|
||||
# - MNN_BUILD_LLM_OMNI=ON implicitly enables MNN_BUILD_OPENCV / MNN_BUILD_AUDIO / MNN_IMGCODECS
|
||||
# which in turn auto-define LLM_SUPPORT_VISION / LLM_SUPPORT_AUDIO inside the llm engine.
|
||||
run: |
|
||||
brew install coreutils
|
||||
./package_scripts/ios/buildiOS.sh \
|
||||
-DMNN_BUILD_LLM=ON \
|
||||
-DMNN_BUILD_LLM_OMNI=ON
|
||||
|
||||
- name: package
|
||||
run: |
|
||||
rm -f ${{ env.PACKAGENAME }}.zip
|
||||
zip -9 -y -r ${{ env.PACKAGENAME }}.zip MNN-iOS-CPU-GPU/Static/MNN.framework
|
||||
- name: upload-zip
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifact-${{ env.PACKAGENAME }}
|
||||
path: ${{ env.PACKAGENAME }}.zip
|
||||
|
||||
upload-release:
|
||||
name: upload_to_release
|
||||
needs: [linux-release, windows-release, macos-release, android-release, ios-release, harmony-release]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: artifact-*
|
||||
path: assert
|
||||
merge-multiple: true
|
||||
|
||||
- name: show file
|
||||
run: ls assert
|
||||
|
||||
- uses: xresloader/upload-to-github-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
file: assert/*.zip
|
||||
tags: true
|
||||
draft: true
|
||||
@@ -0,0 +1,38 @@
|
||||
name: pymnn-linux
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'pymnn/**'
|
||||
- '.github/workflows/pymnn_linux.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'pymnn/**'
|
||||
- '.github/workflows/pymnn_linux.yml'
|
||||
|
||||
concurrency:
|
||||
group: pymnn-linux-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
pymnn_linux_buil_test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: prepare
|
||||
run: |
|
||||
sudo pip3 install numpy opencv-python torch
|
||||
- name: build
|
||||
run: |
|
||||
cd pymnn/pip_package
|
||||
python3 build_deps.py llm
|
||||
sudo python3 setup.py install --version 1.0
|
||||
- name: test
|
||||
run: |
|
||||
cd pymnn/test
|
||||
python3 unit_test.py
|
||||
@@ -0,0 +1,41 @@
|
||||
name: pymnn-macos
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'pymnn/**'
|
||||
- '.github/workflows/pymnn_macos.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'pymnn/**'
|
||||
- '.github/workflows/pymnn_macos.yml'
|
||||
|
||||
concurrency:
|
||||
group: pymnn-macos-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
pymnn_macos_buil_test:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.8.10'
|
||||
- name: prepare
|
||||
run: |
|
||||
pip3 install numpy opencv-python torch
|
||||
- name: build
|
||||
run: |
|
||||
cd pymnn/pip_package
|
||||
python3 build_deps.py llm
|
||||
python3 setup.py install --version 1.0
|
||||
- name: test
|
||||
run: |
|
||||
cd pymnn/test
|
||||
python3 unit_test.py
|
||||
@@ -0,0 +1,91 @@
|
||||
name: pymnn_release
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/pymnn_release.yml'
|
||||
tags:
|
||||
- '*'
|
||||
- '!Android*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
name: ${{ matrix.arch }} ${{ matrix.build }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { os: ubuntu-latest, arch: x86_64, build: 'cp*-manylinux*' }
|
||||
- { os: ubuntu-24.04-arm, arch: aarch64, build: 'cp*-manylinux*' }
|
||||
- { os: windows-latest, arch: AMD64, build: 'cp*' }
|
||||
- { os: macos-14, arch: x86_64, build: 'cp*' }
|
||||
- { os: macos-14, arch: arm64, build: 'cp*' }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: using msvc
|
||||
if: matrix.os == 'windows-latest'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: install pipx
|
||||
if: matrix.os == 'macos-14'
|
||||
run: python -m pip install pipx
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.22.0
|
||||
env:
|
||||
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
|
||||
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
|
||||
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
|
||||
CIBW_BUILD: ${{ matrix.build }}
|
||||
CIBW_BUILD_VERBOSITY: 1
|
||||
CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=2
|
||||
with:
|
||||
package-dir: pymnn/pip_package
|
||||
output-dir: wheelhouse
|
||||
config-file: "{package}/pyproject.toml"
|
||||
|
||||
- name: Show files
|
||||
run: ls -lh wheelhouse
|
||||
shell: bash
|
||||
|
||||
- name: Verify clean directory
|
||||
run: git diff --exit-code
|
||||
shell: bash
|
||||
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifact-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: wheelhouse/*.whl
|
||||
|
||||
publish_wheels:
|
||||
permissions:
|
||||
contents: none
|
||||
id-token: write
|
||||
name: Upload
|
||||
needs: [build_wheels]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: artifact-*
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
|
||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
skip_existing: true
|
||||
@@ -0,0 +1,42 @@
|
||||
name: pymnn-windows
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'pymnn/**'
|
||||
- '.github/workflows/pymnn_windows.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'pymnn/**'
|
||||
- '.github/workflows/pymnn_windows.yml'
|
||||
|
||||
concurrency:
|
||||
group: pymnn-windows-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
pymnn_windows_buil_test:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
- name: prepare
|
||||
run: |
|
||||
pip3 install numpy==1.25 opencv-python torch
|
||||
- name: build
|
||||
run: |
|
||||
cd pymnn/pip_package
|
||||
python3 build_deps.py llm
|
||||
python3 setup.py install --version 1.0
|
||||
- name: test
|
||||
run: |
|
||||
cd pymnn/test
|
||||
python3 unit_test.py
|
||||
@@ -0,0 +1,26 @@
|
||||
name: stale
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 9 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 60
|
||||
stale-issue-message: 'Marking as stale. No activity in 60 days.'
|
||||
stale-pr-message: 'Marking as stale. No activity in 60 days.'
|
||||
stale-issue-label: 'stale'
|
||||
stale-pr-label: 'stale'
|
||||
remove-stale-when-updated: true
|
||||
operations-per-run: 1000
|
||||
days-before-close: 3
|
||||
@@ -0,0 +1,34 @@
|
||||
name: wiki
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- '.github/workflows/wiki.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- '.github/workflows/wiki.yml'
|
||||
|
||||
concurrency:
|
||||
group: wiki-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
sync_wiki:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: sync_wiki
|
||||
uses: kai-tub/external-repo-sync-action@v1
|
||||
with:
|
||||
source-directory: "./docs"
|
||||
env:
|
||||
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
|
||||
@@ -0,0 +1,36 @@
|
||||
name: windows
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/**'
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- 'transformers/llm/engine/**'
|
||||
- '.github/workflows/windows.yml'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'source/**'
|
||||
- 'express/**'
|
||||
- 'test/**'
|
||||
- '.github/workflows/windows.yml'
|
||||
|
||||
concurrency:
|
||||
group: windows-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
windows_build_test:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: test
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake .. -DMNN_BUILD_TEST=ON -DLLM_SUPPORT_VISION=true -DMNN_BUILD_OPENCV=true -DMNN_IMGCODECS=true -DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true -DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true -DMNN_VULKAN=ON -DMNN_OPENCL=ON
|
||||
cmake --build . -j4
|
||||
Reference in New Issue
Block a user