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

Fix ernie ci auto trainer error #9758

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

blacksheep-Aristotle
Copy link
Contributor

@blacksheep-Aristotle blacksheep-Aristotle commented Jan 8, 2025

PR types

Bug fixes

PR changes

Others

Description

修复Ernie ci error bug
允许用户自己控制param_init和使用中层api的时机。

Copy link

paddle-bot bot commented Jan 8, 2025

Thanks for your contribution!

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 3.44828% with 28 lines in your changes missing coverage. Please review.

Project coverage is 52.37%. Comparing base (fb60645) to head (47691b9).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
paddlenlp/trainer/auto_trainer.py 0.00% 26 Missing ⚠️
paddlenlp/transformers/llama/modeling_auto.py 0.00% 1 Missing ⚠️
paddlenlp/transformers/llama/modeling_network.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9758      +/-   ##
===========================================
- Coverage    52.70%   52.37%   -0.33%     
===========================================
  Files          731      727       -4     
  Lines       117313   115146    -2167     
===========================================
- Hits         61827    60306    -1521     
+ Misses       55486    54840     -646     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


auto_dist_degree = {
"tensor_parallel": training_args.tensor_parallel_degree > 1,
"sequence_parallel": sequence_parallel,
Copy link
Contributor

@jeff41404 jeff41404 Jan 9, 2025

Choose a reason for hiding this comment

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

already move sequence_parallel in training_args, so use "sequence_parallel": training_args.sequence_parallel, directly, no need line 110 above?

)
# NOTE(zhangwl):in pipeline mode , param my be initialized before while delte init_func ,but param is still not is_initialized
if not param._is_initialized() and param._init_func is not None:
param.initialize()
Copy link
Contributor

@jeff41404 jeff41404 Jan 9, 2025

Choose a reason for hiding this comment

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

if param._init_func is not None, should use param._init_func() or model. _init_weights(Layer) ?

if (
kwargs.get("args", None) is not None
and kwargs["args"].use_intermediate_api
and not parallelize.has_parallelized_model
Copy link
Contributor

@jeff41404 jeff41404 Jan 9, 2025

Choose a reason for hiding this comment

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

put judgment not parallelize.has_parallelized_model into this branch, the judgment here is to determine whether to use the basic API or the intermediate API

and kwargs["args"].use_intermediate_api
and not parallelize.has_parallelized_model
):
if self.auto_dist_config is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can determine parallelize.has_parallelized_model here, if yes, must have auto_dist_config

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