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

[AutoNLP]optimize log #5021

Merged
merged 8 commits into from
Feb 28, 2023
Merged

[AutoNLP]optimize log #5021

merged 8 commits into from
Feb 28, 2023

Conversation

lugimzzz
Copy link
Contributor

PR types

Function optimization

PR changes

APIs

Description

将所有logger内容放到train.log中

@paddle-bot
Copy link

paddle-bot bot commented Feb 28, 2023

Thanks for your contribution!

@@ -156,25 +156,6 @@ def on_evaluate(self, args, state, control, **kwargs):
if self.tune.is_session_enabled() and metrics is not None and isinstance(metrics, dict):
self.session.report(metrics)

# report session metrics to Ray to track trial progress
def on_epoch_end(self, args, state, control, **kwargs):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

输入并没有metrics

Copy link
Collaborator

Choose a reason for hiding this comment

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

on_epoch_end 应该会返回一些训练方面的东西,例如loss, iter/s之类的训练指标,可以再看看

Copy link
Contributor Author

Choose a reason for hiding this comment

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

看起来trainer.py中on_epoch_end没有传入metrics,所以这个函数无法report任何东西
https://github.com/PaddlePaddle/PaddleNLP/blob/develop/paddlenlp/trainer/trainer.py#L731

Copy link
Collaborator

Choose a reason for hiding this comment

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

不过那些信息没什么用,不要也ok,可以删

Copy link
Collaborator

@sijunhe sijunhe left a comment

Choose a reason for hiding this comment

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

单测只需要merge develop就能解决

Comment on lines +137 to +139
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.setFormatter(logger.format)
logger.logger.addHandler(stdout_handler)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这样子能把所有的log都显示出来吗?如果可以的话,就太好了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

可以,并且可以区分info error warning

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
Collaborator

Choose a reason for hiding this comment

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

再确认以下几个case:

  1. verbosity >0的时候,notebook里有log, 文件里有log
  2. verbosity =0的时候, notebook里没有log, 但是文件里还是有log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

确认没有问题。

@@ -156,25 +156,6 @@ def on_evaluate(self, args, state, control, **kwargs):
if self.tune.is_session_enabled() and metrics is not None and isinstance(metrics, dict):
self.session.report(metrics)

# report session metrics to Ray to track trial progress
def on_epoch_end(self, args, state, control, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

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

on_epoch_end 应该会返回一些训练方面的东西,例如loss, iter/s之类的训练指标,可以再看看

@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Merging #5021 (5091ee1) into develop (00d842b) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #5021      +/-   ##
===========================================
+ Coverage    48.40%   48.41%   +0.01%     
===========================================
  Files          454      454              
  Lines        65390    65383       -7     
===========================================
+ Hits         31649    31654       +5     
+ Misses       33741    33729      -12     
Impacted Files Coverage Δ
paddlenlp/trainer/integrations.py 73.95% <ø> (+5.73%) ⬆️
...addlenlp/experimental/autonlp/auto_trainer_base.py 89.93% <100.00%> (+1.29%) ⬆️
...dlenlp/experimental/autonlp/text_classification.py 96.92% <100.00%> (-0.17%) ⬇️
paddlenlp/taskflow/dialogue.py 73.36% <0.00%> (+0.54%) ⬆️
paddlenlp/utils/downloader.py 65.48% <0.00%> (+0.88%) ⬆️

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

Copy link
Collaborator

@sijunhe sijunhe left a comment

Choose a reason for hiding this comment

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

great work!

@sijunhe sijunhe merged commit 4ae2b03 into PaddlePaddle:develop Feb 28, 2023
@lugimzzz lugimzzz deleted the log branch February 28, 2023 13:03
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