Skip to content

Conversation

martindevans
Copy link
Member

Reduced the number of allocations required for sampling, by allowing passing in a temporary blob of memory to work in.

  • Using this new method in LLamaContext and BaseSamplingPipeline.
  • Using Guidance method in guidance example, instead of low level one working directly on logits.
  • Fixed Guidance method passing incorrectly sized span.

…g passing in a temporary blob of memory to work in. Using this new method in `LLamaContext` and `BaseSamplingPipeline`.

 - Using `Guidance` method in guidance example, instead of low level one working directly on logits.
 - Fixed `Guidance` method passing incorrectly sized span.
@martindevans martindevans requested a review from SanftMonster May 12, 2024 19:03
@martindevans
Copy link
Member Author

@Lyrcaxis I'd appreciate your review on this since you've been looking at sampling things recently.

Copy link
Collaborator

@SanftMonster SanftMonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall looks good except two concerns. It seems that this PR will obviously improve the performance, which is inspiring!

@martindevans martindevans requested a review from SanftMonster May 12, 2024 20:20
Copy link
Contributor

@Lyrcaxis Lyrcaxis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@martindevans martindevans merged commit 4657e98 into SciSharp:master May 14, 2024
@martindevans martindevans deleted the less_sampler_allocations branch May 14, 2024 22:25
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.

3 participants