Skip to content

Add support for HYGON DCU #889

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

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

Conversation

south-ocean
Copy link

@south-ocean south-ocean commented Mar 14, 2025

This commit code is submit for KME and BW1000, and we also suppply the Z100 method.

Introduction
Enable ktransformers on HYGON DCU.

Compile ktransformers from sourcecode :

pip3 install fastpt (from das)
bash install_dcu.sh

Limitation

Marlin kernel is not supported on DCU(KME and BW1000) and will be support in future , the yaml change can reference by ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-dcu.yaml to Replace all instances of KLinearMarlin with KLinearTorch.

If you want to use ktransformers on Z100, you should do as follows:

  1. Replace all instances of KLinearMarlin with KLinearTorch
  2. Modify local_chat.py to replace all instances of flash_attention_2 with eager.
  3. change code as pictures:
    image
    image
    image
    image

Validation command:
python3 ./ktransformers/local_chat.py --model_path ./DeepSeek-R1 --gguf_path ./DeepSeek-R1-GGUF/ --cpu_infer 65 --max_new_tokens 1000 --optimize-config-path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-dcu.yaml

Chat: who are you
Greetings! I'm DeepSeek-R1, an artificial intelligence assistant created by DeepSeek. I'm at your service and would be delighted to assist ou with any inquiries or tasks you may have.

@south-ocean south-ocean changed the title Add support HYGON DCU Add support for HYGON DCU Mar 14, 2025
@yeungtuzi
Copy link

How about hygon K100 or K100AI?

@south-ocean
Copy link
Author

How about hygon K100 or K100AI?

It's now available on K100 amd K100AI , and we're in continuous optimization.

@yeungtuzi
Copy link

请辛苦看一下 #984

@yeungtuzi
Copy link

Done. #999

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