-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace basic Numba FSM functions with Rust implementations #7
Conversation
80e19d7
to
c264e71
Compare
FYI: The failure is only due to missing coverage, which could be related to a distinct configuration issue: dottxt-ai/outlines#1105. |
c264e71
to
d3e2354
Compare
Looks good to me, especially the benchmarks vs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you Brandon 👍
As far as I can tell it looks good. Small nits on naming that don't need to be addressed now, but rather when there's a clearer separation between rust crate and bindings.
rust_fsm
--> maybeoutlines-core-rs
_walk_fsm_internal
as to not mix python & rust naming conventions
I didn't find any obvious bugs in the fsm implementation itself, but I'm not as experienced as you either. In other words, good if someone else can double check it.
Note that the tests that were in Outlines all pass with this implementation. |
d3e2354
to
de00a4d
Compare
Done |
de00a4d
to
2dac9e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! and benchmarks look really good. Great job @brandonwillard
not sure if the "Tests / Combine & check coverage. (pull_request)" are important?
Most of this is adapted from our initial internal work by @kc611, which was exclusively focused on obtaining parity with Numba. There are many more big improvements to make, but it does have parity and AOT compilation, so it's a worthy replacement for the code in
It's not a problem; see #7 (comment). |
This PR introduces a simple Rust extension that replaces the index construction code.
We can base our work towards a primarily Rust project (i.e. #4) on these changes, which will allow us to make use of
outlines-core
inoutlines
much sooner and permit parallel work on more code conversion. We should also be able to apply straightforward changes to this setup that make the Python bindings and PyO3 dependencies optional (e.g. for Rust-only use of the underlying crate).