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

Minicpm enabling #1342

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

pi314ever
Copy link
Contributor

What does this PR do?

Enables MiniCPM3 model for Causal LM. Follows #1133 in optimizing remote code. The following changes were added:

  • htcore.mark_step() between each decoder layer to reduce graph size
  • Add token_idx support passthrough to Attention implementations. (Currently incomplete, missing reset of cache)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@pi314ever
Copy link
Contributor Author

pi314ever commented Sep 20, 2024

Performance benchmark
Command:

python run_generation.py --model_name_or_path openbmb/MiniCPM3-4B  --max_new_tokens 512 --prompt "推荐5个北京的景点。" --batch_size 1 --temperature 0.7 --do_sample --top_p 0.7 --use_kv_cache --use_chat_template --use_hpu_graphs [--bf16] 
throughput (tokens/s) A100 Gaudi 2 (Graph mode)
BF 16 20.09 65.16
FP 32 23.89 44.46

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.

1 participant