From b33c212bccd95e4b26754c4c23faeb392590a10e Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:34:44 +0300 Subject: [PATCH 01/25] Create .GitHub/actions/build.yml --- .GitHub/actions/build.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .GitHub/actions/build.yml diff --git a/.GitHub/actions/build.yml b/.GitHub/actions/build.yml new file mode 100644 index 00000000..32f95c0d --- /dev/null +++ b/.GitHub/actions/build.yml @@ -0,0 +1 @@ +hi \ No newline at end of file From 6daac82e3d876cbb25b8f635ccdb003df1d3d3c8 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:37:18 +0300 Subject: [PATCH 02/25] Create .github/actions/build.yaml --- .github/actions/build.yaml | 114 +++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/actions/build.yaml diff --git a/.github/actions/build.yaml b/.github/actions/build.yaml new file mode 100644 index 00000000..814d076a --- /dev/null +++ b/.github/actions/build.yaml @@ -0,0 +1,114 @@ +name: Build C++ for Android ARM64 + +on: + push: + branches: [ main, master, develop ] # Adjust to your main branches + pull_request: + branches: [ main, master, develop ] # Adjust to your main branches + workflow_dispatch: # Allows manual triggering from the Actions tab + +env: + # Define NDK version to use. Check for the latest recommended LTS or stable version. + # As of late 2024/early 2025, r26c (26.2.x or 26.3.x) is a good choice. + NDK_VERSION: "26.3.11579264" + # Minimum Android API level for your application. + # API level 21 (Android 5.0) is the first to support 64-bit (arm64-v8a). + ANDROID_API_LEVEL: "21" + # Build type + BUILD_TYPE: "Release" + +jobs: + build_android_arm64: + name: Build for Android arm64-v8a + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'recursive' # Important if your project uses submodules + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' # Or 'adopt', 'zulu', etc. + java-version: '17' # NDK r25+ generally works well with JDK 17 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' # Or your desired Python version + + - name: Install CMake and Ninja (for faster builds) + run: | + sudo apt-get update -qq + sudo apt-get install -y --no-install-recommends cmake ninja-build + shell: bash + + - name: Download and Set up Android NDK + run: | + # Ensure NDK_VERSION is set from env + echo "Using NDK Version: ${{ env.NDK_VERSION }}" + # Download NDK + wget -q https://dl.google.com/android/repository/android-ndk-r${{ env.NDK_VERSION }}-linux.zip -O android-ndk.zip + # Extract NDK + unzip -q android-ndk.zip -d $HOME + # Set ANDROID_NDK_HOME environment variable for subsequent steps + echo "ANDROID_NDK_HOME=$HOME/android-ndk-r${{ env.NDK_VERSION }}" >> $GITHUB_ENV + # Optionally, add NDK tools to PATH (CMake toolchain file often handles this) + # echo "$HOME/android-ndk-r${{ env.NDK_VERSION }}" >> $GITHUB_PATH + shell: bash + + - name: Verify NDK Setup + run: | + echo "ANDROID_NDK_HOME is set to: $ANDROID_NDK_HOME" + ls -la $ANDROID_NDK_HOME + # A simple check to see if a common NDK tool is executable + $ANDROID_NDK_HOME/ndk-stack --version + shell: bash + + # --- CMake Project Specific Steps --- + # Adjust these steps if you are not using CMake + + - name: Configure CMake + # This step assumes your CMakeLists.txt is in the root of your repository. + # The -B flag creates a 'build' directory for out-of-source builds. + # The -S flag specifies the source directory. + run: | + cmake -S . -B build \ + -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \ + -DANDROID_ABI=arm64-v8a \ + -DANDROID_NDK=$ANDROID_NDK_HOME \ + -DANDROID_PLATFORM=android-${{ env.ANDROID_API_LEVEL }} \ + -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ + -DCMAKE_ANDROID_STL=c++_shared \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DCMAKE_MAKE_PROGRAM=ninja \ + -G Ninja + # Add any of your project-specific CMake defines here, e.g., -DMY_CUSTOM_OPTION=ON + shell: bash + + - name: Build with CMake + run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel $(nproc) + shell: bash + + - name: List build artifacts (example) + # This is just to show what's in the build directory. + # You'll need to adjust the path for `upload-artifact` based on your project's output. + run: | + echo "Listing contents of build directory:" + ls -R build/ + echo "Listing shared libraries specifically (if any):" + find build/ -name "*.so" -print + shell: bash + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: android-arm64-v8a-build-${{ github.sha }} + path: | # Adjust these paths to match your actual output files + build/**/*.so # Example: shared libraries + build/**/*.a # Example: static libraries + # build/your_executable_name # Example: if you build an executable + if-no-files-found: error # Optional: 'warn' or 'ignore' if files might not exist + From 5e233aeb4ee2e41d8998d5a473f650d0635f00df Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:38:02 +0300 Subject: [PATCH 03/25] Create c-cpp.yml --- .github/workflows/c-cpp.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/c-cpp.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 00000000..6a9c312e --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,23 @@ +name: C/C++ CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: configure + run: ./configure + - name: make + run: make + - name: make check + run: make check + - name: make distcheck + run: make distcheck From 2e46d24ff48eb96210bbbc007446600c28001bd8 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:38:16 +0300 Subject: [PATCH 04/25] Delete .github/actions directory --- .github/actions/build.yaml | 114 ------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 .github/actions/build.yaml diff --git a/.github/actions/build.yaml b/.github/actions/build.yaml deleted file mode 100644 index 814d076a..00000000 --- a/.github/actions/build.yaml +++ /dev/null @@ -1,114 +0,0 @@ -name: Build C++ for Android ARM64 - -on: - push: - branches: [ main, master, develop ] # Adjust to your main branches - pull_request: - branches: [ main, master, develop ] # Adjust to your main branches - workflow_dispatch: # Allows manual triggering from the Actions tab - -env: - # Define NDK version to use. Check for the latest recommended LTS or stable version. - # As of late 2024/early 2025, r26c (26.2.x or 26.3.x) is a good choice. - NDK_VERSION: "26.3.11579264" - # Minimum Android API level for your application. - # API level 21 (Android 5.0) is the first to support 64-bit (arm64-v8a). - ANDROID_API_LEVEL: "21" - # Build type - BUILD_TYPE: "Release" - -jobs: - build_android_arm64: - name: Build for Android arm64-v8a - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: 'recursive' # Important if your project uses submodules - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' # Or 'adopt', 'zulu', etc. - java-version: '17' # NDK r25+ generally works well with JDK 17 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' # Or your desired Python version - - - name: Install CMake and Ninja (for faster builds) - run: | - sudo apt-get update -qq - sudo apt-get install -y --no-install-recommends cmake ninja-build - shell: bash - - - name: Download and Set up Android NDK - run: | - # Ensure NDK_VERSION is set from env - echo "Using NDK Version: ${{ env.NDK_VERSION }}" - # Download NDK - wget -q https://dl.google.com/android/repository/android-ndk-r${{ env.NDK_VERSION }}-linux.zip -O android-ndk.zip - # Extract NDK - unzip -q android-ndk.zip -d $HOME - # Set ANDROID_NDK_HOME environment variable for subsequent steps - echo "ANDROID_NDK_HOME=$HOME/android-ndk-r${{ env.NDK_VERSION }}" >> $GITHUB_ENV - # Optionally, add NDK tools to PATH (CMake toolchain file often handles this) - # echo "$HOME/android-ndk-r${{ env.NDK_VERSION }}" >> $GITHUB_PATH - shell: bash - - - name: Verify NDK Setup - run: | - echo "ANDROID_NDK_HOME is set to: $ANDROID_NDK_HOME" - ls -la $ANDROID_NDK_HOME - # A simple check to see if a common NDK tool is executable - $ANDROID_NDK_HOME/ndk-stack --version - shell: bash - - # --- CMake Project Specific Steps --- - # Adjust these steps if you are not using CMake - - - name: Configure CMake - # This step assumes your CMakeLists.txt is in the root of your repository. - # The -B flag creates a 'build' directory for out-of-source builds. - # The -S flag specifies the source directory. - run: | - cmake -S . -B build \ - -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \ - -DANDROID_ABI=arm64-v8a \ - -DANDROID_NDK=$ANDROID_NDK_HOME \ - -DANDROID_PLATFORM=android-${{ env.ANDROID_API_LEVEL }} \ - -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ - -DCMAKE_ANDROID_STL=c++_shared \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DCMAKE_MAKE_PROGRAM=ninja \ - -G Ninja - # Add any of your project-specific CMake defines here, e.g., -DMY_CUSTOM_OPTION=ON - shell: bash - - - name: Build with CMake - run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel $(nproc) - shell: bash - - - name: List build artifacts (example) - # This is just to show what's in the build directory. - # You'll need to adjust the path for `upload-artifact` based on your project's output. - run: | - echo "Listing contents of build directory:" - ls -R build/ - echo "Listing shared libraries specifically (if any):" - find build/ -name "*.so" -print - shell: bash - - - name: Upload Build Artifacts - uses: actions/upload-artifact@v4 - with: - name: android-arm64-v8a-build-${{ github.sha }} - path: | # Adjust these paths to match your actual output files - build/**/*.so # Example: shared libraries - build/**/*.a # Example: static libraries - # build/your_executable_name # Example: if you build an executable - if-no-files-found: error # Optional: 'warn' or 'ignore' if files might not exist - From 1a7d9cfd8305ce54dea16b6cd52635a650f879b5 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:38:31 +0300 Subject: [PATCH 05/25] Delete .GitHub/actions directory --- .GitHub/actions/build.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .GitHub/actions/build.yml diff --git a/.GitHub/actions/build.yml b/.GitHub/actions/build.yml deleted file mode 100644 index 32f95c0d..00000000 --- a/.GitHub/actions/build.yml +++ /dev/null @@ -1 +0,0 @@ -hi \ No newline at end of file From ed4682fa05a4fc5e59da070723b3438f7a2e8aaf Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:42:51 +0300 Subject: [PATCH 06/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 6a9c312e..fd4c8445 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -13,11 +13,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: configure - run: ./configure - - name: make + - name: Set up Clang + uses: egor-tensin/setup-clang@v1 + with: + version: latest + platform: x64 + - name: build run: make - - name: make check - run: make check - - name: make distcheck - run: make distcheck From 11060e5243397ae1a70d5cad208059623ed542c8 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:47:54 +0300 Subject: [PATCH 07/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 38 ++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index fd4c8445..38a039f6 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -8,15 +8,31 @@ on: jobs: build: - - runs-on: ubuntu-latest - + name: Ex15 (os=${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-24.04-arm"] steps: - - uses: actions/checkout@v4 - - name: Set up Clang - uses: egor-tensin/setup-clang@v1 - with: - version: latest - platform: x64 - - name: build - run: make + - uses: actions/checkout@v4 + - uses: ./ + id: setup-miniconda + continue-on-error: true + with: + miniforge-version: latest + - name: Check ARM + shell: bash -el {0} + run: | + conda install -y python + python -c "import platform; assert platform.machine() == 'aarch64', platform.machine()" + + - name: build + run: | + # (Recommended) Create a new conda environment + conda create -n bitnet-cpp python=3.9 + conda activate bitnet-cpp + pip install -r requirements.txt + # Manually download the model and run with local path + huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T + python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s From 84b3593a1afdf2ee52c69c6bbc6e16c682907cfe Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:49:33 +0300 Subject: [PATCH 08/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 38a039f6..63c38964 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -22,13 +22,10 @@ jobs: with: miniforge-version: latest - name: Check ARM - shell: bash -el {0} + shell: bash run: | conda install -y python python -c "import platform; assert platform.machine() == 'aarch64', platform.machine()" - - - name: build - run: | # (Recommended) Create a new conda environment conda create -n bitnet-cpp python=3.9 conda activate bitnet-cpp From 0797990a955ec98efa305956467e14c267bd5db3 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:51:42 +0300 Subject: [PATCH 09/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 63c38964..c0411c1d 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -16,11 +16,16 @@ jobs: os: ["ubuntu-24.04-arm"] steps: - uses: actions/checkout@v4 - - uses: ./ - id: setup-miniconda - continue-on-error: true + - uses: conda-incubator/setup-miniconda@v3 with: - miniforge-version: latest + auto-update-conda: true + python-version: ${{ matrix.python-version }} + - name: Conda info + shell: bash + run: conda info + - name: Conda list + shell: pwsh + run: conda list - name: Check ARM shell: bash run: | From c2f43c2ee3e412811105f3572c2b31b113eaabe3 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:52:28 +0300 Subject: [PATCH 10/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index c0411c1d..04612130 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -19,7 +19,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: ${{ matrix.python-version }} + python-version: 3.11 - name: Conda info shell: bash run: conda info From d2d978ce6380362cfb7aa2fdcf1e2effea102501 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 15:53:30 +0300 Subject: [PATCH 11/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 04612130..8ca1c4ec 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -13,13 +13,13 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-24.04-arm"] + os: ["ubuntu-24.04-arm", "ubuntu-latest","windows-latest"] steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: 3.11 + python-version: 3.9 - name: Conda info shell: bash run: conda info From 2ecdba7459925dc96556fc140926b4df62068462 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:02:09 +0300 Subject: [PATCH 12/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 8ca1c4ec..585d298d 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -33,6 +33,7 @@ jobs: python -c "import platform; assert platform.machine() == 'aarch64', platform.machine()" # (Recommended) Create a new conda environment conda create -n bitnet-cpp python=3.9 + conda init conda activate bitnet-cpp pip install -r requirements.txt # Manually download the model and run with local path From e8b1e4936e337742349312f698f3c4386990fb9b Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:06:36 +0300 Subject: [PATCH 13/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 585d298d..bba24fc3 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -26,11 +26,9 @@ jobs: - name: Conda list shell: pwsh run: conda list - - name: Check ARM + - name: install all shell: bash run: | - conda install -y python - python -c "import platform; assert platform.machine() == 'aarch64', platform.machine()" # (Recommended) Create a new conda environment conda create -n bitnet-cpp python=3.9 conda init From d33cfbcdacbaa861b379d0112b4260f8c45eca9b Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:08:09 +0300 Subject: [PATCH 14/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index bba24fc3..5f912c76 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -20,18 +20,12 @@ jobs: with: auto-update-conda: true python-version: 3.9 - - name: Conda info - shell: bash - run: conda info - - name: Conda list - shell: pwsh - run: conda list - name: install all shell: bash run: | + conda deactivate # (Recommended) Create a new conda environment conda create -n bitnet-cpp python=3.9 - conda init conda activate bitnet-cpp pip install -r requirements.txt # Manually download the model and run with local path From b40a11f31f191495ae21af3dc3e0cdf20b9bc007 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:09:14 +0300 Subject: [PATCH 15/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 5f912c76..5cc196ef 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -23,6 +23,7 @@ jobs: - name: install all shell: bash run: | + conda init conda deactivate # (Recommended) Create a new conda environment conda create -n bitnet-cpp python=3.9 From 20492d0a0861126f288058f713d3b917622e5da3 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:12:47 +0300 Subject: [PATCH 16/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 5cc196ef..0a0d13a6 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -21,7 +21,7 @@ jobs: auto-update-conda: true python-version: 3.9 - name: install all - shell: bash + shell: bash -el {0} run: | conda init conda deactivate From c0b99bca318ec9af206458b677d0925379d15db1 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:17:36 +0300 Subject: [PATCH 17/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 0a0d13a6..a3fe6fc9 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -23,12 +23,8 @@ jobs: - name: install all shell: bash -el {0} run: | - conda init - conda deactivate - # (Recommended) Create a new conda environment conda create -n bitnet-cpp python=3.9 conda activate bitnet-cpp pip install -r requirements.txt - # Manually download the model and run with local path huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s From 2aede2a7883b0867ea818749063795f0b1915978 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:19:33 +0300 Subject: [PATCH 18/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index a3fe6fc9..87ab2876 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -16,6 +16,10 @@ jobs: os: ["ubuntu-24.04-arm", "ubuntu-latest","windows-latest"] steps: - uses: actions/checkout@v4 + - run: | + cd .. + git clone --recursive https://github.com/microsoft/BitNet.git + cd BitNet - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true From 211e6a49edd7ca5679712494140ba55b8663ea50 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:22:09 +0300 Subject: [PATCH 19/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 87ab2876..144ee4a6 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -15,9 +15,7 @@ jobs: matrix: os: ["ubuntu-24.04-arm", "ubuntu-latest","windows-latest"] steps: - - uses: actions/checkout@v4 - run: | - cd .. git clone --recursive https://github.com/microsoft/BitNet.git cd BitNet - uses: conda-incubator/setup-miniconda@v3 From ed8168db6d48fcf01e2923d57c3a2d0b6c335ead Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:33:36 +0300 Subject: [PATCH 20/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 144ee4a6..0ba43b80 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -15,9 +15,9 @@ jobs: matrix: os: ["ubuntu-24.04-arm", "ubuntu-latest","windows-latest"] steps: - - run: | - git clone --recursive https://github.com/microsoft/BitNet.git - cd BitNet + - uses: actions/checkout@v4 + with: + submodules: recursive - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true From 9ba0b99fb7c5d88a7295d22f315360e13b31b3aa Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:40:16 +0300 Subject: [PATCH 21/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 0ba43b80..1615ebcf 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-24.04-arm", "ubuntu-latest","windows-latest"] + os: ["ubuntu-24.04-arm", "ubuntu-latest","windows-latest", "macos-latest"] steps: - uses: actions/checkout@v4 with: From 5eeea3052205587cad15bb68b80a4d26c3b2b440 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:42:49 +0300 Subject: [PATCH 22/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 1615ebcf..d7a4d1c5 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -30,3 +30,5 @@ jobs: pip install -r requirements.txt huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s + - name: test + run: python run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p "you are a science educator. what is the sun?" From 090b8ccbcc7d0f853eb78f3482baf9b352ee9d46 Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 16:45:19 +0300 Subject: [PATCH 23/25] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index d7a4d1c5..7f5314ba 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-24.04-arm", "ubuntu-latest","windows-latest", "macos-latest"] + os: ["ubuntu-24.04-arm", "ubuntu-latest","macos-latest"] steps: - uses: actions/checkout@v4 with: From dd31f60ce346d1f562cfb86a9f3308f03417dd9b Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 17:02:13 +0300 Subject: [PATCH 24/25] Update and rename c-cpp.yml to test-installation-instructions.yml --- ...cpp.yml => test-installation-instructions.yml} | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) rename .github/workflows/{c-cpp.yml => test-installation-instructions.yml} (77%) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/test-installation-instructions.yml similarity index 77% rename from .github/workflows/c-cpp.yml rename to .github/workflows/test-installation-instructions.yml index 7f5314ba..086903f1 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/test-installation-instructions.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: Test installation instructions on: push: @@ -7,8 +7,8 @@ on: branches: [ "main" ] jobs: - build: - name: Ex15 (os=${{ matrix.os }}) + install: + name: install on (os=${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -22,13 +22,16 @@ jobs: with: auto-update-conda: true python-version: 3.9 - - name: install all + - name: conda setup shell: bash -el {0} run: | conda create -n bitnet-cpp python=3.9 conda activate bitnet-cpp + - name: setup env + run: | pip install -r requirements.txt huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s - - name: test - run: python run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p "you are a science educator. what is the sun?" + + - name: run + run: python run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p "you are a helpful assistant. what is the sun?" From 90f46f6cfd13e46e5ce9b2eb70ef4d12aafcf8ff Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Tue, 13 May 2025 17:06:53 +0300 Subject: [PATCH 25/25] Update test-installation-instructions.yml --- .github/workflows/test-installation-instructions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-installation-instructions.yml b/.github/workflows/test-installation-instructions.yml index 086903f1..2f91f34b 100644 --- a/.github/workflows/test-installation-instructions.yml +++ b/.github/workflows/test-installation-instructions.yml @@ -28,10 +28,12 @@ jobs: conda create -n bitnet-cpp python=3.9 conda activate bitnet-cpp - name: setup env + shell: bash -el {0} run: | pip install -r requirements.txt huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s - name: run + shell: bash -el {0} run: python run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p "you are a helpful assistant. what is the sun?"