Skip to content

Commit 6fa277d

Browse files
authored
Merge pull request #1 from DrJesseGlass/examples/add/smolLM3-chat
Add chat template
2 parents 08625c5 + f287021 commit 6fa277d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+7396
-2105
lines changed

.github/workflows/ci_cuda.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ jobs:
1010
group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.run_id }}
1111
cancel-in-progress: true
1212
runs-on:
13-
group: aws-g4dn-2xlarge
13+
group: aws-g5-4xlarge-cache
1414
container:
15-
image: nvidia/cuda:12.3.1-devel-ubuntu22.04
16-
options: --gpus 0
15+
image: nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04
1716
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
1817
permissions:
1918
contents: write
@@ -22,13 +21,15 @@ jobs:
2221
# with sigstore/fulcio when running outside of PRs.
2322
id-token: write
2423
security-events: write
24+
env:
25+
CUDA_COMPUTE_CAP: 86
2526
steps:
2627
- name: Checkout repository
27-
uses: actions/checkout@v3
28+
uses: actions/checkout@v5
2829
- name: Install dependencies
29-
run: apt-get update && apt install curl build-essential libssl-dev protobuf-compiler pkg-config -y
30+
run: apt update && apt install curl build-essential libssl-dev protobuf-compiler pkg-config -y
3031
- name: Install Rust Stable
31-
uses: actions-rust-lang/setup-rust-toolchain@v1
32+
uses: dtolnay/rust-toolchain@stable
3233
- uses: Swatinem/rust-cache@v2
3334
- name: Test (cuda)
3435
run: cargo test --features cuda

.github/workflows/maturin.yml

-3.47 KB
Binary file not shown.

.github/workflows/python.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ jobs:
2020
os: [ubuntu-latest] # For now, only test on Linux
2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v5
2424

2525
- name: Install Rust
26-
uses: actions-rs/toolchain@v1
27-
with:
28-
toolchain: stable
26+
uses: dtolnay/rust-toolchain@stable
2927

3028
- name: Install Python
31-
uses: actions/setup-python@v4
29+
uses: actions/setup-python@v6
3230
with:
33-
python-version: 3.11
31+
python-version: 3.13
3432
architecture: "x64"
3533

3634
- name: Cache Cargo Registry
@@ -42,8 +40,8 @@ jobs:
4240
- name: Install Protoc
4341
uses: arduino/setup-protoc@v2
4442
with:
45-
version: "25.0"
46-
repo-token: ${{ secrets.GITHUB_TOKEN }}
43+
version: "25.0"
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
4745

4846
- name: Install
4947
working-directory: ./candle-pyo3

.github/workflows/rust-ci.yml

Lines changed: 34 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,81 +13,68 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest, windows-latest, macOS-latest]
16-
rust: [stable]
1716
steps:
18-
- uses: actions/checkout@v4
19-
- uses: actions/setup-python@v5
17+
- uses: actions/checkout@v5
18+
- uses: actions/setup-python@v6
2019
with:
21-
python-version: "3.11"
20+
python-version: "3.13"
2221
- name: Remove cargo config (macOS ring crate fix)
2322
if: runner.os == 'macOS'
2423
run: rm -f .cargo/config.toml
25-
- uses: actions-rs/toolchain@v1
26-
with:
27-
profile: minimal
28-
toolchain: ${{ matrix.rust }}
29-
override: true
30-
- uses: actions-rs/cargo@v1
31-
with:
32-
command: check
33-
args: --workspace
24+
- uses: dtolnay/rust-toolchain@stable
25+
- run: cargo check --workspace
3426

3527
test:
3628
name: Test Suite
3729
runs-on: ${{ matrix.os }}
3830
strategy:
3931
matrix:
4032
os: [ubuntu-latest, windows-latest, macOS-latest]
41-
rust: [stable]
4233
steps:
43-
- name: Delete huge unnecessary tools folder
34+
- name: Free disk space (Linux)
4435
if: runner.os == 'Linux'
45-
run: rm -rf /opt/hostedtoolcache
46-
- uses: actions/checkout@v4
47-
- uses: actions/setup-python@v5
36+
run: |
37+
sudo rm -rf /opt/hostedtoolcache
38+
sudo rm -rf /usr/share/dotnet
39+
sudo rm -rf /usr/local/lib/android
40+
sudo rm -rf /opt/ghc
41+
df -h
42+
- uses: actions/checkout@v5
43+
- uses: actions/setup-python@v6
4844
with:
49-
python-version: "3.11"
45+
python-version: "3.13"
5046
- name: Remove cargo config (macOS ring crate fix)
5147
if: runner.os == 'macOS'
5248
run: rm -f .cargo/config.toml
53-
- uses: actions-rs/toolchain@v1
54-
with:
55-
profile: minimal
56-
toolchain: ${{ matrix.rust }}
57-
override: true
58-
- uses: actions-rs/cargo@v1
59-
with:
60-
command: test
61-
args: --workspace
49+
- uses: dtolnay/rust-toolchain@stable
50+
- name: Install lld (Linux only)
51+
if: runner.os == 'Linux'
52+
run: sudo apt-get update && sudo apt-get install -y lld
53+
- name: Run tests (with lld on Linux)
54+
if: runner.os == 'Linux'
55+
env:
56+
RUSTFLAGS: "-C link-arg=-fuse-ld=lld"
57+
run: cargo test --workspace
58+
- name: Run tests (Windows & macOS)
59+
if: runner.os != 'Linux'
60+
run: cargo test --workspace
6261

6362
fmt:
6463
name: Rustfmt
6564
runs-on: ubuntu-latest
6665
steps:
67-
- uses: actions/checkout@v4
68-
- uses: actions-rs/toolchain@v1
66+
- uses: actions/checkout@v5
67+
- uses: dtolnay/rust-toolchain@stable
6968
with:
70-
profile: minimal
71-
toolchain: stable
72-
override: true
73-
- run: rustup component add rustfmt
74-
- uses: actions-rs/cargo@v1
75-
with:
76-
command: fmt
77-
args: --all -- --check
69+
components: rustfmt
70+
- run: cargo fmt --all -- --check
7871

7972
clippy:
8073
name: Clippy
8174
runs-on: ubuntu-latest
8275
steps:
8376
- uses: actions/checkout@v4
84-
- uses: actions-rs/toolchain@v1
85-
with:
86-
profile: minimal
87-
toolchain: stable
88-
override: true
89-
- run: rustup component add clippy
90-
- uses: actions-rs/cargo@v1
77+
- uses: dtolnay/rust-toolchain@stable
9178
with:
92-
command: clippy
93-
args: --workspace --tests --examples --benches -- -D warnings
79+
components: clippy
80+
- run: cargo clippy --workspace --tests --examples --benches -- -D warnings

.github/workflows/trufflehog.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ jobs:
77
trufflehog:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v4
12-
with:
13-
fetch-depth: 0
14-
- name: Secret Scanning
15-
uses: trufflesecurity/trufflehog@main
10+
- name: Checkout code
11+
uses: actions/checkout@v5
12+
with:
13+
fetch-depth: 0
14+
- name: Secret Scanning
15+
uses: trufflesecurity/trufflehog@main

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Cargo.lock
1212
# editor config
1313
.helix
1414
.vscode
15+
.zed
1516

1617
# These are backup files generated by rustfmt
1718
**/*.rs.bk

.vscode/settings.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ candle-onnx = { path = "./candle-onnx", version = "0.9.2-alpha.1" }
4545
candle-transformers = { path = "./candle-transformers", version = "0.9.2-alpha.1" }
4646
clap = { version = "4.2.4", features = ["derive"] }
4747
criterion = { version = "0.7.0", default-features = false }
48-
cudarc = { version = "0.17.3", features = [
48+
cudarc = { version = "0.18.1", features = [
4949
"std",
5050
"cublas",
5151
"cublaslt",
@@ -65,7 +65,7 @@ half = { version = "2.5.0", features = [
6565
"use-intrinsics",
6666
"rand_distr",
6767
] }
68-
float8 = { version = "0.4.2", features = [
68+
float8 = { version = "0.5.0", features = [
6969
"num-traits",
7070
"rand_distr",
7171
] }
@@ -77,6 +77,7 @@ image = { version = "0.25.2", default-features = false, features = [
7777
imageproc = { version = "0.24.0", default-features = false }
7878
intel-mkl-src = { version = "0.8.1", features = ["mkl-static-lp64-iomp"] }
7979
libc = { version = "0.2.147" }
80+
libm = { version = "0.2.15" }
8081
log = "0.4"
8182
memmap2 = { version = "0.9.3", features = ["stable_deref_trait"] }
8283
num_cpus = "1.15.0"
@@ -85,7 +86,7 @@ parquet = { version = "51.0.0" }
8586
rand = "0.9.0"
8687
rand_distr = "0.5.1"
8788
rayon = "1.7.0"
88-
safetensors = "0.4.1"
89+
safetensors = "0.6.0"
8990
serde = { version = "1.0.171", features = ["derive"] }
9091
serde_plain = "1.0.2"
9192
serde_json = "1.0.99"

candle-core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ half = { workspace = true }
2222
float8 = { workspace = true }
2323
intel-mkl-src = { workspace = true, optional = true }
2424
libc = { workspace = true, optional = true }
25+
libm = { workspace = true }
2526
memmap2 = { workspace = true }
2627
num-traits = { workspace = true }
2728
num_cpus = { workspace = true }

candle-core/benches/benchmarks/affine.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ fn criterion_benchmark(c: &mut Criterion) {
3838
run_affine_benchmark(c, &device, DType::F32, "affine_f32");
3939
run_affine_benchmark(c, &device, DType::F16, "affine_f16");
4040
run_affine_benchmark(c, &device, DType::BF16, "affine_bf16");
41-
#[cfg(feature = "metal")]
42-
continue;
41+
#[cfg(not(feature = "metal"))]
4342
run_affine_benchmark(c, &device, DType::F8E4M3, "affine_fp8");
4443
}
4544
}

0 commit comments

Comments
 (0)