Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Structural Overhaul #162

Merged
merged 40 commits into from
Apr 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d84aa7f
Create a Model trait
danforbes Apr 15, 2023
e0713a1
Bloom model
danforbes Apr 15, 2023
6bfda75
cargo fmt
danforbes Apr 16, 2023
73f59c3
Rename llama-rs to llm-base
danforbes Apr 16, 2023
e670c25
Clippy
danforbes Apr 16, 2023
c4b4176
Remove redundant associated Model type from Model trait
danforbes Apr 16, 2023
1cf305f
Remove associated Layer type from Model trait
danforbes Apr 16, 2023
0d4dde9
cargo fmt
danforbes Apr 16, 2023
849c28d
Docs
danforbes Apr 16, 2023
54ad890
Tests and examples
danforbes Apr 16, 2023
4ba7c1c
Layers are private
danforbes Apr 16, 2023
dcf85ff
Merge branch 'main' of github.com:rustformers/llama-rs into dfo/model…
philpax Apr 22, 2023
43ecac1
Merge branch 'main' into dfo/model/bloom
philpax Apr 25, 2023
440bd69
Fix build
philpax Apr 25, 2023
5658484
refactor: introduce llm(-cli)
philpax Apr 25, 2023
bcf5627
Fix model name in LLaMA inference example
danforbes Apr 26, 2023
5ac4b79
feat: wire up both bloom/llama to CLI
philpax Apr 26, 2023
1601240
Merge branch 'dfo/model/bloom' of github.com:danforbes/llama-rs into …
philpax Apr 26, 2023
1761512
Add example for testing BLOOM inference
danforbes Apr 26, 2023
8d2d9c6
cargo fmt
danforbes Apr 26, 2023
813bdd1
Add launch.json for debugging loading and inference
danforbes Apr 26, 2023
c608b4b
Merge branch 'main' into dfo/model/bloom
danforbes Apr 27, 2023
e19418c
Check tensor dimensions when loading
danforbes Apr 27, 2023
e35f93b
`Model` -> `KnownModel`, `ErasedModel -> Model`
danforbes Apr 27, 2023
288df7f
Merge branch 'main' into dfo/model/bloom
danforbes Apr 29, 2023
0aea8f7
Refactor ggml stuff into a single crate
danforbes Apr 27, 2023
8594ac8
Use latest upstream ggml with alibi
danforbes Apr 28, 2023
a542c98
Improve examples
danforbes Apr 28, 2023
16fca15
Latest upstream ggml
danforbes Apr 28, 2023
974d2f7
Cleanup README
danforbes Apr 28, 2023
1abaa41
Rebase fix
danforbes Apr 29, 2023
f994fa8
GPT2/Cerebras loading and inference
danforbes Apr 26, 2023
ff99a80
Rebase & remove BLOOM
danforbes Apr 30, 2023
454f3a9
GitHub Action should support Git submodules
danforbes Apr 30, 2023
e69d487
Fix binary file name in README
danforbes Apr 30, 2023
608090b
ggml-rs -> ggml
danforbes Apr 30, 2023
78db42c
Add back BLOOM
danforbes Apr 30, 2023
1eb2e11
feat: re-enable BLOOM for now
philpax Apr 30, 2023
181d823
refactor: reintroduce ggml-sys and bindgen tool
philpax Apr 30, 2023
9314c68
fix: check out submodules for clippy CI
philpax Apr 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Rust

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
CARGO_TERM_COLOR: always
Expand All @@ -18,23 +18,27 @@ jobs:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Check
run: cargo check --verbose
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- name: Check
run: cargo check --verbose
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
fmt:
name: Clippy and formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy -- -Dclippy::all # -Dclippy::pedantic
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy -- -Dclippy::all # -Dclippy::pedantic
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
/models
.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ggml/ggml"]
path = ggml/sys/ggml
url = git@github.com:ggerganov/ggml.git
62 changes: 62 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug example 'bloom_inference'",
"cargo": {
"args": [
"build",
"--example=bloom_inference",
"--package=bloom"
],
"filter": {
"name": "bloom_inference",
"kind": "example"
}
},
"args": ["${env:HOME}/.ggml-models/bloom-7b.bin"],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug example 'gpt2_inference'",
"cargo": {
"args": [
"build",
"--example=gpt2_inference",
"--package=gpt2"
],
"filter": {
"name": "gpt2_inference",
"kind": "example"
}
},
"args": ["${env:HOME}/.ggml-models/cerebras-gpt-13b.bin"],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug example 'llama_inference'",
"cargo": {
"args": [
"build",
"--example=llama_inference",
"--package=llama"
],
"filter": {
"name": "llama_inference",
"kind": "example"
}
},
"args": ["${env:HOME}/.ggml-models/gpt4all-7b.bin"],
"cwd": "${workspaceFolder}"
}
]
}
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ When new GGML versions are pushed to llama.cpp (or one of the other repos
hosting a copy of it) and we want to update our copy, the process should be as
follows:

- Update the `ggml.c` and `ggml.h` inside `ggml-sys/ggml`.
- In that same folder, update `CREDITS.txt` to indicate the llama.cpp version
these files were taken from
- Update the submodule to the latest version of GGML:
```shell
$ git submodule update --remote
```
- Run the bindgen script:
```shell
$ cargo run --bin generate-ggml-bindings ggml-sys
```
```shell
$ cargo run --bin generate-ggml-bindings ggml-sys
```
- Fix any compiler errors that pop up due to the new version of the bindings and
test the changes.
106 changes: 78 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
[workspace]
members = [
"ggml-sys",
# Crates
"bloom",
"ggml",
"ggml-format",
"llama-rs",
"llama-cli",
"generate-ggml-bindings"
"ggml/sys",
"gpt2",
"llama",
"llm",
"llm-base",
"llm-cli",
"tools/*"
]
resolver = "2"

[workspace.package]
version = "0.1.0"

[workspace.dependencies]
bytemuck = "1.13.1"
log = "0.4"
rand = "0.8.5"
serde = { version = "1.0", features = ["derive"] }
Loading