-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'PaddlePaddle:develop' into LoRA-GA
- Loading branch information
Showing
38 changed files
with
1,740 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# PaddleNLP 自定义 OP | ||
|
||
此文档介绍如何编译安装 PaddleNLP SDAA 自定义 OP。 | ||
|
||
# 1. 安装 PaddleCustomDevice | ||
|
||
参考 [PaddleCustomDevice SDAA 安装文档](https://github.com/PaddlePaddle/PaddleCustomDevice/blob/develop/backends/sdaa/README_cn.md) 进行安装 | ||
|
||
|
||
# 2. 安装 paddlenlp_ops | ||
```shell | ||
python setup_sdaa.py build bdist_wheel | ||
|
||
pip install dist/paddlenlp_ops*.whl | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from paddle_sdaa.sdaa_ext import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
|
||
from setuptools import Distribution, setup | ||
|
||
packages = [] | ||
package_data = {} | ||
|
||
|
||
class BinaryDistribution(Distribution): | ||
def has_ext_modules(self): | ||
return True | ||
|
||
|
||
def main(): | ||
setup( | ||
name="paddlenlp_ops", | ||
version="0.0.0", | ||
description="PaddleNLP SDAA CustomOps", | ||
long_description="", | ||
long_description_content_type="text/markdown", | ||
author_email="Paddle-better@baidu.com", | ||
maintainer="PaddlePaddle", | ||
maintainer_email="Paddle-better@baidu.com", | ||
project_urls={}, | ||
license="Apache Software License", | ||
packages=[ | ||
"paddlenlp_ops", | ||
], | ||
include_package_data=True, | ||
package_data={ | ||
"": ["*.py"], | ||
}, | ||
package_dir={ | ||
"": "python", | ||
}, | ||
zip_safe=False, | ||
distclass=BinaryDistribution, | ||
entry_points={"console_scripts": []}, | ||
classifiers=[], | ||
keywords="PaddleNLP SDAA CustomOps", | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../llm/sdaa/llama/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"model_name_or_path": "Qwen/Qwen2-0.5B", | ||
"dataset_name_or_path": "./dureader_data", | ||
"output_dir": "./checkpoints/sft_ckpts", | ||
"per_device_train_batch_size": 1, | ||
"gradient_accumulation_steps": 4, | ||
"per_device_eval_batch_size": 1, | ||
"eval_accumulation_steps": 1, | ||
"max_steps": 2000, | ||
"learning_rate": 3e-5, | ||
"warmup_steps": 30, | ||
"logging_steps": 1, | ||
"evaluation_strategy": "no", | ||
"save_strategy": "epoch", | ||
"max_query_len": 512, | ||
"max_passage_len": 512, | ||
"group_size": 4, | ||
"bf16": true, | ||
"fp16_opt_level": "O2", | ||
"do_train": true, | ||
"do_eval": false, | ||
"disable_tqdm": true, | ||
"load_best_model_at_end": false, | ||
"eval_with_do_generation": false, | ||
"metric_for_best_model": "accuracy", | ||
"recompute": true, | ||
"save_total_limit": 1, | ||
"tensor_parallel_degree": 1, | ||
"pipeline_parallel_degree": 1, | ||
"sharding": "stage1", | ||
"zero_padding": false, | ||
"unified_checkpoint": true, | ||
"use_flash_attention": true, | ||
"amp_custom_black_list": "elementwise_div", | ||
"release_grads": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.