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

RWKV split CPU & GPU results in high perplexity #23368

Closed
2 of 4 tasks
3outeille opened this issue May 15, 2023 · 4 comments
Closed
2 of 4 tasks

RWKV split CPU & GPU results in high perplexity #23368

3outeille opened this issue May 15, 2023 · 4 comments
Assignees

Comments

@3outeille
Copy link
Member

3outeille commented May 15, 2023

System Info

Using #22797 (comment) PR, I tried to evaluate perplexity on wikitext2 using HuggingFace RWKV but found a weird behavior (gist to reproduce the bug: https://gist.github.com/3outeille/e74ec833ec2800a94325f8dad8e0da3d).

  • When model is fully loaded on CPU or GPU, perlexity is fine
  • When some block of RWKV are loaded in CPU and GPU, perplexity is high

Any idea ?

Who can help?

@sgugger, @younesbelkada

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

https://gist.github.com/3outeille/e74ec833ec2800a94325f8dad8e0da3d

Expected behavior

  • Full CPU ✔️ :
    • nlls: tensor([2.0129, 2.3220, 2.3500])
    • Perplexity: 9.284077644348145
  • Full GPU ✔️ :
    • nlls: tensor([2.0137, 2.3223, 2.3496], device='cuda:0', dtype=torch.float16)
    • Perplexity: 9.2890625
  • Split 🔴 :
    • nlls: tensor([15.6641, 15.9141, 16.5469], device='cuda:0', dtype=torch.float16)
    • Perplexity: 9312564.0
@3outeille 3outeille changed the title RWKV split CPU & GPU provides high perplexity RWKV split CPU & GPU results in high perplexity May 15, 2023
@younesbelkada younesbelkada self-assigned this May 15, 2023
@3outeille
Copy link
Member Author

3outeille commented May 23, 2023

@younesbelkada Any update ?

@huggingface huggingface deleted a comment from github-actions bot Jun 26, 2023
@younesbelkada younesbelkada reopened this Jun 26, 2023
@younesbelkada
Copy link
Contributor

Hi @3outeille
Sadly I didn't had time to check that out, are you still facing the issue with the latest main branch of transformers & accelerate?

@3outeille
Copy link
Member Author

Hi @younesbelkada, I update transformers & accelerate to the latest release version as shown here: https://github.com/3outeille/hf_rwkv_bug/blob/master/requirements.txt and the bug is still here

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

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

2 participants