Commit 13ed177
committed
Fix validation tolerance: use relative error instead of absolute
The validation was using absolute error tolerance (1e-8) which fails for
large matrix multiplication results (magnitude ~1e4). This caused false
negatives where COSMA computed correct results but failed validation.
Changes:
- Switch from absolute error to relative error for validation
- Use 1e-5 tolerance for float32 (appropriate for single precision)
- Use 1e-8 tolerance for float64 (appropriate for double precision)
- Handle small values near zero with absolute error fallback
This fixes issue #153 where K-split strategy was incorrectly reported
as producing 93.6% errors when actual relative errors were < 1e-6.
Tested with:
- 32x896x896 float32: now passes (was 93.8% false errors)
- 32x10000x896 float32: now passes (was 93.6% false errors)
- 32x32x32 float64: still passes (regression test)1 parent a516444 commit 13ed177
1 file changed
+28
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
340 | 347 | | |
| 348 | + | |
| 349 | + | |
341 | 350 | | |
342 | 351 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
351 | 364 | | |
352 | 365 | | |
| 366 | + | |
| 367 | + | |
353 | 368 | | |
354 | 369 | | |
355 | 370 | | |
| |||
376 | 391 | | |
377 | 392 | | |
378 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
379 | 398 | | |
380 | 399 | | |
0 commit comments