Skip to content

Commit

Permalink
Remove unnecessary model attribute assignment on 'freqs_cis' (#1766)
Browse files Browse the repository at this point in the history
Summary:
Fixes #1767, more details there.

Upstream PR link meta-llama/llama#349

Pull Request resolved: #1766

Reviewed By: msaroufim

Differential Revision: D47556245

Pulled By: xuzhao9

fbshipit-source-id: 5ad541ff3e38a36b6515b1b7135b3da92109c9f5
  • Loading branch information
BowenBao authored and facebook-github-bot committed Jul 19, 2023
1 parent 411e388 commit e8c1cf0
Showing 1 changed file with 3 additions and 2 deletions.
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)
freqs_cis = freqs_cis[start_pos : start_pos + seqlen]

mask = None

Expand Down

0 comments on commit e8c1cf0

Please sign in to comment.