Skip to content

Conversation

@yunfengzhou-hub
Copy link
Contributor

@yunfengzhou-hub yunfengzhou-hub commented Aug 23, 2022

What is the purpose of the change

Improve the performance of Flink ML iteration mechanism by reducing the overhead on HeadOperator.

While #144 has reduced the overhead brought by HeadOperator.endInput(), it is discovered that the implementation has only reduced the overhead of Mails related to feedback edge. The other mails, like operator events, still need to wait until timeout before they are able to be processed, which is equivalent to Thread.sleep(timeout). Thus we need to improve the implementation in #144 to reduce the overhead for all mails the HeadOperator would receive.

The performance improvement brought by this PR on the unit tests of algorithms with iterations is as follows.

Before this PR [1] After this PR [2]
LinearSVCTest 21.195 s 5.111 s
LogisticRegressionTest 25.164 s 5.852 s
KMeansTest 31.86 s 12.23 s
LinearRegressionTest 32.526 s 7.736 s

[1] https://github.com/apache/flink-ml/runs/7966776640?check_suite_focus=true
[2] https://github.com/apache/flink-ml/runs/7968880728?check_suite_focus=true

Brief change log

  • Replace the lock and condition used in HeadOperator.MailboxExecutorWithYieldTimeout with a timer to schedule the timeout event.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @public(Evolving): (no)
  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (N/A)

@lindong28
Copy link
Member

Thanks for the PR. LGTM.

@lindong28 lindong28 merged commit f9f7f41 into apache:master Aug 23, 2022
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