Repository navigation
Fix sparse duplicates and quantized CPU split boundaries - #39
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compiled CPU inference can return different predictions for equivalent sparse matrices, or after enabling
quantize=1. For example, a CSR coordinate stored as0.4 + 0.4follows the wrong branch at a0.5split, and quantization changes one prediction in a 128-tree regression fixture by up to0.08035.This fixes both cases while retaining float32 inference and threshold quantization. Follow-up to #37.
x <= tcomparison as the equivalent float32 comparisonx < nextafter(t, +inf). Apply this at compile time so existing Treelite 4 checkpoints also benefit; keep the original model and compiler parameter dictionary unchanged.Validation:
0.08035to3.8e-6, matching ordinary compilation. An additional probe of 64 affected float32 thresholds across signs and exponents passes for equality, neighboring values, NaNs, and infinities.uv pip check, andgit diff --checkpass. Local Windows execution is not available; the existing CI matrix covers GCC and MSVC.