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

unexpected behavior in exclude/include in workflow api funtionality #978

Closed
porteratzo opened this issue May 23, 2024 · 2 comments
Closed

Comments

@porteratzo
Copy link
Collaborator

Describe the bug
In collaborator workflow steps, if the first exclude/include argument is not in the collaborator FLSpec the whole filter attributes is bypassed.

To Reproduce
Steps to reproduce the behavior:

  1. Create workflow
  2. Create step for collaborators
    self.next(
    self.col_step,
    foreach="collaborators",
    exclude=["attribute_not_in_collaborator", "attribute_in_collaborator"],
    )
  3. The collaborator will still have "attribute_in_collaborator" because it doesn't have "attribute_not_in_collaborator"

Expected behavior
Either any attributes in the list that are in the collaborator FLSpec should be filtered or an error should be raised informing that " they are trying to delete attributes not in the collaborator FLSpec"

Screenshots
if exclude or include [0] not in clone no attributes are filtered
image

Desktop (please complete the following information):
Ubuntu 18.4

@refai06
Copy link
Contributor

refai06 commented Aug 20, 2024

Summary:
Issue reported could not be reproduced. Request if details of the flow where this issue is observed could be shared

Reproduction summary:
Based on issue description, following steps were tried in 101_MNIST tutorial to reproduce the issue. However, in each trial an exception was raised indicating that the attributes are filtered properly. These steps were tried out in LocalRuntime as well as Aggregator Based Workflow

Trial 1
def start:
...
  self.next( self.aggregated_model_validation, foreach="collaborators", exclude=[“random”,”private”])

Trial 2
def aggregated_model_validation:
...
  self.next( self.train, foreach=“collaborators", exclude=[“random”,”agg_validation_score”])

Trial 3
def train:

self.next(self.local_model_validation, foreach = “collaborators”, exclude = [“attribute_not_in_collaborator”,“optimizer”]

Trial 4:
def local_model_validation:

self.next(self.join, exclude = [“randomized”,”training_completed”]

Code Analysis:
Further analysis of code indicates that the described problem shall always raise an exception in self.next when filter_attributes() is called. As per the snippet below, an exception is raised if any attribute specified in exclude is not present in cls_attrs

elif "exclude" in kwargs:
    assert isinstance(kwargs["exclude"], list)
    for in_attr in kwargs["exclude"]:
        if in_attr not in cls_attrs:
            raise RuntimeError(f"argument '{in_attr}' not found in flow task {f.__name__}")

@rahulga1
Copy link
Collaborator

As per the last comment, this issue cant be reproduced, hence closing it.

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

No branches or pull requests

3 participants