Skip to content

Deactivate plans in plans#2791

Merged
LaRiffle merged 5 commits intoOpenMined:masterfrom
gmuraru:gm-deactivate-plans-in-plans
Dec 27, 2019
Merged

Deactivate plans in plans#2791
LaRiffle merged 5 commits intoOpenMined:masterfrom
gmuraru:gm-deactivate-plans-in-plans

Conversation

@gmuraru
Copy link
Member

@gmuraru gmuraru commented Dec 7, 2019

Description

Solves #2707.

Building a plan that has already a built plan should directly call the function - take into consideration *args and **kwargs.

For doing this, we keep in the owner a state, which would indicate if a plan is already building or not. If a plan is already building, then directly call the function.

Later EDIT

Made this PR to support plans in plans - even if the inner plan is already built (with a state) - for that I had to add more information that is sent to the worker (the states for the first plans)

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

@gmuraru gmuraru requested a review from LaRiffle December 11, 2019 00:04
Copy link
Contributor

@LaRiffle LaRiffle left a comment

Choose a reason for hiding this comment

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

Would you mind adding tests about this feature?

from syft.messaging.promise import Promise

from syft.exceptions import route_method_exception
from syft.exceptions import TensorsNotCollocatedException
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this was not needed

res = plan_2_1(data)
return plan_2_2(res)

# (-2 * (x + tensor(3) + 42) + tensor(2) + 1331)
Copy link
Member Author

Choose a reason for hiding this comment

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

I can remove this - It was only a simple way that I thought of to show what each plan/function is doing

@gmuraru gmuraru requested a review from LaRiffle December 23, 2019 07:06
Copy link
Contributor

@LaRiffle LaRiffle left a comment

Choose a reason for hiding this comment

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

This looks really great to me :)

@LaRiffle LaRiffle merged commit ff080c1 into OpenMined:master Dec 27, 2019
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