-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
Thanks for your contribution! |
Codecov Report
@@ Coverage Diff @@
## develop #4398 +/- ##
========================================
Coverage 41.76% 41.76%
========================================
Files 434 434
Lines 61872 61872
========================================
+ Hits 25840 25841 +1
+ Misses 36032 36031 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…nto add-gpt-testing
…nto add-gpt-testing
tests/model_zoo/test_gpt.py
Outdated
# 1. run pretrain | ||
argv, config = load_argv(self.config_path, "pretrain", return_dict=True) | ||
device = config["device"] | ||
sys.argv = argv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看能不能改成with之类的写法。这个是全局的,可能造成一些奇怪的问题。
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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 !
tests/model_zoo/test_gpt.py
Outdated
# 1. run pretrain | ||
argv, config = load_argv(self.config_path, "pretrain", return_dict=True) | ||
device = config["device"] | ||
sys.argv = argv |
There was a problem hiding this comment.
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()
tests/fixtures/model_zoo/gpt.yaml
Outdated
@@ -0,0 +1,99 @@ | |||
pretrain: | |||
tiny: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny: | |
slow: |
Co-authored-by: Zhong Hui <zhonghui.net@gmail.com>
scripts/regression/ci_case.sh
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接删除吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我先把gpt 的函数体代码给删掉,这里留一个 todo 让军军去删除其他关联的脚本(免得没删干净导致一些运行时的 bug)
这里还没添加:在 pytest 中进行多卡测试的示例代码,此模块将会在另外一个 pr 中完成。 |
* 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
PR types
New features
PR changes
Models
Description
Model Zoo GPT 单测样板间