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

[llama] Remove unnecessary model attribute assignment on 'freqs_cis' #1766

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions torchbenchmark/models/llama/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ def forward(self, tokens: torch.Tensor, start_pos: int):

h = self.tok_embeddings(tokens)

self.freqs_cis = self.freqs_cis.to(h.device)
freqs_cis = self.freqs_cis[start_pos : start_pos + seqlen]
# Reference: https://github.com/facebookresearch/llama/pull/349
freqs_cis = self.freqs_cis.to(h.device)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a reference to meta-llama/llama#349 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

BowenBao marked this conversation as resolved.
Show resolved Hide resolved
freqs_cis = freqs_cis[start_pos : start_pos + seqlen]

mask = None

Expand Down