-
Notifications
You must be signed in to change notification settings - Fork 90
Made the codebase fully ty-clean by tightening typings and runtime guards across the stack. #400
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for platodocs canceled.
|
…t -> Long cast errors during weighted updates. The numpy/torch accumulation now temporarily upcasts non-floating payloads and avoids in-place adds that would force unsafe casts, keeping the logic stable across nested structures. After aggregation, results are coerced back to the baseline (or first-delta) dtypes via _match_reference_structure, rounding integers and thresholding booleans where needed to keep state-dict loading happy. When no weight-bearing reports are present the strategy now returns None, preserving the existing feature-update short-circuit behaviour.
… to return Optional[Dict], matching the cases where it legitimately yields None and satisfying the type checker.
…ic to algorithm, and to pass ty checks.
…ng, personalized_fl, reinforcement_learning.
…during server-side testing.
…ategy was not activated.
- Adjusted the SCAFFOLD callback so the extractor runs only after safetensor_decode, skips duplicate insertions, and gracefully resets stale control variates when the payload is not a list. - Ensured the outbound callback adds a single delta-attaching processor immediately before encoding, preventing nested payloads across rounds.
…gation: after a defence pass we now trim self.updates alongside the weight list, and when every report is rejected we just return an empty payload and log that the previous global weights are kept. In the FedAvg aggregation strategy we added baseline fallbacks: when no eligible updates remain or all have zero samples, we deep-copy the current baseline weights (or build a zero-delta via the algorithm) so the round finishes without errors.
…stom strategy in AnyCostFL.
…vers so the framework now defers to each algorithm’s own weight-merging logic instead of the generic FedAvg path, avoiding the strict shape checks that trashed partial sub-models.
…rch/pfedrlnas/MobileNetV3.
examples/unlearning.
… for binding while clearing Config.args.port when no explicit --id is provided, preserving the cross-silo role checks even when launching with -p.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
plato/trainers/base.py,composable.py,mlx.py,plato/config.py).ty 0.0.1alpha24.The following examples have also been type checked and tested by running experiments:
examples/model_searchexamples/custom_client_trainingexamples/personalized_flexamples/server_aggregationexamples/unlearningexamples/sslexamples/three_layer_flDocumentation has been improved with a reference for one of the model search examples, as well as for using the type checker in Quick Start.
How has this been tested?
uvx ty check platouvx ty check examples/model_search(and etc. for the other examples)Types of changes
Checklist:
ruff format) and checked using the Ruff linter (ruff check --fix).