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

[fed] Provide the initial federated plugin interface. #10540

Merged

Conversation

trivialfis
Copy link
Member

@trivialfis trivialfis commented Jul 3, 2024

Extracted from #10534 . See the #10410 for existing limitations. The most outstanding issue of the interface is the lack of support for multi-class. To enable this, we need to further refactor the tree methods, which is out of scope for the initial implementation. Most of the tests are in the main PR.

We will be targeting the feature branch for now. The merge into the master branch will start once the feature branch is complete.

@trivialfis
Copy link
Member Author

cc @rongou .

grad_.resize(data.size_bytes());
auto casted =
common::Span{reinterpret_cast<std::uint8_t const *>(data.data()), data.size_bytes()};
std::copy_n(casted.data(), casted.size(), grad_.data());
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still plan to use the mock plugin for unencrypted federated learning? I wonder if we can somehow avoid these types of copying.

Copy link
Member Author

@trivialfis trivialfis Jul 3, 2024

Choose a reason for hiding this comment

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

Not at the moment, it's only used for running tests. Any suggestions? I don't want this mock myself, but haven't found a way to run test without one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably we can write the histogram build in a way that can reuse the existing histogram implementation. Will look into it tomorrow.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, then the tests wouldn't be reliable. Also, the plugin itself cannot communicate, so we can't hand the entire histogram build to the plugin.
Any suggestion for design would be great.

Copy link
Contributor

Choose a reason for hiding this comment

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

For testing it's probably fine.

grad_.resize(data.size_bytes());
auto casted =
common::Span{reinterpret_cast<std::uint8_t const *>(data.data()), data.size_bytes()};
std::copy_n(casted.data(), casted.size(), grad_.data());
Copy link
Contributor

Choose a reason for hiding this comment

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

For testing it's probably fine.

@trivialfis trivialfis merged commit d83c22b into dmlc:federated-secure Jul 4, 2024
30 of 31 checks passed
@trivialfis trivialfis deleted the federated-plugin-extracted branch July 4, 2024 07:54
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