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

support deepseek on xpu #10060

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

support deepseek on xpu #10060

wants to merge 3 commits into from

Conversation

yulangz
Copy link
Contributor

@yulangz yulangz commented Mar 10, 2025

Before submitting

  • Lint code. If there are lint issues, please format the code first.
# Install and register `pre-commit` in the project folder
pip install pre-commit && pre-commit install

# Process previous code files separately
pre-commit run --file XXXX.py
  • Add test cases into tests folder. If there are codecov issues, please add tests cases first.

PR types

New features

PR changes

Models | APIs

Description

Support deepseek on Kunlun XPU inference.
Support dynamic and static graphics.
Now, only MOE-ONLYINT8 quantization is supported (only MOE weights are quantized to int8, other weights are not quantized).

Copy link

paddle-bot bot commented Mar 10, 2025

Thanks for your contribution!

Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 0% with 171 lines in your changes missing coverage. Please review.

Project coverage is 50.15%. Comparing base (1db27cd) to head (5a9fc9c).
Report is 46 commits behind head on develop.

Files with missing lines Patch % Lines
...erimental/transformers/fused_transformer_layers.py 0.00% 101 Missing ⚠️
.../experimental/transformers/deepseek_v2/modeling.py 0.00% 68 Missing ⚠️
paddlenlp/experimental/transformers/proposers.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #10060      +/-   ##
===========================================
- Coverage    50.39%   50.15%   -0.24%     
===========================================
  Files          756      757       +1     
  Lines       121658   122553     +895     
===========================================
+ Hits         61304    61469     +165     
- Misses       60354    61084     +730     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# export XDNN_PATH=Paddle/build/third_party/xpu/src/extern_xpu/xdnn-ubuntu_x86_64/ # <path_to_xdnn>
# export XRE_PATH=Paddle/build/third_party/xpu/src/extern_xpu/xre-ubuntu_x86_64/ # <path_to_xre>
# export CLANG_PATH=xtdk-ubuntu_1604_x86_64 # <path_to_xtdk>
# export HOST_SYSROOT=/opt/compiler/gcc-8.2/bin/gcc # <path_to_gcc>

export XDNN_PATH=/opt/output/work_dir/paddle-deepseek/xpu_libs/xhpc/xdnn

Choose a reason for hiding this comment

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

为啥用一些和模型类型相关的hardcode路径?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

const std::vector<int64_t>& seq_len_shape,
const std::vector<int64_t>& draft_tokens_shape,
const std::vector<int64_t>& seq_lens_encoder_shape) {
// std::cout << "wht --- GetPaddingOffsetV2InferShape" << std::endl;

Choose a reason for hiding this comment

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

是不是可以去掉这些已经注释的调试代码?下同。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

prefix_lens_vp, // prefix_lens_vp
encoder_kv_lods_vp); // encoder_kv_lods_vp

// encoder 关键信息打印

Choose a reason for hiding this comment

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

去掉已经注释了的调试代码

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

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.

2 participants