Jan Krukowski
commited on
Commit
Β·
902bb3d
1
Parent(s):
087dd55
Initial commit
Browse files- .gitattributes +1 -0
- EmbeddingsBenchmark/.gitignore +8 -0
- EmbeddingsBenchmark/Benchmarks/EmbeddingsBenchmark/EmbeddingsBenchmark.swift +34 -0
- EmbeddingsBenchmark/Package.resolved +141 -0
- EmbeddingsBenchmark/Package.swift +54 -0
- EmbeddingsBenchmark/Sources/EmbeddingsBenchmarkLib/EmbeddingsBenchmarkLib.swift +33 -0
- EmbeddingsBenchmark/Tests/EmbeddingsBenchmarkTests/EmbeddingsBenchmarkTests.swift +40 -0
- README.md +120 -0
- embeddings.db +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
embeddings.db filter=lfs diff=lfs merge=lfs -text
|
EmbeddingsBenchmark/.gitignore
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
/.build
|
3 |
+
/Packages
|
4 |
+
xcuserdata/
|
5 |
+
DerivedData/
|
6 |
+
.swiftpm/configuration/registries.json
|
7 |
+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
|
8 |
+
.netrc
|
EmbeddingsBenchmark/Benchmarks/EmbeddingsBenchmark/EmbeddingsBenchmark.swift
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import CoreML
|
2 |
+
import Benchmark
|
3 |
+
import Embeddings
|
4 |
+
import EmbeddingsBenchmarkLib
|
5 |
+
import Foundation
|
6 |
+
import SQLiteVec
|
7 |
+
|
8 |
+
@MainActor let benchmarks = {
|
9 |
+
let parameterization = [10, 1000, 100000]
|
10 |
+
parameterization.forEach { count in
|
11 |
+
Benchmark("SQLite benchmark", configuration: .init(tags: ["count" : count.description])) { benchmark, db in
|
12 |
+
let tokenIds = (0..<count).map { _ in Int.random(in: 0..<1000) }
|
13 |
+
let query = "(\(tokenIds.map { _ in "?" }.joined(separator: ",")))"
|
14 |
+
benchmark.startMeasurement()
|
15 |
+
let result = try await queryEmbeddings(db: db, query: query, tokenIds: tokenIds)
|
16 |
+
blackHole(result)
|
17 |
+
} setup: {
|
18 |
+
try initializeDatabase("../embeddings.db")
|
19 |
+
}
|
20 |
+
|
21 |
+
Benchmark("CoreML benchmark", configuration: .init(tags: ["count" : count.description])) { (benchmark: _, embeddings: MLTensor) in
|
22 |
+
let tokenIds = (0..<count).map { _ in Int32.random(in: 0..<1000) }
|
23 |
+
benchmark.startMeasurement()
|
24 |
+
let result = await queryEmbeddings(embeddings: embeddings, tokenIds: tokenIds)
|
25 |
+
blackHole(result)
|
26 |
+
} setup: {
|
27 |
+
let modelBundle = try await StaticEmbeddings.loadModelBundle(
|
28 |
+
from: "sentence-transformers/static-retrieval-mrl-en-v1",
|
29 |
+
loadConfig: LoadConfig.staticEmbeddings
|
30 |
+
)
|
31 |
+
return modelBundle.model.embeddings
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
EmbeddingsBenchmark/Package.resolved
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"originHash" : "c0c5da26b668f59a78fa7ea6e6755ca0f61bb28d38c1907156dbe4a6e49b39ec",
|
3 |
+
"pins" : [
|
4 |
+
{
|
5 |
+
"identity" : "hdrhistogram-swift",
|
6 |
+
"kind" : "remoteSourceControl",
|
7 |
+
"location" : "https://github.com/HdrHistogram/hdrhistogram-swift",
|
8 |
+
"state" : {
|
9 |
+
"revision" : "a69fa24d7b70421870cafa86340ece900489e17e",
|
10 |
+
"version" : "0.1.2"
|
11 |
+
}
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"identity" : "jinja",
|
15 |
+
"kind" : "remoteSourceControl",
|
16 |
+
"location" : "https://github.com/johnmai-dev/Jinja",
|
17 |
+
"state" : {
|
18 |
+
"revision" : "bbddb92fc51ae420b87300298370fd1dfc308f73",
|
19 |
+
"version" : "1.1.1"
|
20 |
+
}
|
21 |
+
},
|
22 |
+
{
|
23 |
+
"identity" : "package-benchmark",
|
24 |
+
"kind" : "remoteSourceControl",
|
25 |
+
"location" : "https://github.com/ordo-one/package-benchmark",
|
26 |
+
"state" : {
|
27 |
+
"revision" : "51fffb6bc58bcbaca9c1954e6e52b56f3c9c2d54",
|
28 |
+
"version" : "1.27.4"
|
29 |
+
}
|
30 |
+
},
|
31 |
+
{
|
32 |
+
"identity" : "package-jemalloc",
|
33 |
+
"kind" : "remoteSourceControl",
|
34 |
+
"location" : "https://github.com/ordo-one/package-jemalloc",
|
35 |
+
"state" : {
|
36 |
+
"revision" : "e8a5db026963f5bfeac842d9d3f2cc8cde323b49",
|
37 |
+
"version" : "1.0.0"
|
38 |
+
}
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"identity" : "sqlitevec",
|
42 |
+
"kind" : "remoteSourceControl",
|
43 |
+
"location" : "https://github.com/jkrukowski/SQLiteVec.git",
|
44 |
+
"state" : {
|
45 |
+
"revision" : "eaa734a8c7615e2ef791c218280292f27d33db39",
|
46 |
+
"version" : "0.0.13"
|
47 |
+
}
|
48 |
+
},
|
49 |
+
{
|
50 |
+
"identity" : "swift-argument-parser",
|
51 |
+
"kind" : "remoteSourceControl",
|
52 |
+
"location" : "https://github.com/apple/swift-argument-parser.git",
|
53 |
+
"state" : {
|
54 |
+
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
|
55 |
+
"version" : "1.5.0"
|
56 |
+
}
|
57 |
+
},
|
58 |
+
{
|
59 |
+
"identity" : "swift-atomics",
|
60 |
+
"kind" : "remoteSourceControl",
|
61 |
+
"location" : "https://github.com/apple/swift-atomics",
|
62 |
+
"state" : {
|
63 |
+
"revision" : "cd142fd2f64be2100422d658e7411e39489da985",
|
64 |
+
"version" : "1.2.0"
|
65 |
+
}
|
66 |
+
},
|
67 |
+
{
|
68 |
+
"identity" : "swift-collections",
|
69 |
+
"kind" : "remoteSourceControl",
|
70 |
+
"location" : "https://github.com/apple/swift-collections.git",
|
71 |
+
"state" : {
|
72 |
+
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
|
73 |
+
"version" : "1.1.4"
|
74 |
+
}
|
75 |
+
},
|
76 |
+
{
|
77 |
+
"identity" : "swift-embeddings",
|
78 |
+
"kind" : "remoteSourceControl",
|
79 |
+
"location" : "https://github.com/jkrukowski/swift-embeddings",
|
80 |
+
"state" : {
|
81 |
+
"revision" : "b9a8e6b536cb7a4541ab7ba411ea5c4fed6e9f18",
|
82 |
+
"version" : "0.0.11"
|
83 |
+
}
|
84 |
+
},
|
85 |
+
{
|
86 |
+
"identity" : "swift-numerics",
|
87 |
+
"kind" : "remoteSourceControl",
|
88 |
+
"location" : "https://github.com/apple/swift-numerics",
|
89 |
+
"state" : {
|
90 |
+
"revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
|
91 |
+
"version" : "1.0.2"
|
92 |
+
}
|
93 |
+
},
|
94 |
+
{
|
95 |
+
"identity" : "swift-safetensors",
|
96 |
+
"kind" : "remoteSourceControl",
|
97 |
+
"location" : "https://github.com/jkrukowski/swift-safetensors.git",
|
98 |
+
"state" : {
|
99 |
+
"revision" : "718b0f38f912e0bf9d92130fa1e1fe2ae5136dd6",
|
100 |
+
"version" : "0.0.7"
|
101 |
+
}
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"identity" : "swift-sentencepiece",
|
105 |
+
"kind" : "remoteSourceControl",
|
106 |
+
"location" : "https://github.com/jkrukowski/swift-sentencepiece",
|
107 |
+
"state" : {
|
108 |
+
"revision" : "75d725019ff0b75fbbd7128314fe6710c5a86df0",
|
109 |
+
"version" : "0.0.5"
|
110 |
+
}
|
111 |
+
},
|
112 |
+
{
|
113 |
+
"identity" : "swift-system",
|
114 |
+
"kind" : "remoteSourceControl",
|
115 |
+
"location" : "https://github.com/apple/swift-system",
|
116 |
+
"state" : {
|
117 |
+
"revision" : "c8a44d836fe7913603e246acab7c528c2e780168",
|
118 |
+
"version" : "1.4.0"
|
119 |
+
}
|
120 |
+
},
|
121 |
+
{
|
122 |
+
"identity" : "swift-transformers",
|
123 |
+
"kind" : "remoteSourceControl",
|
124 |
+
"location" : "https://github.com/huggingface/swift-transformers.git",
|
125 |
+
"state" : {
|
126 |
+
"revision" : "8a83416cc00ab07a5de9991e6ad817a9b8588d20",
|
127 |
+
"version" : "0.1.15"
|
128 |
+
}
|
129 |
+
},
|
130 |
+
{
|
131 |
+
"identity" : "texttable",
|
132 |
+
"kind" : "remoteSourceControl",
|
133 |
+
"location" : "https://github.com/ordo-one/TextTable",
|
134 |
+
"state" : {
|
135 |
+
"revision" : "a27a07300cf4ae322e0079ca0a475c5583dd575f",
|
136 |
+
"version" : "0.0.2"
|
137 |
+
}
|
138 |
+
}
|
139 |
+
],
|
140 |
+
"version" : 3
|
141 |
+
}
|
EmbeddingsBenchmark/Package.swift
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// swift-tools-version: 6.0
|
2 |
+
|
3 |
+
import PackageDescription
|
4 |
+
|
5 |
+
let package = Package(
|
6 |
+
name: "EmbeddingsBenchmark",
|
7 |
+
platforms: [
|
8 |
+
.macOS(.v15)
|
9 |
+
],
|
10 |
+
dependencies: [
|
11 |
+
.package(
|
12 |
+
url: "https://github.com/jkrukowski/SQLiteVec.git",
|
13 |
+
from: "0.0.13"
|
14 |
+
),
|
15 |
+
.package(
|
16 |
+
url: "https://github.com/jkrukowski/swift-embeddings",
|
17 |
+
from: "0.0.11"
|
18 |
+
),
|
19 |
+
.package(
|
20 |
+
url: "https://github.com/ordo-one/package-benchmark",
|
21 |
+
from: "1.27.4"
|
22 |
+
)
|
23 |
+
],
|
24 |
+
targets: [
|
25 |
+
.target(
|
26 |
+
name: "EmbeddingsBenchmarkLib",
|
27 |
+
dependencies: [
|
28 |
+
.product(name: "SQLiteVec", package: "SQLiteVec"),
|
29 |
+
.product(name: "Embeddings", package: "swift-embeddings")
|
30 |
+
]
|
31 |
+
),
|
32 |
+
.testTarget(
|
33 |
+
name: "EmbeddingsBenchmarkTests",
|
34 |
+
dependencies: [
|
35 |
+
"EmbeddingsBenchmarkLib",
|
36 |
+
.product(name: "SQLiteVec", package: "SQLiteVec"),
|
37 |
+
.product(name: "Embeddings", package: "swift-embeddings")
|
38 |
+
]
|
39 |
+
),
|
40 |
+
.executableTarget(
|
41 |
+
name: "EmbeddingsBenchmark",
|
42 |
+
dependencies: [
|
43 |
+
"EmbeddingsBenchmarkLib",
|
44 |
+
.product(name: "SQLiteVec", package: "SQLiteVec"),
|
45 |
+
.product(name: "Embeddings", package: "swift-embeddings"),
|
46 |
+
.product(name: "Benchmark", package: "package-benchmark")
|
47 |
+
],
|
48 |
+
path: "Benchmarks/EmbeddingsBenchmark",
|
49 |
+
plugins: [
|
50 |
+
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
|
51 |
+
]
|
52 |
+
),
|
53 |
+
]
|
54 |
+
)
|
EmbeddingsBenchmark/Sources/EmbeddingsBenchmarkLib/EmbeddingsBenchmarkLib.swift
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Accelerate
|
2 |
+
import CoreML
|
3 |
+
import Embeddings
|
4 |
+
import Foundation
|
5 |
+
import SQLiteVec
|
6 |
+
|
7 |
+
public func initializeDatabase(_ filePath: String) throws -> Database {
|
8 |
+
try SQLiteVec.initialize()
|
9 |
+
return try Database(.uri(filePath))
|
10 |
+
}
|
11 |
+
|
12 |
+
@discardableResult
|
13 |
+
public func queryEmbeddings(db: Database, query: String, tokenIds: [Int], vectorSize: Int = 1024) async throws -> [Float] {
|
14 |
+
let result = try await db.query("SELECT embedding FROM embeddings WHERE rowid IN \(query)", params: tokenIds)
|
15 |
+
var acc = [Float](repeating: 0, count: vectorSize)
|
16 |
+
for item in result {
|
17 |
+
guard let embedding = item["embedding"] as? Data else {
|
18 |
+
continue
|
19 |
+
}
|
20 |
+
let row: [Float] = embedding.toArray()
|
21 |
+
acc = vDSP.add(row, acc)
|
22 |
+
}
|
23 |
+
return vDSP.divide(acc, Float(result.count))
|
24 |
+
}
|
25 |
+
|
26 |
+
@discardableResult
|
27 |
+
public func queryEmbeddings(embeddings: MLTensor, tokenIds: [Int32]) async -> [Float] {
|
28 |
+
let indices = MLTensor(shape: [tokenIds.count], scalars: tokenIds)
|
29 |
+
let data = embeddings
|
30 |
+
.gathering(atIndices: indices, alongAxis: 0)
|
31 |
+
.mean(alongAxes: 0)
|
32 |
+
return await data.shapedArray(of: Float.self).scalars
|
33 |
+
}
|
EmbeddingsBenchmark/Tests/EmbeddingsBenchmarkTests/EmbeddingsBenchmarkTests.swift
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import CoreML
|
2 |
+
import SQLiteVec
|
3 |
+
import Testing
|
4 |
+
|
5 |
+
@testable import EmbeddingsBenchmarkLib
|
6 |
+
|
7 |
+
func createDatabase(_ data: [[Float]]) async throws -> Database {
|
8 |
+
try SQLiteVec.initialize()
|
9 |
+
let db = try Database(.inMemory)
|
10 |
+
try await db.execute("CREATE VIRTUAL TABLE embeddings USING vec0(embedding float[3])")
|
11 |
+
for (index, row) in data.enumerated() {
|
12 |
+
try await db.execute(
|
13 |
+
"""
|
14 |
+
INSERT INTO embeddings(rowid, embedding)
|
15 |
+
VALUES (?, ?)
|
16 |
+
""",
|
17 |
+
params: [index, row]
|
18 |
+
)
|
19 |
+
}
|
20 |
+
return db
|
21 |
+
}
|
22 |
+
|
23 |
+
@Test func testEmbeddingMethods() async throws {
|
24 |
+
let data: [[Float]] = [
|
25 |
+
[1.0, 2.0, 3.0],
|
26 |
+
[4.0, 5.0, 6.0],
|
27 |
+
[7.0, 8.0, 9.0]
|
28 |
+
]
|
29 |
+
let embeddings = MLTensor(shape: [3, 3], scalars: data.flatMap { $0 })
|
30 |
+
let coreMLResult = await queryEmbeddings(embeddings: embeddings, tokenIds: [0, 2])
|
31 |
+
|
32 |
+
let db = try await createDatabase(data)
|
33 |
+
let sqliteResult = try await queryEmbeddings(
|
34 |
+
db: db,
|
35 |
+
query: "(?, ?)",
|
36 |
+
tokenIds: [0, 2],
|
37 |
+
vectorSize: 3)
|
38 |
+
|
39 |
+
#expect(coreMLResult == sqliteResult)
|
40 |
+
}
|
README.md
CHANGED
@@ -1,3 +1,123 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
|
5 |
+
# Static Embeddings using SQLiteVec
|
6 |
+
|
7 |
+
- This repo contains [sentence-transformers/static-retrieval-mrl-en-v1](https://huggingface.co/sentence-transformers/static-retrieval-mrl-en-v1)
|
8 |
+
model converted to [sqlite-vec](https://github.com/asg017/sqlite-vec) database.
|
9 |
+
|
10 |
+
- This repo contains a Swift package that demonstrates how to use the [SQLiteVec](https://github.com/jkrukowski/SQLiteVec) to compute static embeddings.
|
11 |
+
|
12 |
+
- This repo contains a benchmark that compares the performance of computing embeddings using [swift-embeddings](https://github.com/jkrukowski/swift-embeddings) and [SQLiteVec](https://github.com/jkrukowski/SQLiteVec).
|
13 |
+
|
14 |
+
The sqlite-vec database was created using the following command:
|
15 |
+
|
16 |
+
```sql
|
17 |
+
CREATE VIRTUAL TABLE embeddings USING vec0(embedding float[1024])
|
18 |
+
```
|
19 |
+
|
20 |
+
and then the embeddings were inserted using the following command:
|
21 |
+
|
22 |
+
```sql
|
23 |
+
INSERT INTO embeddings(rowid, embedding) VALUES (?, ?)
|
24 |
+
```
|
25 |
+
|
26 |
+
## Benchmark
|
27 |
+
|
28 |
+
To run the benchmark, execute the following command:
|
29 |
+
|
30 |
+
```bash
|
31 |
+
cd EmbeddingsBenchmark
|
32 |
+
swift package --disable-sandbox benchmark
|
33 |
+
```
|
34 |
+
|
35 |
+
### Results
|
36 |
+
|
37 |
+
```
|
38 |
+
|
39 |
+
CoreML benchmark (count: 10)
|
40 |
+
βββββββββββββββββββββββββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ
|
41 |
+
β Metric β p0 β p25 β p50 β p75 β p90 β p99 β p100 β Samples β
|
42 |
+
βββββββββββββββββββββββββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββ‘
|
43 |
+
β Instructions (K) * β 1712 β 1779 β 1779 β 1791 β 1792 β 1805 β 1899 β 5136 β
|
44 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
45 |
+
β Malloc (total) * β 1131 β 1132 β 1132 β 1132 β 1132 β 1132 β 1139 β 5136 β
|
46 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
47 |
+
β Memory (resident peak) (M) β 156 β 158 β 158 β 159 β 159 β 159 β 159 β 5136 β
|
48 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
49 |
+
β Throughput (# / s) (#) β 11121 β 9471 β 9287 β 8919 β 8607 β 7747 β 5810 β 5136 β
|
50 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
51 |
+
β Time (total CPU) (ΞΌs) * β 92 β 107 β 109 β 114 β 118 β 131 β 174 β 5136 β
|
52 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
53 |
+
β Time (wall clock) (ΞΌs) * β 90 β 106 β 108 β 112 β 116 β 129 β 172 β 5136 β
|
54 |
+
βββββββββββββββββββββββββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ
|
55 |
+
|
56 |
+
CoreML benchmark (count: 1000)
|
57 |
+
βββββββββββββββββββββββββββββββββ€ββββββββββ€ββββββββββ€ββοΏ½οΏ½βββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ
|
58 |
+
β Metric β p0 β p25 β p50 β p75 β p90 β p99 β p100 β Samples β
|
59 |
+
βββββββββββββββββββββββββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββ‘
|
60 |
+
β Instructions (K) * β 3320 β 3422 β 3467 β 3516 β 3545 β 3566 β 3640 β 2698 β
|
61 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
62 |
+
β Malloc (total) * β 1131 β 1132 β 1132 β 1132 β 1132 β 1132 β 1140 β 2698 β
|
63 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
64 |
+
β Memory (resident peak) (M) β 159 β 162 β 162 β 162 β 162 β 162 β 162 β 2698 β
|
65 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
66 |
+
β Throughput (# / s) (#) β 4418 β 4299 β 4231 β 4139 β 3999 β 3515 β 2093 β 2698 β
|
67 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
68 |
+
β Time (total CPU) (ΞΌs) * β 228 β 234 β 238 β 243 β 252 β 287 β 480 β 2698 β
|
69 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
70 |
+
β Time (wall clock) (ΞΌs) * β 226 β 233 β 237 β 242 β 250 β 285 β 478 β 2698 β
|
71 |
+
βββββββββββββββββββββββββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ
|
72 |
+
|
73 |
+
CoreML benchmark (count: 100000)
|
74 |
+
βββββββββββββββββββββββββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ
|
75 |
+
β Metric β p0 β p25 β p50 β p75 β p90 β p99 β p100 β Samples β
|
76 |
+
βββββββββββββββββββββββββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββ‘
|
77 |
+
β Instructions (M) * β 163 β 163 β 163 β 163 β 163 β 168 β 168 β 20 β
|
78 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
79 |
+
β Malloc (total) * β 1131 β 1131 β 1131 β 1132 β 1133 β 1139 β 1139 β 20 β
|
80 |
+
βββββββββββββββββββββββββββββββββΌββββββββοΏ½οΏ½βΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
81 |
+
β Memory (resident peak) (M) β 566 β 567 β 567 β 568 β 568 β 568 β 568 β 20 β
|
82 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
83 |
+
β Throughput (# / s) (#) β 21 β 21 β 21 β 21 β 21 β 20 β 20 β 20 β
|
84 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
85 |
+
β Time (total CPU) (ms) * β 47 β 48 β 48 β 48 β 48 β 50 β 50 β 20 β
|
86 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
87 |
+
β Time (wall clock) (ms) * β 47 β 48 β 48 β 48 β 48 β 50 β 50 β 20 β
|
88 |
+
βββββββββββββββββββββββββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ
|
89 |
+
|
90 |
+
SQLite benchmark (count: 10)
|
91 |
+
βββββββββββββββββββββββββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ
|
92 |
+
β Metric β p0 β p25 β p50 β p75 β p90 β p99 β p100 β Samples β
|
93 |
+
βββββββββββββββββββββββββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββ‘
|
94 |
+
β Instructions (M) * β 103 β 117 β 122 β 128 β 132 β 136 β 140 β 144 β
|
95 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
96 |
+
β Malloc (total) * β 99 β 106 β 106 β 106 β 106 β 107 β 107 β 144 β
|
97 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
98 |
+
β Memory (resident peak) (M) β 15 β 17 β 19 β 19 β 19 β 19 β 19 β 144 β
|
99 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
100 |
+
β Throughput (# / s) (#) β 186 β 155 β 147 β 139 β 132 β 126 β 126 β 144 β
|
101 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
102 |
+
β Time (total CPU) (ΞΌs) * β 5382 β 6451 β 6779 β 7180 β 7582 β 7922 β 7932 β 144 β
|
103 |
+
βββββββββββββββββββββββββββββοΏ½οΏ½οΏ½βββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
104 |
+
β Time (wall clock) (ΞΌs) * β 5380 β 6443 β 6779 β 7180 β 7574 β 7918 β 7930 β 144 β
|
105 |
+
βββββββββββββββββββββββββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ
|
106 |
+
|
107 |
+
SQLite benchmark (count: 1000)
|
108 |
+
βββββββββββββββββββββββββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ€ββββββββββ
|
109 |
+
β Metric β p0 β p25 β p50 β p75 β p90 β p99 β p100 β Samples β
|
110 |
+
βββββββββββββββββββββββββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββ‘
|
111 |
+
β Instructions (M) * β 1517 β 1572 β 1599 β 1611 β 1618 β 1618 β 1618 β 9 β
|
112 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
113 |
+
β Malloc (total) * β 6330 β 6339 β 6367 β 6379 β 6414 β 6414 β 6414 β 9 β
|
114 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
115 |
+
β Memory (resident peak) (M) β 22 β 23 β 23 β 23 β 23 β 23 β 23 β 9 β
|
116 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
117 |
+
β Throughput (# / s) (#) β 9 β 8 β 8 β 8 β 8 β 8 β 8 β 9 β
|
118 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
119 |
+
β Time (total CPU) (ms) * β 114 β 118 β 120 β 121 β 121 β 121 β 121 β 9 β
|
120 |
+
βββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
|
121 |
+
β Time (wall clock) (ms) * β 114 β 118 β 120 β 121 β 121 β 121 β 121 β 9 β
|
122 |
+
βββββββββββββββββββββββββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ§ββββββββββ
|
123 |
+
```
|
embeddings.db
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:74e3a963cf8e8242835a38caf2e4aa78bb4b5ae2ab07b0e1e95e07c01d9147ca
|
3 |
+
size 126672896
|