Skip to content

Create toy workers, actions, and messages to experiment with async#3601

Closed
karlhigley wants to merge 5 commits intoOpenMined:masterfrom
karlhigley:toy/async-workers
Closed

Create toy workers, actions, and messages to experiment with async#3601
karlhigley wants to merge 5 commits intoOpenMined:masterfrom
karlhigley:toy/async-workers

Conversation

@karlhigley
Copy link
Contributor

Description

This experimental code demonstrates running multiple workers simultaneously in a single thread with asyncio, and shows how remote execution primitives (along the lines of Plans/Protocols) necessarily become async-aware if they contain async cross-worker communication methods.

Checklist:

  • My changes are covered by tests.
  • I have run the pre-commit hooks to format and check my code for style issues.
  • I have commented my code following Google style.

@karlhigley karlhigley force-pushed the toy/async-workers branch from 6555ceb to 9630d9f Compare May 23, 2020 16:06
@karlhigley karlhigley self-assigned this May 23, 2020
@karlhigley karlhigley marked this pull request as draft May 23, 2020 20:43
alice._execute_action(action)


# The global action counter should be incremented every time any worker executes an action.
Copy link
Member

Choose a reason for hiding this comment

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

I'm interested in this counter - what is its main function?

Copy link
Contributor Author

@karlhigley karlhigley May 25, 2020

Choose a reason for hiding this comment

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

It provides "sequential-ness" to actions by supplying a unique "id" for compute/send actions, which allows other actions to depend on their results.

Copy link
Contributor Author

@karlhigley karlhigley May 25, 2020

Choose a reason for hiding this comment

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

(In other words, it's a hack, but it works for a quick and dirty simulation. If they were random, it would be harder to write a series of actions with inter-dependencies, because I'd need to write some mechanism for transmitting the ids. Here the ids can be known ahead of time, because they're assigned sequentially.)

@karlhigley karlhigley added the Type: Research 🔬 When further investigation into a subject is required label May 27, 2020
@karlhigley karlhigley requested a review from iamtrask May 27, 2020 13:57
@karlhigley karlhigley added Status: Investigating 🔍 Something we are looking in to, but not currently in active development Priority: 3 - Medium 😒 Should be fixed soon, but there may be other pressing matters that come first labels May 30, 2020
@karlhigley karlhigley closed this Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 3 - Medium 😒 Should be fixed soon, but there may be other pressing matters that come first Status: Investigating 🔍 Something we are looking in to, but not currently in active development Type: Research 🔬 When further investigation into a subject is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants