Commit 0f53ca5
authored
Add comprehensive logging system and exception disabling support (#1080)
* Add comprehensive logging system and exception disabling support
Enhances MatX's observability and error handling
capabilities by adding extensive logging throughout the codebase and providing
an option to disable exceptions.
Logging enhancements:
- Added TRACE-level logging to all operator and generator constructors
- Log operator name via str() method and relevant constructor parameters
- Consolidated log.h include in base_operator.h to reduce duplication
- Added DEBUG-level logging for cache operations
- Log cache hits and misses in LookupAndExec with cache ID, device, and thread
- Log transform-specific cache attempts with descriptive names (FFT, MatMul,
SVD, QR, LU, Eigenvalue, Inverse, CUB, Einsum, Solve, Sparse conversions,
Filter, Covariance)
- Added DEBUG-level logging for kernel launches
- Log kernel parameters in CUDA executor
- Added DEBUG-level logging for memory operations
- Log all tensor allocations and deallocations with pointer and size info
- Log all make_tensor() calls with signature, shape, pointer, and memory kind
- Converted all printf/fprintf calls in error.h to use MatX logger
- Error messages now use MATX_LOG_ERROR/MATX_LOG_FATAL consistently
- Changed default log level from OFF to ERROR
- Ensures error messages are visible by default
- Users can override via MATX_LOG_LEVEL environment variable
Exception handling improvements:
- Added MATX_DISABLE_EXCEPTIONS CMake option
- When enabled, MATX_THROW logs fatal error and calls abort() instead of throwing
- Provides exception-free operation for environments that don't support them
- All error handling macros automatically adapt to exception-disabled mode
- Fixed macro parameter naming to avoid preprocessor conflicts
These changes enable detailed runtime diagnostics for debugging performance
issues, cache behavior, and memory usage while maintaining zero overhead when
logging is disabled.
* fix format1 parent 758d3e8 commit 0f53ca5
File tree
143 files changed
+606
-110
lines changed- docs_input
- examples
- include/matx
- core
- executors
- generators
- operators
- transforms
- chol
- convert
- eig
- fft
- lu
- matmul
- qr
- solve
- svd
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
143 files changed
+606
-110
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
209 | 213 | | |
210 | 214 | | |
211 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
163 | 162 | | |
164 | 163 | | |
165 | 164 | | |
| |||
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
174 | | - | |
175 | | - | |
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
125 | 129 | | |
126 | 130 | | |
127 | 131 | | |
| |||
187 | 191 | | |
188 | 192 | | |
189 | 193 | | |
| 194 | + | |
| 195 | + | |
190 | 196 | | |
191 | 197 | | |
192 | 198 | | |
| |||
214 | 220 | | |
215 | 221 | | |
216 | 222 | | |
| 223 | + | |
| 224 | + | |
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
| 202 | + | |
| 203 | + | |
200 | 204 | | |
201 | 205 | | |
202 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
153 | 171 | | |
154 | 172 | | |
155 | 173 | | |
| |||
158 | 176 | | |
159 | 177 | | |
160 | 178 | | |
161 | | - | |
162 | | - | |
| 179 | + | |
| 180 | + | |
163 | 181 | | |
164 | 182 | | |
165 | 183 | | |
| |||
168 | 186 | | |
169 | 187 | | |
170 | 188 | | |
| 189 | + | |
| 190 | + | |
171 | 191 | | |
172 | 192 | | |
173 | 193 | | |
| |||
190 | 210 | | |
191 | 211 | | |
192 | 212 | | |
193 | | - | |
| 213 | + | |
194 | 214 | | |
195 | 215 | | |
196 | 216 | | |
| |||
217 | 237 | | |
218 | 238 | | |
219 | 239 | | |
220 | | - | |
| 240 | + | |
221 | 241 | | |
222 | 242 | | |
223 | 243 | | |
| |||
239 | 259 | | |
240 | 260 | | |
241 | 261 | | |
242 | | - | |
| 262 | + | |
243 | 263 | | |
244 | | - | |
| 264 | + | |
245 | 265 | | |
246 | | - | |
| 266 | + | |
247 | 267 | | |
248 | 268 | | |
249 | | - | |
| 269 | + | |
250 | 270 | | |
251 | | - | |
| 271 | + | |
252 | 272 | | |
253 | | - | |
| 273 | + | |
254 | 274 | | |
255 | 275 | | |
256 | | - | |
| 276 | + | |
| 277 | + | |
257 | 278 | | |
258 | 279 | | |
259 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 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 | + | |
49 | 126 | | |
50 | 127 | | |
51 | 128 | | |
| |||
139 | 216 | | |
140 | 217 | | |
141 | 218 | | |
142 | | - | |
| 219 | + | |
143 | 220 | | |
144 | 221 | | |
145 | 222 | | |
| |||
0 commit comments