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
//! boostr error types
use numr::dtype::DType;
/// boostr result type
pub type Result<T> = std::result::Result<T, Error>;
/// boostr errors
#[derive(Debug, thiserror::Error)]
pub enum Error {
/// Error from numr operations
#[error("numr error: {0}")]
Numr(#[from] numr::error::Error),
/// Unsupported quantization format
#[error("unsupported quantization format: {format}")]
UnsupportedQuantFormat {
/// The format name
format: String,
},
/// Quantization error
#[error("quantization error: {reason}")]
QuantError {
/// Description of what went wrong
reason: String,
},
/// Model loading error
#[error("model error: {reason}")]
ModelError {
/// Description of what went wrong
reason: String,
},
/// DType mismatch for quantized operations
#[error("dtype mismatch: expected {expected}, got {got}")]
DTypeMismatch {
/// Expected dtype
expected: DType,
/// Actual dtype
got: DType,
},
/// Invalid argument to an operation
#[error("invalid argument '{arg}': {reason}")]
InvalidArgument {
/// Argument name
arg: &'static str,
/// Why it's invalid
reason: String,
},
/// Inference infrastructure error
#[error("inference error: {reason}")]
InferenceError {
/// Description of what went wrong
reason: String,
},
/// Scheduler error
#[error("scheduler error: {reason}")]
SchedulerError {
/// Description of what went wrong
reason: String,
},
/// Training/optimizer error
#[error("training error: {reason}")]
TrainingError {
/// Description of what went wrong
reason: String,
},
/// Distributed communication error
#[error("distributed error: {reason}")]
DistributedError {
/// Description of what went wrong
reason: String,
},
/// CUDA kernel error
#[error("kernel error: {reason}")]
KernelError {
/// Description of what went wrong
reason: String,
},
/// Data loading / IO error
#[error("data error: {reason}")]
DataError {
/// Description of what went wrong
reason: String,
},
/// IO error
#[error("io error: {0}")]
Io(#[from] std::io::Error),
}