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

[Generation, Question] Why does the seed have to be the same in different processors (Llama.build)? #1114

Open
keli-wen opened this issue Apr 26, 2024 · 0 comments

Comments

@keli-wen
Copy link

✨ First of all, the Llama project is a tremendous asset to the entire GenAI field. I deeply appreciate the contributions of both the Llama team and the open-source community.

Description

I've recently been delving into the source code of the Llama project and I happen to have a question. Specifically, why seed must be the same in all processes.

This line of code is located in the Llama.build function at: https://github.com/meta-llama/llama/blob/main/llama/generation.py#L94-L95.

Regarding this code, there are only two versions of changes:

However, I have a question: why must the seed be equal? What would happen if they are not equal? I tried searching for "why must random seeds be equal in model parallelism?", but I couldn't find any relevant information.

From an engineering perspective, I think it might be related to reproducibility? But I want to know if having different random seeds for each processor would result in a catastrophic outcome? (Because the current comment makes it seem like a very serious issue)

The current docstring lacks an explanation for seed and fails in the ruff linter. (I believe the lack of comments is also one of the reasons contributing to the confusion.)

I really hope to receive help from Meta or anyone else. I would also be happy to provide the correct docstring for seed after resolving this issue to eliminate any potential confusion.

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

No branches or pull requests

1 participant