Skip to content
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

Update logits array in-place #859

Open
brandonwillard opened this issue May 2, 2024 · 0 comments
Open

Update logits array in-place #859

brandonwillard opened this issue May 2, 2024 · 0 comments
Labels
enhancement help wanted optimization Related to performance optimizations structured generation Linked to structured generation

Comments

@brandonwillard
Copy link
Contributor

brandonwillard commented May 2, 2024

What behavior of the library made you think about the improvement?

The current structured generation code is creating a -inf copy of the logits array and setting the allowed token ID indices to the corresponding values in the original logits array. See here.

How would you like it to behave?

When possible, the original logits array should be updated in-place and completely avoid creating a new array. This change would likely require the set of disallowed token IDs instead of the allowed ones.

@brandonwillard brandonwillard added enhancement optimization Related to performance optimizations structured generation Linked to structured generation help wanted labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted optimization Related to performance optimizations structured generation Linked to structured generation
Projects
None yet
Development

No branches or pull requests

1 participant