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

(Experimental Workflow Interface) Aggregator private attributes visible to Collaborators #1052

Open
refai06 opened this issue Sep 17, 2024 · 3 comments

Comments

@refai06
Copy link

refai06 commented Sep 17, 2024

Describe the bug
In the Experimental aggregator-based workflow, private attributes of the aggregator object are passed to the collaborator step. This behavior does not occur in LocalRuntime.

To Reproduce
Steps to reproduce the behavior in the experimental setup:

  1. Create and set up the workspace with 301_torch_cnn_mnist_watermarking
    Path: openfl/openfl-workspace/experimental/301_torch_cnn_mnist_watermarking
  2. Modify the flow step: aggregated_model_validation as follows:
    @collaborator
    def aggregated_model_validation(self):
        """
        Perform Aggregated Model validation on Collaborators.
        """
        print(‘***************** Debug ****************’)
        print vars(self)
        print(‘***************** Debug ****************’)
        self.agg_validation_score = inference(self.model, self.test_loader)
        print(f"<Collab: {self.input}>"
              + f" Aggregated Model validation score = {self.agg_validation_score}"
              )

        self.next(self.train)
  1. Run Aggregator and Collaborator
  2. Observe that self of the collaborator contains the aggregator’s private attributes (as shown below):

Logs

{

.
.
.
.
.
aggregator_private_attribute:
'pretrain_epochs': 25,
'retrain_epochs': 25,
'watermark_acc_threshold': 0.98,
'watermark_data_loader': <torch.utils.data.dataloader.DataLoader object at 0x7ff088619610>,
'watermark_pretraining_completed': True
.
.
.
.

}

Expected behavior
The aggregator’s private attributes should not be visible in the collaborator step.

@MasterSkepticista
Copy link
Collaborator

Is this solvable using the exclude keyword argument in a flow step?

@scngupta-dsp
Copy link
Contributor

Is this solvable using the exclude keyword argument in a flow step?

@MasterSkepticista: Participant private attributes are not meant to be filtered by using exclude keyword arguments inside the flow steps. Workflow Interface should ensure that aggregator private attributes are always filtered out of the current state when transferring from aggregator to collaborators

@refai06
Copy link
Author

refai06 commented Oct 1, 2024

Issue was analysed in detail and following problems were found in Aggregator based workflow (FederatedRuntime):

#1: For FederatedRuntime, clones are created in the next method of the FLSpec class

After the aggregator executes the start step, FLSpec object contains the aggregator’s private attributes. Since clones are created from this object, aggregator private attributes are also passed to the clone objects

#2: For FederatedRuntime, the filter_exclude_include functionality is called in the next method of the FLSpec class during the transition from aggregator to collaborator

This results in same issue as above. As the FLSpec object already contains the aggregator private attributes therefore these are again filtered into the clones

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