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

refactor(framework) Migrate ID handling from sint64 to uint64 #4170

Merged
merged 35 commits into from
Sep 18, 2024

Conversation

mohammadnaseri
Copy link
Contributor

@mohammadnaseri mohammadnaseri commented Sep 10, 2024

This PR updates the ID generation to use uint64. To ensure compatibility with SQLite, which uses sint64, the IDs are converted as follows:

During Save: Convert uint64 IDs to sint64 before storing in SQLite.
During Read: Convert sint64 IDs back to uint64 after retrieving from SQLite.

@mohammadnaseri mohammadnaseri changed the title fix(framework) Use uint for IDs fix(framework) Convert sint64 to uint64 for IDs Sep 11, 2024
@mohammadnaseri mohammadnaseri marked this pull request as ready for review September 11, 2024 15:44
@mohammadnaseri mohammadnaseri changed the title fix(framework) Convert sint64 to uint64 for IDs fix(framework) Migrate sint64 to uint64 for IDs Sep 11, 2024
@mohammadnaseri mohammadnaseri changed the title fix(framework) Migrate sint64 to uint64 for IDs fix(framework) Migrate ID handling from sint64 to uint64 Sep 11, 2024
Copy link
Contributor

@chongshenng chongshenng left a comment

Choose a reason for hiding this comment

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

Overall looks fine to me. Minor comment about whether we should use parameterize for the test cases. I'm unfamiliar with sqlite_state.py so I did not review it. Perhaps @panh99 can give feedback there?

src/py/flwr/server/superlink/state/utils_test.py Outdated Show resolved Hide resolved
Copy link
Contributor

@panh99 panh99 left a comment

Choose a reason for hiding this comment

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

It looks good to me generally. However, I am a bit concerned about how users gonna send/receive these IDs. For now, our major grpc messages like Scalar and ConfigsRecordValue do not support uint64. They only support sint64. This might prevent our users from storing IDs, e.g., node_id, in grpc messages. We may need to update Scalar, ConfigsRecordValue definitions and their serialization functions in serde.py accordingly.

src/py/flwr/server/superlink/state/utils.py Outdated Show resolved Hide resolved
src/py/flwr/server/superlink/state/utils.py Outdated Show resolved Hide resolved
src/py/flwr/server/superlink/state/utils.py Outdated Show resolved Hide resolved
src/py/flwr/server/superlink/state/utils.py Outdated Show resolved Hide resolved
src/py/flwr/server/superlink/state/utils.py Outdated Show resolved Hide resolved
src/py/flwr/server/superlink/state/utils.py Outdated Show resolved Hide resolved
src/py/flwr/server/superlink/state/sqlite_state.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
panh99
panh99 previously approved these changes Sep 12, 2024
@mohammadnaseri mohammadnaseri self-assigned this Sep 16, 2024
@danieljanes danieljanes changed the title fix(framework) Migrate ID handling from sint64 to uint64 refactor(framework) Migrate ID handling from sint64 to uint64 Sep 18, 2024
@danieljanes danieljanes enabled auto-merge (squash) September 18, 2024 15:33
@danieljanes danieljanes merged commit 1d02874 into main Sep 18, 2024
32 checks passed
@danieljanes danieljanes deleted the convert-id-sint64-to-uint64 branch September 18, 2024 15:33
chongshenng pushed a commit that referenced this pull request Sep 19, 2024
Co-authored-by: Heng Pan <pan@flower.ai>
Co-authored-by: Daniel J. Beutel <daniel@flower.ai>
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.

4 participants