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

[New features] testing example of model zoo #4398

Merged
merged 23 commits into from
Jan 31, 2023

Conversation

wj-Mcat
Copy link
Contributor

@wj-Mcat wj-Mcat commented Jan 10, 2023

PR types

New features

PR changes

Models

Description

Model Zoo GPT 单测样板间

@paddle-bot
Copy link

paddle-bot bot commented Jan 10, 2023

Thanks for your contribution!

@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #4398 (6862118) into develop (79d9a37) will increase coverage by 0.00%.
The diff coverage is n/a.

❗ Current head 6862118 differs from pull request most recent head 5a4faa5. Consider uploading reports for the commit 5a4faa5 to get more accurate results

@@           Coverage Diff            @@
##           develop    #4398   +/-   ##
========================================
  Coverage    41.76%   41.76%           
========================================
  Files          434      434           
  Lines        61872    61872           
========================================
+ Hits         25840    25841    +1     
+ Misses       36032    36031    -1     
Impacted Files Coverage Δ
paddlenlp/utils/downloader.py 59.01% <0.00%> (+0.40%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

# 1. run pretrain
argv, config = load_argv(self.config_path, "pretrain", return_dict=True)
device = config["device"]
sys.argv = argv
Copy link
Collaborator

Choose a reason for hiding this comment

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

看能不能改成with之类的写法。这个是全局的,可能造成一些奇怪的问题。

Copy link
Collaborator

Choose a reason for hiding this comment

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

pretrain_config = load_config(self.config_path, "pretrain")
with test_argv_guard(pretrain_config):
    from run_pretrain import do_train
    do_train()

if os.getenv("RUN_SLOW_TEST", None):
sub_key = "default"

config = config[sub_key]
Copy link
Collaborator

Choose a reason for hiding this comment

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

assert key must be in yaml file !

# 1. run pretrain
argv, config = load_argv(self.config_path, "pretrain", return_dict=True)
device = config["device"]
sys.argv = argv
Copy link
Collaborator

Choose a reason for hiding this comment

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

pretrain_config = load_config(self.config_path, "pretrain")
with test_argv_guard(pretrain_config):
    from run_pretrain import do_train
    do_train()

@@ -0,0 +1,99 @@
pretrain:
tiny:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
tiny:
slow:

@wj-Mcat wj-Mcat marked this pull request as ready for review January 31, 2023 01:12
tests/model_zoo/test_gpt.py Outdated Show resolved Hide resolved
ZHUI
ZHUI previously approved these changes Jan 31, 2023
Co-authored-by: Zhong Hui <zhonghui.net@gmail.com>
python gpt_sample.py >${log_path}/fast_generation_gpt >>${log_path}/fast_generation_gpt 2>&1
print_info $? fast_generation_gpt
echo 'skip gpt testing in paddle-ci, for details you can see: https://github.com/PaddlePaddle/PaddleNLP/pull/4398'
# if [ ! -f 'test.py' ];then
Copy link
Collaborator

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.

我先把gpt 的函数体代码给删掉,这里留一个 todo 让军军去删除其他关联的脚本(免得没删干净导致一些运行时的 bug)

@wj-Mcat
Copy link
Contributor Author

wj-Mcat commented Jan 31, 2023

这里还没添加:在 pytest 中进行多卡测试的示例代码,此模块将会在另外一个 pr 中完成。

@wj-Mcat wj-Mcat merged commit 29bf84c into PaddlePaddle:develop Jan 31, 2023
@wj-Mcat wj-Mcat deleted the add-gpt-testing branch January 31, 2023 02:31
Yam0214 added a commit to Yam0214/PaddleNLP that referenced this pull request Jan 31, 2023
joey12300 pushed a commit that referenced this pull request Feb 20, 2023
* update model_zoo/ernie-m

* add logging eval infomations

* delete unused testing code

* add tests samples for xnli

* fewer tests samples for xnli

* add predict and export

* add predictor and serving

* fix export error when training with data parallelism

* fix mkdir error in distributed training and use ERNIEMHandler

* adjust predictor

* modify ci accroding to #4398 and adjust predictor

* enable load tiny dataset for ci

* support testing infer with precision_mode fp16

* modify ci script

* Update ci_case.sh

* enable to test inputs_embeds for enire-m

* fix ci script

* fix using fast tokenizer

* using set_optimizer_grouped_parameters instead

* consturct optimizer with layerwise_lr_decay out of Trainer
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.

None yet

2 participants