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

Deprecate InferenceParams sampler configuration properties #871

Merged

Conversation

martindevans
Copy link
Member

  • Marked all properties for configuring sampling in IInferenceParams as obsolete, pushing to the newer SamplingPipeline system.
  • Removed old sampling code from LLamaContext, instead if no SamplingPipeline is supplied one is created (existing one is re-used, as much as possible).
  • Updated all examples to use new system.
  • Added AsSpan to FixedSizeQueue to avoid allocations of temporary arrays for every token!

The new sampling pipeline system was added a long time ago to address the issues with IInferenceParams. Configuring everything with one config object doesn't allow for re-ordering of sampling steps, doesn't allow custom samplers, and allows property combinations which are meaningless. For example using Mirostat sampling ignores almost every other property!

See the modified example files to see how the new system is used. In most cases it will simply involve passing a DefaultSamplingPipeline object.

…` as obsolete, pushing users towards the newer `SamplingPipeline` system.

 - Removed old sampling code from `LLamaContext`, instead if no `SamplingPipeline` is supplied one is created (existing one is re-used, as much as possible).
 - Updated all examples to use new system, uncovered a bug in `TalkToYourself` which tried to use `Temperature` _and_ mirostate - not compatible! This is exactly the kind of bug this is trying to fix.
 - Added `AsSpan` to `FixedSizeQueue` to avoid allocations of temporary arrays for every token!
@martindevans martindevans merged commit 955404f into SciSharp:master Jul 31, 2024
6 checks passed
@martindevans martindevans deleted the deprecate_old_inference_params branch July 31, 2024 14:44
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