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

Allow setting the rng seed after initialization. #1184

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Allow setting the rng seed after initialization. #1184

merged 1 commit into from
Apr 26, 2023

Conversation

asgeir
Copy link
Contributor

@asgeir asgeir commented Apr 25, 2023

The llama_set_state_data function restores the rng state to what it was at the time llama_copy_state_data was called. But users may want to restore the state and proceed with a different seed.

The llama_set_state_data function restores the rng state to what it
was at the time llama_copy_state_data was called. But users may want
to restore the state and proceed with a different seed.
@Green-Sky
Copy link
Collaborator

should it not be "reset", since it resets the state of the rng engine?

@asgeir
Copy link
Contributor Author

asgeir commented Apr 26, 2023

should it not be "reset", since it resets the state of the rng engine?

I think the name isn't the most important thing. It could equally be initialize, reinitialize, whatever.

As an example. This is from the rand manpage:

The srand() function sets its argument seed as the seed for a new sequence of pseudo-random numbers to be returned by rand().

@slaren
Copy link
Member

slaren commented Apr 26, 2023

I think this is fine, but since it is a change to the API, @ggerganov should approve it.

@Green-Sky
Copy link
Collaborator

what @slaren said.

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.

4 participants