Skip to content

【Performance Optimization】Replace cross_entropy_with_softmax to c_softmax_with_cross_entropy in dynamic auto mode #10471

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

Merged
merged 9 commits into from
Apr 27, 2025

Conversation

Function-Samuel
Copy link
Contributor

Before submitting

  • Lint code. If there are lint issues, please format the code first.
# Install and register `pre-commit` in the project folder
pip install pre-commit && pre-commit install

# Process previous code files separately
pre-commit run --file XXXX.py
  • Add test cases into tests folder. If there are codecov issues, please add tests cases first.

PR types

Performance optimization

PR changes

Others

Description

Replace cross_entropy_with_softmax to c_softmax_with_cross_entropy in dynamic auto mode

Copy link

paddle-bot bot commented Apr 23, 2025

Thanks for your contribution!

Copy link

codecov bot commented Apr 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.67%. Comparing base (e8a19d3) to head (f642968).
⚠️ Report is 141 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #10471   +/-   ##
========================================
  Coverage    48.67%   48.67%           
========================================
  Files          768      768           
  Lines       126915   126915           
========================================
+ Hits         61777    61778    +1     
+ Misses       65138    65137    -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -26,6 +26,7 @@
import paddle
import paddle.distributed as dist
from paddle.distributed import fleet
from paddle import in_dynamic_mode
Copy link
Contributor

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.

Done

import operator
from typing import Literal, TypeAlias
import paddle.distributed as dist

Copy link
Collaborator

Choose a reason for hiding this comment

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

这个文件会长期存在吗,放这个位置合适不? pre-commit好像没过去,应该需要copyright之类的

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@ZHUI ZHUI merged commit 4d35825 into PaddlePaddle:develop Apr 27, 2025
10 of 12 checks passed
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.

3 participants