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

BatchedExecutor Fixed Forking #621

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

martindevans
Copy link
Member

Previously when a conversation was forked this would result in both the parent and the child sharing exactly the same logits.

Since sampling is allowed to modify logits this could lead to issues in sampling. For example the first conversation samplied modifies the logits to apply a logit bias, the second conversation sampled will implicitly have the same bias!

Fixed this by setting a "forked" flag, logits are copied if this flag is set. Flag is cleared next time the conversation is prompted so this extra copying only happens once after a fork occurs.

…he parent and the child sharing exactly the same logits. Since sampling is allowed to modify logits this could lead to issues in sampling (e.g. one conversation is sampled and overwrites logits to be all zero, second conversation is sampled and generates nonsense).

Fixed this by setting a "forked" flag, logits are copied if this flag is set. Flag is cleared next time the conversation is prompted so this extra copying only happens once after a fork occurs.
…y own any unmanaged resources so it is not necessary.
@martindevans martindevans merged commit 268f3a6 into SciSharp:master Mar 20, 2024
3 checks passed
@martindevans martindevans deleted the batch_fixed_forking branch March 20, 2024 16:36
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