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

[Enh] Refactor sum aggregator #834

Merged

Conversation

HydrogenSulfate
Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate commented Apr 6, 2024

PR types

Function optimization

PR changes

APIs

Describe

  1. 添加mtl.Sum类,并将默认总loss计算逻辑移动至该类中,简化train.py的代码;
  2. 完善mtl下部分类的类型注解;
  3. Solver添加对LBFGS优化器、mtl部分类与自动混合精度之间的兼容性检查;
  4. timedomain.py内的string类型改为str
  5. dist_wrapper补充对symbolic module转换后的含参函数模型进行包装;
  6. load_pretrain函数支持自动下载*.pdeqn文件,如viv案例无需再手动下载文件。

Copy link

paddle-bot bot commented Apr 6, 2024

Thanks for your contribution!

@HydrogenSulfate HydrogenSulfate changed the title Refactor sum agg [Enh] Refactor sum agg Apr 6, 2024
@HydrogenSulfate HydrogenSulfate changed the title [Enh] Refactor sum agg [Refine] Refactor sum agg Apr 7, 2024
@HydrogenSulfate HydrogenSulfate changed the title [Refine] Refactor sum agg [Enh] Refactor sum aggregator Apr 7, 2024
Copy link
Collaborator

@zhiminzhang0830 zhiminzhang0830 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiminzhang0830 zhiminzhang0830 merged commit 25bb1bd into PaddlePaddle:develop Apr 7, 2024
3 of 4 checks passed
@HydrogenSulfate HydrogenSulfate deleted the refactor_sum_agg branch April 12, 2024 16:07
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
* add Sum loss aggregator

* simplify loss aggregation code in train.py and add check for AGDA and PCGrad when used with amp

* add check for using L-BFGS with use_amp=True

* Refine Relobralo

* Fix docstring of timedomain.py

* remove unnecessary code in train.py

* automatically download *.pdeqn file if available when download pretrained model

* wrap func generated by symbolic module with DDP

* fix Relobralo

* initialize loss with 0.0 instead of first loss
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