-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
589 lines (532 loc) · 24.1 KB
/
Cargo.toml
File metadata and controls
589 lines (532 loc) · 24.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
[workspace]
members = [
".", # Main library crate
"crates/bitnet-common",
"crates/bitnet-cpu-detect",
"crates/bitnet-math",
"crates/bitnet-simd",
"crates/bitnet-warn-once",
"crates/bitnet-thread-config-core", # SRP: reusable thread config and work partitioning primitives
"crates/bitnet-runtime-context",
"crates/bitnet-runtime-context-core",
"crates/bitnet-bdd-grid",
"crates/bitnet-bdd-grid-core",
"crates/bitnet-compat",
"crates/bitnet-compat-core", # SRP: shared GGUF compatibility diagnostics core
"crates/bitnet-ggml-ffi", # GGML FFI for IQ2_S support
"crates/bitnet-runtime-feature-flags",
"crates/bitnet-runtime-feature-flags-core",
"crates/bitnet-models",
"crates/bitnet-quantization",
"crates/bitnet-quantization-bits",
"crates/bitnet-cpu-activations", # SRP: CPU activation kernels shared microcrate
"crates/bitnet-kernels",
"crates/bitnet-inference",
"crates/bitnet-tool-use-core", # SRP: reusable tool-calling contracts and parse/detect helpers
"crates/bitnet-inference-metrics-core", # SRP: shared inference timing/throughput metric DTOs
"crates/bitnet-rope",
"crates/bitnet-tokenizers",
"crates/bitnet-token-merge-core", # SRP: reusable token span merge/split primitives
"crates/bitnet-tokenizer-model-core", # SRP: tokenizer model/vocabulary detection helpers
"crates/bitnet-tokenizer-discovery-core", # SRP: tokenizer path auto-discovery core
"crates/bitnet-tokenizer-text-core", # SRP: tokenizer pre-tokenization/normalization primitives
"crates/bitnet-weight-name-core", # SRP: vendor weight-name canonicalization helpers
"crates/bitnet-prompt-templates",
"crates/bitnet-prompt-templates-core",
"crates/bitnet-honest-compute",
"crates/bitnet-receipts",
"crates/bitnet-receipts-core",
"crates/bitnet-sampling",
"crates/bitnet-transformer", # Extracted from bitnet-models; depends on bitnet-quantization
"crates/bitnet-device-probe", # SRP: device detection / capability probing
"crates/bitnet-device-config-core", # SRP: shared device config parsing + resolution core
"crates/bitnet-intel-gpu-id", # SRP: Intel GPU/Arc identification heuristics
"crates/bitnet-logits", # SRP: pure logits transform functions
"crates/bitnet-qk256-layout-core", # SRP: reusable QK256 layout/input shape parsing + validation
"crates/bitnet-logits-filters", # SRP: reusable logits/probability filtering transforms
"crates/bitnet-generation", # SRP: decode-loop stopping logic & generation events
"crates/bitnet-generation-events-core", # SRP: reusable generation stream event/stat contracts
"crates/bitnet-generation-stop-core", # SRP: reusable stop criteria/check core
"crates/bitnet-kv-cache-policy-core", # SRP: KV-cache sequence transition decision policy
"crates/bitnet-engine-state-core", # SRP: reusable engine lifecycle state machine core
"crates/bitnet-session-config-core", # SRP: reusable inference session config contracts + validation
"crates/bitnet-engine-core", # SRP: orchestration contracts (traits, session types)
"crates/bitnet-repl-core", # SRP: reusable chat REPL state/command primitives
"crates/bitnet-gguf", # SRP: lightweight GGUF file format types & header parser
"crates/bitnet-probability", # SRP: probability normalization and categorical sampling primitives
"crates/bitnet-eval-core", # SRP: deterministic eval/scoring math helpers
"crates/bitnet-feature-matrix",
"crates/bitnet-client-ip-core", # SRP: reusable client IP extraction from forwarding headers
"crates/bitnet-api-versioning-core", # SRP: reusable API version negotiation and routing helpers
"crates/bitnet-api-key-auth-core", # SRP: API key auth policy/store primitives
"crates/bitnet-server-health-types-core", # SRP: reusable server health endpoint contract types
"crates/bitnet-request-context-core", # SRP: reusable request context metadata contracts
"crates/bitnet-server",
"crates/bitnet-cli-sampling-core", # SRP: reusable CLI sampling primitives
"crates/bitnet-cli-config-core", # SRP: reusable CLI configuration contracts/validation
"crates/bitnet-scoring-core", # SRP: reusable NLL/logit scoring primitives
"crates/bitnet-cli",
"crates/bitnet-st2gguf", # SafeTensors to GGUF converter
"crates/bitnet-safetensors-ln", # SRP: shared SafeTensors LayerNorm utilities
"crates/bitnet-st-tools", # SafeTensors inspection & merge utilities
"crates/bitnet-trace", # Tensor activation tracing for cross-validation
"crates/bitnet-ffi",
"crates/bitnet-py",
"crates/bitnet-runtime-bootstrap",
"crates/bitnet-startup-contract",
"crates/bitnet-wasm",
"crates/bitnet-wasm-utils",
"crates/bitnet-sys",
"crates/bitnet-feature-contract",
"crates/bitnet-runtime-profile",
"crates/bitnet-runtime-profile-core",
"crates/bitnet-runtime-profile-contract",
"crates/bitnet-runtime-profile-contract-core",
"crates/bitnet-testing-profile",
"crates/bitnet-testing-scenarios",
"crates/bitnet-testing-policy-core",
"crates/bitnet-testing-policy-snapshot-core", # SRP: policy snapshot resolution helpers
"crates/bitnet-testing-scenarios-core",
"crates/bitnet-testing-scenarios-profile-core",
"crates/bitnet-testing-policy",
"crates/bitnet-testing-policy-tests",
"crates/bitnet-testing-policy-kit",
"crates/bitnet-testing-policy-contract",
"crates/bitnet-testing-policy-interop",
"crates/bitnet-testing-policy-runtime",
"crates/bitnet-testing-policy-runtime-core",
"crates/bitnet-testing-policy-state-core",
"crates/bitnet-startup-contract-core",
"crates/bitnet-startup-contract-diagnostics-core",
"crates/bitnet-startup-contract-diagnostics",
"crates/bitnet-startup-contract-guard",
"crates/bitnet-test-support",
"crates/bitnet-test-env",
"crates/bitnet-test-fixtures-core",
"crates/bitnet-validation", # SRP: LayerNorm/projection validation rules (shared)
"crates/bitnet-atomic-file-core", # SRP: shared atomic file write primitive
"crates/bitnet-download-core", # SRP: core download validation and atomic file helpers
"crates/bitnet-download", # SRP: download mechanics primitives
"crates/bitnet-download-core", # SRP: pure download utility helpers
"crates/bitnet-http-retry", # SRP: reusable HTTP Retry-After/backoff timing primitives
"crates/bitnet-http-auth-core", # SRP: reusable Authorization Bearer parsing helpers
"crates/bitnet-gpu-hal", # GPU hardware abstraction layer
"crates/bitnet-nvidia", # SRP: NVIDIA-specific tuning heuristics
"crates/bitnet-opencl", # OpenCL backend for Intel Arc GPU inference
"crates/bitnet-spirv", # SRP: SPIR-V compile/validate/cache utilities
"crates/bitnet-metal", # MSL compute kernels for Apple Silicon
"crates/bitnet-rocm", # HIP compute kernels for AMD ROCm backend",
"crates/bitnet-vulkan", # Vulkan GLSL compute shaders for GPU inference
"crates/bitnet-vulkan-shaders",# SRP: embedded Vulkan GLSL shader source catalog
"crates/bitnet-wgpu", # WebGPU compute backend for cross-platform GPU inference
"crates/bitnet-dispatch-core", # SRP: backend-agnostic compute dispatch sizing/contracts
"crates/bitnet-bench-receipts", # SRP: benchmark receipt model + JSONL persistence
"crates/bitnet-bench-regression-core", # SRP: benchmark regression comparison primitives
"crates/bitnet-wgpu-bench", # Benchmarking and profiling harness for wgpu compute kernels
"crates/bitnet-wgpu-runner", # WebGPU kernel runner for GPU compute dispatch
"crossval",
"tests",
"tests-new",
"xtask",
"tools/bitnet-task",
"xtask-build-helper",
"fuzz",
"tools/migrate-gen-config", # AST migration tool for GenerationConfig
"crates/bitnet-wgpu-shaders-i2s", # WGSL compute shaders for I2_S 2-bit inference
"crates/bitnet-qk256-dispatch",
]
resolver = "2"
# Build & test these by default. Others (root `bitnet`, `tests`, `xtask`,
# wasm/py/ffi, etc.) remain workspace members but are opt-in.
default-members = [
"crates/bitnet-common",
"crates/bitnet-cpu-detect",
"crates/bitnet-math",
"crates/bitnet-simd",
"crates/bitnet-warn-once",
"crates/bitnet-thread-config-core",
"crates/bitnet-quantization",
"crates/bitnet-quantization-bits",
"crates/bitnet-rope",
"crates/bitnet-transformer",
"crates/bitnet-test-support",
"crates/bitnet-test-env",
"crates/bitnet-test-fixtures-core",
"crates/bitnet-models",
"crates/bitnet-tokenizers",
"crates/bitnet-token-merge-core", # SRP: reusable token span merge/split primitives
"crates/bitnet-tokenizer-model-core",
"crates/bitnet-tokenizer-discovery-core",
"crates/bitnet-cpu-activations", # SRP: CPU activation kernels shared microcrate
"crates/bitnet-kernels",
"crates/bitnet-inference",
"crates/bitnet-inference-metrics-core", # SRP: shared inference timing/throughput metric DTOs
"crates/bitnet-prompt-templates",
"crates/bitnet-prompt-templates-core",
"crates/bitnet-receipts",
"crates/bitnet-receipts-core",
"crates/bitnet-sampling",
"crates/bitnet-cli-sampling-core", # SRP: reusable CLI sampling primitives
"crates/bitnet-cli-config-core", # SRP: reusable CLI configuration contracts/validation
"crates/bitnet-cli",
"crates/bitnet-api-key-auth-core",
"crates/bitnet-scoring-core",
"crates/bitnet-server",
"crates/bitnet-st2gguf",
# Testing infrastructure crates (always built/tested by default)
"crates/bitnet-bdd-grid",
"crates/bitnet-bdd-grid-core",
"crates/bitnet-feature-contract",
"crates/bitnet-feature-matrix",
"crates/bitnet-server-health-types-core",
"crates/bitnet-request-context-core",
"crates/bitnet-testing-policy-core",
"crates/bitnet-testing-policy-snapshot-core", # SRP: policy snapshot resolution helpers
"crates/bitnet-testing-scenarios-core",
"crates/bitnet-runtime-profile-core",
# SRP microcrate extractions (phase-6)
"crates/bitnet-device-probe",
"crates/bitnet-logits",
"crates/bitnet-probability",
"crates/bitnet-logits-filters",
"crates/bitnet-generation",
"crates/bitnet-generation-events-core",
"crates/bitnet-generation-stop-core",
"crates/bitnet-kv-cache-policy-core",
"crates/bitnet-session-config-core",
"crates/bitnet-engine-core",
"crates/bitnet-repl-core",
"crates/bitnet-gguf",
"crates/bitnet-validation", # SRP: LayerNorm/projection validation rules (shared)
"crates/bitnet-download", # SRP: download mechanics primitives
"crates/bitnet-download-core", # SRP: pure download utility helpers
]
[package]
authors = ["BitNet Contributors <bitnet@EffortlessMetrics.com>"]
categories = ["science", "algorithms", "mathematics", "wasm", "api-bindings"]
description = "High-performance Rust implementation of BitNet 1-bit LLM inference with cross-platform support"
documentation = "https://docs.rs/bitnet"
edition = "2024"
homepage = "https://github.com/EffortlessMetrics/BitNet"
keywords = ["machine-learning", "llm", "quantization", "inference", "bitnet"]
license = "MIT OR Apache-2.0"
name = "bitnet"
readme = "README.md"
repository = "https://github.com/EffortlessMetrics/BitNet"
rust-version.workspace = true
version = "0.2.1-dev"
# Disable automatic discovery of tests, benches, and examples
# Many of these use outdated APIs and need updating
# Note: The tests/ directory is a separate bitnet-tests workspace crate
autoexamples = false
autotests = false
autobenches = false
[lib]
# Library source
[workspace.package]
authors = ["BitNet Contributors <bitnet@EffortlessMetrics.com>"]
categories = ["science", "algorithms", "mathematics", "wasm", "api-bindings"]
description = "High-performance Rust implementation of BitNet 1-bit LLM inference with cross-platform support"
documentation = "https://docs.rs/bitnet"
edition = "2024"
homepage = "https://github.com/EffortlessMetrics/BitNet"
keywords = ["machine-learning", "llm", "quantization", "inference", "bitnet"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/EffortlessMetrics/BitNet"
rust-version = "1.92.0"
version = "0.2.1-dev"
[dependencies]
# Core crates - always included
bitnet-common = { path = "crates/bitnet-common", version = "0.2.1-dev" }
bitnet-math = { path = "crates/bitnet-math", version = "0.2.1-dev" }
bitnet-warn-once = { path = "crates/bitnet-warn-once", version = "0.2.1-dev" }
bitnet-atomic-file-core = { path = "crates/bitnet-atomic-file-core", version = "0.2.1-dev" }
bitnet-tokenizer-text-core = { path = "crates/bitnet-tokenizer-text-core", version = "0.2.1-dev" }
bitnet-models = { path = "crates/bitnet-models", version = "0.2.1-dev" }
bitnet-quantization = { path = "crates/bitnet-quantization", version = "0.2.1-dev", default-features = false }
bitnet-quantization-bits = { path = "crates/bitnet-quantization-bits", version = "0.2.1-dev" }
bitnet_ggml_ffi = { package = "bitnet-ggml-ffi", path = "crates/bitnet-ggml-ffi", version = "0.2.1-dev", optional = true }
# Optional crates based on features
bitnet-inference = { path = "crates/bitnet-inference", version = "0.2.1-dev", optional = true }
bitnet-kernels = { path = "crates/bitnet-kernels", version = "0.2.1-dev", optional = true }
bitnet-tokenizers = { path = "crates/bitnet-tokenizers", version = "0.2.1-dev", optional = true }
bitnet-device-probe = { path = "crates/bitnet-device-probe", version = "0.2.1-dev", optional = true }
[build-dependencies]
vergen = { version = "9.0.6", features = ["build", "rustc", "cargo"] }
# Features section moved to line 126
[dev-dependencies]
async-trait = "0.1.89"
bitnet-cpu-activations = { path = "crates/bitnet-cpu-activations", version = "0.2.1-dev" }
bitnet-logits = { path = "crates/bitnet-logits", version = "0.2.1-dev" }
bitnet-tokenizers = { path = "crates/bitnet-tokenizers", version = "0.2.1-dev" }
bitnet-rope = { path = "crates/bitnet-rope", version = "0.2.1-dev" }
bitnet-transformer = { path = "crates/bitnet-transformer", version = "0.2.1-dev" }
bitnet-tests = { path = "tests", version = "0.2.1-dev", package = "bitnet-tests", default-features = false }
candle-core = { version = "0.9.1", default-features = false }
candle-nn = { version = "0.9.1", default-features = false }
criterion = "0.7.0"
ctor = "0.6.1"
env_logger = "0.11.8"
log = "0.4.28"
rand = "0.9.2"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"
tempfile = "3.23.0"
thiserror = "2.0.17"
bitnet-gguf = { path = "crates/bitnet-gguf", version = "0.2.1-dev" }
tokio = { version = "1.48.0", features = ["macros", "rt-multi-thread", "fs", "io-util"] }
toml = "0.9.8"
# API snapshot testing
insta = { version = "1.43.2", features = ["yaml", "json"] }
num_cpus = "1.17.0"
tracing-subscriber = { version = "0.3.20", features = ["fmt", "env-filter"] }
# For test error handling construction
reqwest = { version = "0.12.24", default-features = false }
# Additional dependencies used by root-level tests
anyhow = "1.0.100"
byteorder = "1.5.0"
chrono = { version = "0.4.42", default-features = true, features = ["clock"] }
fastrand = "2.3.0"
filetime = "0.2.26"
futures-util = "0.3.31"
html-escape = "0.2.13"
libc = "0.2.177"
rayon = "1.11.0"
tracing = "0.1.41"
[features]
default = [] # Empty default features - must be explicitly enabled
# Test and development features (off by default)
bench = []
examples = [] # Feature gate for examples
# Forward features to the dev-dependency bitnet-tests
integration-tests = ["bitnet-tests/fixtures", "bitnet-tests/reporting", "bitnet-tests/trend", "bitnet-tests/integration-tests"]
spm = [] # for sentencepiece tokenizer tests
# Core inference features
cpu = ["kernels", "inference", "tokenizers", "bitnet-kernels/cpu", "bitnet-kernels/cpu-optimized", "bitnet-inference/cpu", "bitnet-quantization/cpu"]
cuda = ["gpu"] # Alias for backward compatibility
gpu = ["kernels", "inference", "tokenizers", "bitnet-kernels/gpu", "bitnet-inference/gpu", "bitnet-quantization/gpu"]
rocm = ["kernels", "inference", "tokenizers", "bitnet-kernels/rocm", "bitnet-inference/rocm", "bitnet-quantization/rocm"]
vulkan = ["kernels", "inference", "tokenizers", "bitnet-kernels/vulkan", "bitnet-inference/gpu", "bitnet-quantization/gpu"]
metal = ["kernels", "inference", "tokenizers", "bitnet-common/metal", "bitnet-inference/metal"]
opencl = ["kernels", "inference", "tokenizers", "bitnet-kernels/opencl", "bitnet-inference/opencl", "bitnet-quantization/opencl"]
npu = ["dep:bitnet-device-probe", "bitnet-device-probe/npu"]
# Component features
inference = ["dep:bitnet-inference", "kernels"]
kernels = ["dep:bitnet-kernels"]
tokenizers = ["dep:bitnet-tokenizers"]
# SIMD optimizations
avx2 = ["bitnet-kernels/avx2"]
avx512 = ["bitnet-kernels/avx512"]
neon = ["bitnet-kernels/neon"]
# Language bindings (not included in main crate)
ffi = [] # Handled by bitnet-ffi crate
python = [] # Handled by bitnet-py crate
wasm = [] # Handled by bitnet-wasm crate
# Server and CLI (not included in main crate)
cli = [] # Handled by bitnet-cli crate
server = [] # Handled by bitnet-server crate
full-cli = [] # Full CLI with all subcommands (forwarded to bitnet-cli)
# Quantization features
iq2s-ffi = ["bitnet-models/iq2s-ffi", "dep:bitnet_ggml_ffi"] # Enable IQ2_S quantization via GGML FFI
# Cross-validation features
cpp-ffi = [] # Link tests against BitNet.cpp library
crossval = [] # Enable cross-validation against C++ implementation
trace = ["bitnet-models/trace"] # Enable tensor activation tracing
# Test framework features (forward to bitnet-tests)
ffi-tests = []
fixtures = ["bitnet-tests/fixtures"]
full-framework = ["fixtures", "reporting", "trend", "spm", "integration-tests", "ffi-tests"]
reporting = ["bitnet-tests/reporting"]
trend = ["bitnet-tests/trend"]
# Convenience features
full = ["cpu", "cuda", "metal", "avx2", "avx512", "neon"]
minimal = [] # Only core crates, no inference
[package.metadata.docs.rs]
all-features = true
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
rustdoc-args = ["--cfg", "docsrs", "-Zunstable-options", "--generate-link-to-compiler-builtins"]
targets = ["x86_64-unknown-linux-gnu"]
[[test]]
name = "bdd_wave14"
path = "tests/bdd_wave14.rs"
required-features = ["cpu"]
[[example]]
name = "basic_inference"
required-features = ["cpu", "examples"]
# [[example]]
# name = "gpu_inference"
# required-features = ["gpu", "examples"]
# NOTE: Temporarily disabled - needs API updates
# [[example]]
# name = "streaming_generation"
# required-features = ["cpu", "examples"]
# NOTE: Temporarily disabled - needs API updates
[[example]]
name = "simple_demo"
[[example]]
name = "ffi_threading_demo"
required-features = ["cpu", "ffi"]
[[bench]]
name = "srp_ops"
harness = false
required-features = ["cpu"]
[[bench]]
name = "quantization_ops"
harness = false
[[bench]]
name = "kernel_ops"
harness = false
required-features = ["cpu", "bench"]
[[bench]]
name = "neon_simd"
harness = false
required-features = ["cpu"]
[[bench]]
name = "neon_ops"
harness = false
required-features = ["cpu"]
[[bench]]
name = "slm_inference"
harness = false
required-features = ["cpu"]
[[bench]]
name = "tokenizer_ops"
harness = false
[workspace.dependencies]
bitnet-math = { path = "crates/bitnet-math", version = "0.2.1-dev" }
bitnet-quantization-bits = { path = "crates/bitnet-quantization-bits", version = "0.2.1-dev" }
bitnet-warn-once = { path = "crates/bitnet-warn-once", version = "0.2.1-dev" }
bitnet-thread-config-core = { path = "crates/bitnet-thread-config-core", version = "0.2.1-dev" }
bitnet-atomic-file-core = { path = "crates/bitnet-atomic-file-core", version = "0.2.1-dev" }
# Core dependencies
anyhow = "1.0.100"
log = "0.4.28"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"
serde_yaml = { package = "serde_yaml_ng", version = "0.10.0" }
thiserror = "2.0.17"
toml = "0.9.8"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
# Async runtime
futures = "0.3.31"
tokio = { version = "1.48.0", features = ["full"] }
# Performance and SIMD
bytemuck = { version = "1.24.0", features = ["derive"] }
rayon = "1.11.0"
# Tensor operations
candle-core = { version = "0.9.1", default-features = false }
candle-nn = { version = "0.9.1", default-features = false }
candle-transformers = { version = "0.9.1", default-features = false }
# Serialization formats
memmap2 = "0.9.9"
safetensors = "0.7.0"
# CLI and configuration
clap = { version = "4.5.51", features = ["derive", "env"] }
clap_complete = "4.5.60"
console = "0.16.1"
crossterm = "0.29.0"
dirs = "6.0.0"
humansize = "2.1.3"
humantime = "2.3.0"
indicatif = "0.18.3"
num_cpus = "1.17.0"
sysinfo = "0.37.2"
# Web server
axum = "0.8.7"
tower = "0.5.2"
tower-http = { version = "0.6.6", features = ["cors", "trace"] }
# Monitoring and observability
chrono = { version = "0.4.42", features = ["serde"] }
metrics = "0.24.2"
metrics-prometheus = "0.11.0"
opentelemetry = { version = "0.31.0", default-features = false, features = ["trace", "metrics"] }
opentelemetry-otlp = { version = "0.31.0", default-features = false, features = ["grpc-tonic", "trace", "metrics"] }
opentelemetry-stdout = { version = "0.31.0", default-features = false }
opentelemetry_sdk = { version = "0.31.0", features = ["trace", "metrics", "rt-tokio"] }
prometheus = "0.14.0"
tonic = "0.14.2"
tracing-appender = "0.2.3"
tracing-opentelemetry = "0.32.0"
uuid = { version = "1.18.1", features = ["v4"] }
# FFI and bindings
js-sys = "0.3.82"
pyo3 = { version = "0.27.1", features = ["extension-module"] }
wasm-bindgen = "0.2.105"
web-sys = "0.3.82"
# GPU support
cudarc = "0.17.8"
# Testing and benchmarking
criterion = { version = "0.7.0", features = ["html_reports"] }
proptest = ">=1.9.0, <1.10.0"
insta = { version = "1.43.2", features = ["yaml", "json", "redactions", "filters"] }
tempfile = "3.23.0"
serial_test = "3.2.0"
temp-env = "0.3.6"
tracing-test = "0.2.6"
rand = "0.9.2"
bitnet-test-support = { path = "crates/bitnet-test-support", version = "0.2.1-dev" }
bitnet-test-env = { path = "crates/bitnet-test-env", version = "0.2.1-dev" }
# HTTP client for examples
reqwest = { version = "0.12.24", features = ["json"] }
# Code quality
bindgen = "0.72.1"
cc = "1.2.46"
# Build-time information
vergen = { version = "9.0.6", features = ["build", "rustc", "cargo"] }
[profile.release]
codegen-units = 1 # Single codegen unit for best optimization
lto = "thin" # Faster than "fat", still good optimization
opt-level = 3 # Maximum optimization (default)
panic = "abort" # Smaller binaries, no unwinding
strip = "symbols" # Strip symbols but keep debuginfo
# overflow-checks = false # Already false in release
[profile.bench]
debug = true
# Speed up dev builds for dependencies
[profile.dev.package."*"]
opt-level = 2
# Workspace-level lints for code quality
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
nursery = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
ptr_arg = "deny"
# Workspace-level feature flags for convenience
[workspace.metadata.docs.rs]
all-features = true
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
rustdoc-args = ["--cfg", "docsrs", "-Zunstable-options", "--generate-link-to-compiler-builtins"]
targets = ["x86_64-unknown-linux-gnu"]
[workspace.metadata.release]
pre-release-replacements = [{ file = "README.md", search = "bitnet = \"[a-z0-9\\.-]+\"", replace = "bitnet = \"{{version}}\"" }, { file = "CHANGELOG.md", search = "## \\[Unreleased\\]", replace = "## [Unreleased]\n\n## [{{version}}] - {{date}}" }]
sign-commit = true
sign-tag = true
# Workspace metadata for crates.io publication
# Only build the perf benchmarks when the "bench" feature is explicitly enabled
# [[test]]
# name = "performance_benchmarks"
# path = "tests/performance_benchmarks.rs"
# required-features = ["bench"]
# NOTE: Temporarily disabled - needs API updates
[workspace.metadata.bitnet]
categories = [
"science", # Scientific computing
"algorithms", # Algorithm implementations
"mathematics", # Mathematical operations
"wasm", # WebAssembly support
"api-bindings", # Language bindings
]
keywords = [
"machine-learning", # ML/AI domain
"llm", # Large Language Models
"quantization", # Model quantization
"inference", # Model inference
"bitnet", # BitNet specific
]
msrv = "1.92.0"