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

ReadOnlySpan<float> in ISamplingPipeline #538

Merged

Conversation

martindevans
Copy link
Member

@martindevans martindevans commented Feb 25, 2024

  • Modified ISamplingPipeline to accept ReadOnlySpan<float> of logits directly. This moves responsibility to copy the logits into the pipeline.
  • Removed concept of "protected tokens" from base pipeline, since it was introducing a lot of incidental comlpexity and was only used in one place (the default pipeline)
  • Moved Grammar sampling to BaseSamplingPipeline
  • Implemented several new pipelines (greedy, mirostat1, mirostat2)

…s directly. This moves responsibility to copy the logits into the pipeline.

 - Added a flag to `BaseSamplingPipeline` indicating if a logit copy is necessary. Skipping it in most cases.
…ly token)

 - Moved `Grammar` into `BaseSamplingPipeline`
 - Removed "protected tokens" concept from `BaseSamplingPipeline`. Was introducing a lot of incidental complexity.
 - Implemented newline logit save/restore in `DefaultSamplingPipeline` (only place protected tokens was used)
@martindevans martindevans merged commit 91a7967 into SciSharp:master Feb 25, 2024
3 checks passed
@martindevans martindevans deleted the sampling_pipeline_readonly_span branch February 25, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant