Conversation
| parts.push((piece.len(), Rank::MAX)); | ||
|
|
||
| let get_rank = { | ||
| #[inline(always)] |
There was a problem hiding this comment.
did you see any effect of the inlining here?
I didn't, and even the linter complained, this being a closure inheriting some paramters
There was a problem hiding this comment.
Good question, I dimly remember it being useful in #31 (but it was also used in an additional place then). I can double check :-) Which linter?
There was a problem hiding this comment.
We drop optimisations enabled by ignoring single tokens.
the parts.len() > 3 means that once we're down to 2 tokens, we don't need more iterations, we don't have to try to merge it into a single token since we've already filtered those out - but that won't show up in the benchmarks, since that's basically constant time, so I agree, the code is simpler this way :)
Thanks for adding the comments back, please see my inline comments.
If you can, please add me as a coauthor here.
Thanks!
Co-authored-by: Lőrinc Pap <1841944+paplorinc@users.noreply.github.com>
|
Thank you for the original change and follow-up review! I've marked you as co-author on the commit :-) |
backport of openai#255 Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Lőrinc Pap <1841944+paplorinc@users.noreply.github.com>
Based on suggestion in #239 (specifically 8f5dd7d)
Like that commit, this:
Unlike that commit:
Let me know what you think! Once we figure this one out, we'll look at the linearithmic fix (I have some thoughts there, still doing some benchmarking).
Co-authored-by: @paplorinc