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

Add Baichuan2 Support #247

Merged
merged 11 commits into from
Dec 23, 2023
Merged

Add Baichuan2 Support #247

merged 11 commits into from
Dec 23, 2023

Conversation

AoyuQC
Copy link
Contributor

@AoyuQC AoyuQC commented Dec 10, 2023

Add support for baichuan2, issue #50

@casper-hansen
Copy link
Owner

This looks great, thanks for the PR @AoyuQC. Could you run perplexity on FP16 vs INT4 quantized so we can see how much performance is degraded?

python examples/eval.py --model_path <your_model>

@AoyuQC
Copy link
Contributor Author

AoyuQC commented Dec 17, 2023

Hi, @casper-hansen , I have run perplexity test on FP16 vs INT4. The FP16 version is 6.800 while the INT4 version is 6.938. Please check the following image for experiment results.

Screenshot 2023-12-17 at 14 54 51

@casper-hansen
Copy link
Owner

Solid numbers @AoyuQC! And great work :)

I have a few questions:

  1. You have created a BaichuanBlock. It looks a lot like the LlamaLikeBlock. Can we reuse the existing one? (we already reuse it for mistral, yi, qwen, etc.)
  2. Is the modification to calib_data.py necessary to support the model? It seems like the new method makes some new assumptions about the format of custom datasets.

@AoyuQC
Copy link
Contributor Author

AoyuQC commented Dec 22, 2023

Solid numbers @AoyuQC! And great work :)

I have a few questions:

1. You have created a `BaichuanBlock`. It looks a lot like the `LlamaLikeBlock`. Can we reuse the existing one? (we already reuse it for mistral, yi, qwen, etc.)

2. Is the modification to `calib_data.py` necessary to support the model? It seems like the new method makes some new assumptions about the format of custom datasets.

Hi @casper-hansen , I have reused LlamaLikeBlock for baichuan2, please have a look. The reason that I modified calib_data.py is that I want to support the case that people want to use tokenized input for calibration not just raw string input.

@casper-hansen casper-hansen merged commit cef9f11 into casper-hansen:main Dec 23, 2023
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