Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <thxcode0824@gmail.com>
  • Loading branch information
thxCode committed Jun 24, 2024
0 parents commit 5668744
Show file tree
Hide file tree
Showing 14 changed files with 5,811 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: ci

permissions:
contents: read
pull-requests: read
actions: read

env:
VERSION: "${{ github.ref_name }}"

on:
workflow_dispatch: { }
push:
tags:
- "v*.*.*"
branches:
- main
paths-ignore:
- "docs/**"
- "**.md"
- "**.mdx"
- "**.png"
- "**.jpg"
pull_request:
branches:
- main
paths-ignore:
- "docs/**"
- "**.md"
- "**.mdx"
- "**.png"
- "**.jpg"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
darwin:
strategy:
fail-fast: false
matrix:
# see https://github.com/actions/runner-images?tab=readme-ov-file#available-images.
os: [ macos-13, macos-14 ]
runs-on: ${{ matrix.os }}
steps:
- name: Setup XCode
if: ${{ matrix.os == 'macos-13' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
- name: Deps
continue-on-error: true
run: |
brew update
- name: Build
run: |
make -j LLAMA_METAL=1
echo "===== info ====="
file ./.dist/llama-box
- name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
path: ./.dist/llama-box
name: llama-box-darwin-${{ endsWith(matrix.os, '-13') && 'amd64' || 'arm64' }}

linux-hip:
strategy:
fail-fast: false
matrix:
arch: [ amd64 ]
version: [ '6.0.2' ]
runs-on: ubuntu-22.04
steps:
- name: Maximize Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v7.0.0
platforms: "arm64"
- name: Build
run: |
docker run \
--rm \
--privileged \
--platform linux/${{ matrix.arch }} \
--volume $(pwd):/workspace \
--workdir /workspace \
--env CC=/opt/rocm/llvm/bin/clang \
--env CXX=/opt/rocm/llvm/bin/clang++ \
rocm/dev-ubuntu-22.04:${{ matrix.version }}-complete \
make -j LLAMA_HIPBLAS=1
echo "===== info ====="
file ./.dist/llama-box
- name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
path: ./.dist/llama-box
name: llama-box-linux-${{ matrix.arch }}-hip
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Files
.DS_Store
*.o
*.a
*.so
*.gguf
*.bin
*.exe
*.exe~
*.dll
*.dylib
*.log
*.dot
*.bat
*.tmp
*.metallib
*.out
*.swp
*.swo
.clang-tidy
version.cpp

# Directories
.idea/
.vscode/
.vs/
.build/
.cache/
.ccls-cache/
.direnv/
.sbin/
.dist/
out/
tmp/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "llama.cpp"]
path = llama.cpp
url = https://github.com/ggerganov/llama.cpp
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 The llama-box authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 5668744

Please sign in to comment.