Skip to content

[Feature] Add flexible nnunet client and ditto-ify'ed example#411

Merged
nerdai merged 28 commits into
mainfrom
nerdai/nnunet-ditto
Jul 15, 2025
Merged

[Feature] Add flexible nnunet client and ditto-ify'ed example#411
nerdai merged 28 commits into
mainfrom
nerdai/nnunet-ditto

Conversation

@nerdai

@nerdai nerdai commented Jun 24, 2025

Copy link
Copy Markdown
Collaborator

PR Type

Feature

Closes: #390
Closes: #364

Short Description

With FlexibleClient now merged, we can move on to adding an Nnunet version of this client.

Adds

  • NNunetClient that subclasses FlexibleClient.
  • examples/nnunet_pfl_example for running a ditto-ify'ed version of FlexibleNNunetClient
  • nnunet_utils.set_nnunet_env_and_reload_modules

Changes

  • nnunet_utils.set_nnunet_env supported but deprecated message thrown

Tests Added

  • smoke_tests/test_smoke_tests.py::test_ditto_flexible_nnunet_config_2d

@codecov

codecov Bot commented Jun 24, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 81.75824% with 83 lines in your changes missing coverage. Please review.

Project coverage is 80.42%. Comparing base (b5419b6) to head (2eab3c5).
Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
fl4health/clients/flexible/nnunet.py 83.28% 60 Missing ⚠️
fl4health/clients/basic_client.py 25.00% 6 Missing ⚠️
fl4health/client_managers/base_sampling_manager.py 40.00% 3 Missing ⚠️
fl4health/clients/fed_pca_client.py 33.33% 2 Missing ⚠️
fl4health/clients/fenda_ditto_client.py 33.33% 2 Missing ⚠️
fl4health/servers/base_server.py 88.23% 2 Missing ⚠️
...health/clients/adaptive_drift_constraint_client.py 0.00% 1 Missing ⚠️
fl4health/clients/clipping_client.py 66.66% 1 Missing ⚠️
fl4health/clients/ditto_client.py 0.00% 1 Missing ⚠️
...l4health/clients/partial_weight_exchange_client.py 0.00% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #411      +/-   ##
==========================================
+ Coverage   80.20%   80.42%   +0.21%     
==========================================
  Files         160      161       +1     
  Lines        9735    10120     +385     
==========================================
+ Hits         7808     8139     +331     
- Misses       1927     1981      +54     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nerdai nerdai force-pushed the nerdai/nnunet-ditto branch from 07d2d00 to e5c55d7 Compare June 24, 2025 14:49
Comment thread fl4health/strategies/fedavg_with_adaptive_constraint.py
@nerdai nerdai marked this pull request as ready for review June 26, 2025 15:38
@nerdai nerdai requested review from emersodb and scarere June 26, 2025 15:38
@nerdai nerdai changed the title [Feature] Add flexible nnunet client [Feature] Add flexible nnunet client and ditto-ify'ed example Jun 26, 2025

@emersodb emersodb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shawn is our expert on NNUnet, so I'll let him do a thorough review of your port to the FlexibleClient base class 🙂.

Left a few comments. There is a thorny one, which is your loosening of the initial_parameters variable to admit an optional. We should probably talk about why that's thorny together. I think there is a way around it, but its a bit of work.

Comment thread examples/nnunet_example/client_flexible.py
Comment thread examples/nnunet_example/client_flexible.py
Comment thread examples/nnunet_pfl_example/README.md Outdated
Comment thread examples/nnunet_pfl_example/client.py Outdated
Comment thread examples/nnunet_pfl_example/client.py Outdated
Comment thread examples/nnunet_pfl_example/client.py
Comment thread fl4health/strategies/fedavg_with_adaptive_constraint.py

@scarere scarere left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! Nice job finally getting this working. My main comment just has to do with an overriden method that doesn't seem like it needs to be. I'll hold off on approving for now as it seems you and David are still sorting out a "thorny" issue regarding the strategy class

Comment thread examples/nnunet_example/client.py Outdated
Comment thread examples/nnunet_example/client.py
Comment thread examples/nnunet_example/client_flexible.py
Comment thread examples/nnunet_example/client_flexible.py
Comment thread examples/nnunet_example/client_flexible.py Outdated
Comment thread examples/nnunet_pfl_example/client.py
Comment thread examples/nnunet_pfl_example/client.py Outdated
Comment thread fl4health/clients/flexible/nnunet.py Outdated
Comment thread fl4health/clients/flexible/nnunet.py
Comment thread tests/smoke_tests/test_smoke_tests.py
@nerdai nerdai force-pushed the nerdai/nnunet-ditto branch 2 times, most recently from e98b6e8 to b9256b2 Compare June 27, 2025 17:04

@emersodb emersodb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall, some very minor comments here. Will approve from my perspective in general. I think we also want to make sure @scarere's remaining comments are sufficiently addressed as well though.

Comment thread examples/fedprox_example/server.py Outdated
Comment thread examples/nnunet_example/client_flexible.py
Comment thread examples/nnunet_example/client_flexible.py Outdated
Comment thread examples/nnunet_example/client_flexible.py
Comment thread examples/nnunet_example/server.py
Comment thread examples/nnunet_pfl_example/server.py
Comment thread fl4health/strategies/fedavg_with_adaptive_constraint.py
Comment thread fl4health/utils/nnunet_utils.py Outdated
Comment thread fl4health/clients/flexible/nnunet.py
Comment thread fl4health/clients/flexible/nnunet.py Outdated
@nerdai nerdai force-pushed the nerdai/nnunet-ditto branch 3 times, most recently from 27d7ef4 to 2a8a99b Compare July 11, 2025 14:07

@scarere scarere left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok a lot of these comments might be outdated and bit confusing because they were from awhile ago and i just never submitted them by mistake. Will be happy to clarify with follow up comments

Comment thread examples/nnunet_pfl_example/client.py
Comment thread examples/nnunet_example/client.py Outdated
Comment thread fl4health/clients/flexible/nnunet.py Outdated
Comment thread fl4health/clients/flexible/nnunet.py Outdated
Comment thread fl4health/clients/flexible/nnunet.py
Comment thread tests/smoke_tests/test_smoke_tests.py
Comment thread examples/nnunet_example/client_flexible.py Outdated
Comment thread fl4health/clients/flexible/nnunet.py
Comment thread fl4health/clients/flexible/nnunet.py Outdated
Comment thread fl4health/clients/flexible/nnunet.py Outdated
@nerdai nerdai force-pushed the nerdai/nnunet-ditto branch from 70857ec to 304af8e Compare July 15, 2025 16:11
@nerdai nerdai merged commit a082eb9 into main Jul 15, 2025
13 checks passed
@nerdai nerdai deleted the nerdai/nnunet-ditto branch July 15, 2025 18:21
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.

3 participants