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

Polish multi-thread schedule strategy and Keep one task in current thread #35928

Merged
merged 6 commits into from
Sep 27, 2021

Conversation

Aurelius84
Copy link
Contributor

@Aurelius84 Aurelius84 commented Sep 22, 2021

PR types

Others

PR changes

Others

Describe

Polish multi-thread schedule strategy and Keep one task in current thread

image

针对 PTB 中的问题,优化了AddTask的策略,减少线程休眠唤醒的次数

  • 对于GPU Async op,执行完当前op后,直接在当前线程中执行后续所有Async op(省去AddTask,入队出队开销)
  • 对于CPU Sync op,执行完当前op后,保留一个后续Sync op继续执行,将剩余后续Op AddTask到线程池
  • 在PTB 上测试,性能稳定在24.5s左右(连续测试结果:24.42、24.44、24.94、24.62)

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@Aurelius84 Aurelius84 merged commit 0e5d81c into PaddlePaddle:develop Sep 27, 2021
AnnaTrainingG pushed a commit to AnnaTrainingG/Paddle that referenced this pull request Sep 29, 2021
…read (PaddlePaddle#35928)

* Polish multi-thread schedule strategy

* fix atomic_deps

* modify into lambda function

* add and run
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