-
Notifications
You must be signed in to change notification settings - Fork 23
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
Controllable memory allocation #45
Comments
ianh
added a commit
that referenced
this issue
Jan 8, 2025
This lets library users make the tradeoff between memory use and throughput. See #45.
ianh
added a commit
that referenced
this issue
Jan 8, 2025
That works great, besides the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
we use owl on our ESP32 in our firmware zauberzeug/lizard. Occasionally, the ESP32 devices would hang during usage, especially when running long startup scripts.
After some digging, we found the function
owl_default_tokenizer_advance
attempts to allocate 40 KB of RAM for every line processed. On an ESP32, this can quickly lead to problems due to limited memory availability.In our version of owl, we reduced the allocation size from 4096 to 256, which now only consumes 2.5 KB of RAM. For example, in a longer call, we only process up to 24 tokens at a time, which works well with this adjustment.
Do you have an idea for making tokenizer_advance more scalable? One suggestion we had was to introduce a configurable parameter in
owl_tree_options
to allow users to set the token count dynamically, with a default of 4096.Optional Enhancement:
It could be beneficial to introduce a dedicated error state for cases where allocation fails, as the current error provided by owl does not clearly indicate that the issue is related to memory allocation. This would make diagnosing such problems more straightforward and user-friendly.
The text was updated successfully, but these errors were encountered: