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

Added config parsing check to GaNDLF task runner #908

Merged
merged 40 commits into from
Feb 2, 2024

Conversation

sarthakpati
Copy link
Contributor

No description provided.

@sarthakpati
Copy link
Contributor Author

sarthakpati commented Jan 16, 2024

So, there are a few issues:

  1. The current test uses GaNDLF master as its reference point [ref], which is not ideal, and we should change this to the latest tag, instead. This will ensure that we are not trying to hit a moving target with every merged commit into GaNDLF.

  2. The current default GaNDLF config in the plan [ref] relies on an old version of the config instantiation [ref]. This has worked out thus far because GaNDLF API has been good with backwards compatibility (at least thus far). I would prefer to get this config from the latest tag's segmentation config that GaNDLF uses for tests, like this:

git clone --depth=1 https://github.com/MLCommons/GaNDLF.git
cd GaNDLF
git fetch --tags
echo "Checkout the latest GaNDLF tag"
latestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
git checkout $latestTag
cat ./testing/config_segmentation.yaml  ### this is always tested in the GaNDLF CI
  1. The default behavior of the parseConfig submodule of GaNDLF is to check for the version [ref], which can be used to circumvent my proposal above, but I would recommend against it since it would make the test brittle. Any future errors related to API changes in the config would be hard(er) to track down.

Thoughts, @psfoley?

@psfoley
Copy link
Contributor

psfoley commented Jan 16, 2024

Thanks for the PR and detailing the issues, @sarthakpati. Am I understanding correctly that the change to load the default params in the PR is unpreferred? If so let's avoid that. I agree it's better to test against the latest tag and use the latest GaNDLF configuration format. To ensure OpenFL is always up to date with the latest GaNDLF format, maybe we could rely on this functionality:

fx plan initialize --gandlf_config ${PATH_TO_GANDLF_CONFIG}.yaml

To pull a GaNDLF reference configuration file from your repo that get's updated if/when there's a new tag with changes? Would it be possible to host and maintain this config file on the GaNDLF repo, or maybe there's one we can already use?

Crossing this out because it looks like GaNDLF/testing/config_segmentation.yaml is the right file for OpenFL to import

@sarthakpati
Copy link
Contributor Author

Added these lines:

echo "Initialize OpenFL plan"
fx plan initialize --gandlf_config testing/config_segmentation.yaml

Getting this error [ref]:

Initialize OpenFL plan
Usage: fx plan initialize [OPTIONS]
Try 'fx plan initialize --help' for help.

Did I miss something?

@sarthakpati sarthakpati marked this pull request as draft January 17, 2024 14:11
@sarthakpati
Copy link
Contributor Author

@psfoley: when I am trying to initialize the plan using the gandlf_config parameter [ref], the gandlf_config in the plan seems to be empty [ref]. Any idea what's happening?

@psfoley
Copy link
Contributor

psfoley commented Jan 17, 2024

@psfoley: when I am trying to initialize the plan using the gandlf_config parameter [ref], the gandlf_config in the plan seems to be empty [ref]. Any idea what's happening?

There's a couple things going on here:

  1. The path that you're importing the gandlf config from doesn't exist, and OpenFL is not throwing an error (I'll file a bug to add a check for this). I think if you change the command to the following the plan initialization should work correctly:
        fx plan initialize --gandlf_config ../testing/config_segmentation.yaml
  1. You're initializing the plan, but then the final test that runs is:
python -m tests.github.test_gandlf --template gandlf_seg_test --fed_workspace aggregator --col1 one --col2 two --rounds-to-train 1

This will not use the plan you initialized with fx plan initialize ..., but the original gandlf_seg_test plan [ref] instead. It would probably be easiest to delay the plan initialization (with gandlf config) to this line [ref]

@sarthakpati
Copy link
Contributor Author

sarthakpati commented Jan 18, 2024

  1. You're initializing the plan, but then the final test that runs is:
python -m tests.github.test_gandlf --template gandlf_seg_test --fed_workspace aggregator --col1 one --col2 two --rounds-to-train 1

This will not use the plan you initialized with fx plan initialize ..., but the original gandlf_seg_test plan [ref] instead. It would probably be easiest to delay the plan initialization (with gandlf config) to this line [ref]

Thanks for the tips, @psfoley! I have incorporated this into the latest updates.

Unfortunately, it still doesn't seem to be working. Any ideas?

@sarthakpati sarthakpati marked this pull request as ready for review January 23, 2024 15:53
@sarthakpati
Copy link
Contributor Author

@psfoley - this seems to be still taking the older version of the config. Can you please check to see what I am missing?

@sarthakpati sarthakpati marked this pull request as draft January 24, 2024 02:58
@sarthakpati
Copy link
Contributor Author

@psfoley - this seems to be still taking the older version of the config. Can you please check to see what I am missing?

The new version of the config is corrected detected at the start [ref], but then it reverts to the older one [ref]. Could you please provide some insight on why this is the case?

@sarthakpati sarthakpati marked this pull request as ready for review February 2, 2024 15:26
@psfoley psfoley merged commit c3b5c98 into securefederatedai:develop Feb 2, 2024
25 of 26 checks passed
@psfoley psfoley self-requested a review February 2, 2024 22:22
Copy link
Contributor

@psfoley psfoley left a comment

Choose a reason for hiding this comment

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

Tests are now passing 🚀 Thanks @sarthakpati! Approved and merged

@sarthakpati sarthakpati deleted the patch-1 branch February 3, 2024 03:17
@sarthakpati
Copy link
Contributor Author

Thanks for all your help with this, @psfoley! 😄

nammbash pushed a commit to nammbash/openfl that referenced this pull request Feb 27, 2024
* added config parsing check

* updated usage

* using latest gandlf tag, and updated plan initialization command

* updated message

* renamed

* minor rename

* no need for this comment

* let's see if this works

* updated ignore

* trying to set the paths

* fixed paths

* added debug

* added an assert

* better check for empty dict

* no need for this `mkdir` command

* this is not really needed in the workflow

* added the plan initialization in the test

* Add default value for --gandlf_config argument

* checking if this worked

* trying using `pwd`

* should fix lint

* check file presence

* removed trailing whitespace

* checking another path

* checking copy to a known location

* different path

* trying something else

* Fix plan initialization

* Fix plan initialization for GaNDLF

Signed-off-by: Patrick Foley <[email protected]>

* Attempt to add missing param

Signed-off-by: Patrick Foley <[email protected]>

* better way to initialize default

* using the 3d patch instead of the default 2d one

* lint fix

* this should be there

* lint fix

* this should fix it

* using 2d data for unit test instead of 3d

* trying something else

* added a few comments

---------

Signed-off-by: Patrick Foley <[email protected]>
Co-authored-by: Patrick Foley <[email protected]>
Signed-off-by: nammbash <[email protected]>
nammbash pushed a commit to nammbash/openfl that referenced this pull request Feb 27, 2024
* added config parsing check

* updated usage

* using latest gandlf tag, and updated plan initialization command

* updated message

* renamed

* minor rename

* no need for this comment

* let's see if this works

* updated ignore

* trying to set the paths

* fixed paths

* added debug

* added an assert

* better check for empty dict

* no need for this `mkdir` command

* this is not really needed in the workflow

* added the plan initialization in the test

* Add default value for --gandlf_config argument

* checking if this worked

* trying using `pwd`

* should fix lint

* check file presence

* removed trailing whitespace

* checking another path

* checking copy to a known location

* different path

* trying something else

* Fix plan initialization

* Fix plan initialization for GaNDLF

Signed-off-by: Patrick Foley <[email protected]>

* Attempt to add missing param

Signed-off-by: Patrick Foley <[email protected]>

* better way to initialize default

* using the 3d patch instead of the default 2d one

* lint fix

* this should be there

* lint fix

* this should fix it

* using 2d data for unit test instead of 3d

* trying something else

* added a few comments

---------

Signed-off-by: Patrick Foley <[email protected]>
Co-authored-by: Patrick Foley <[email protected]>
Signed-off-by: nammbash <[email protected]>
nammbash pushed a commit to nammbash/openfl that referenced this pull request Feb 29, 2024
* added config parsing check

* updated usage

* using latest gandlf tag, and updated plan initialization command

* updated message

* renamed

* minor rename

* no need for this comment

* let's see if this works

* updated ignore

* trying to set the paths

* fixed paths

* added debug

* added an assert

* better check for empty dict

* no need for this `mkdir` command

* this is not really needed in the workflow

* added the plan initialization in the test

* Add default value for --gandlf_config argument

* checking if this worked

* trying using `pwd`

* should fix lint

* check file presence

* removed trailing whitespace

* checking another path

* checking copy to a known location

* different path

* trying something else

* Fix plan initialization

* Fix plan initialization for GaNDLF

Signed-off-by: Patrick Foley <[email protected]>

* Attempt to add missing param

Signed-off-by: Patrick Foley <[email protected]>

* better way to initialize default

* using the 3d patch instead of the default 2d one

* lint fix

* this should be there

* lint fix

* this should fix it

* using 2d data for unit test instead of 3d

* trying something else

* added a few comments

---------

Signed-off-by: Patrick Foley <[email protected]>
Co-authored-by: Patrick Foley <[email protected]>
Signed-off-by: nammbash <[email protected]>
nammbash pushed a commit to nammbash/openfl that referenced this pull request Feb 29, 2024
* added config parsing check

* updated usage

* using latest gandlf tag, and updated plan initialization command

* updated message

* renamed

* minor rename

* no need for this comment

* let's see if this works

* updated ignore

* trying to set the paths

* fixed paths

* added debug

* added an assert

* better check for empty dict

* no need for this `mkdir` command

* this is not really needed in the workflow

* added the plan initialization in the test

* Add default value for --gandlf_config argument

* checking if this worked

* trying using `pwd`

* should fix lint

* check file presence

* removed trailing whitespace

* checking another path

* checking copy to a known location

* different path

* trying something else

* Fix plan initialization

* Fix plan initialization for GaNDLF

Signed-off-by: Patrick Foley <[email protected]>

* Attempt to add missing param

Signed-off-by: Patrick Foley <[email protected]>

* better way to initialize default

* using the 3d patch instead of the default 2d one

* lint fix

* this should be there

* lint fix

* this should fix it

* using 2d data for unit test instead of 3d

* trying something else

* added a few comments

---------

Signed-off-by: Patrick Foley <[email protected]>
Co-authored-by: Patrick Foley <[email protected]>
Signed-off-by: nammbash <[email protected]>
manuelhsantana pushed a commit that referenced this pull request Jul 10, 2024
* added config parsing check

* updated usage

* using latest gandlf tag, and updated plan initialization command

* updated message

* renamed

* minor rename

* no need for this comment

* let's see if this works

* updated ignore

* trying to set the paths

* fixed paths

* added debug

* added an assert

* better check for empty dict

* no need for this `mkdir` command

* this is not really needed in the workflow

* added the plan initialization in the test

* Add default value for --gandlf_config argument

* checking if this worked

* trying using `pwd`

* should fix lint

* check file presence

* removed trailing whitespace

* checking another path

* checking copy to a known location

* different path

* trying something else

* Fix plan initialization

* Fix plan initialization for GaNDLF

Signed-off-by: Patrick Foley <[email protected]>

* Attempt to add missing param

Signed-off-by: Patrick Foley <[email protected]>

* better way to initialize default

* using the 3d patch instead of the default 2d one

* lint fix

* this should be there

* lint fix

* this should fix it

* using 2d data for unit test instead of 3d

* trying something else

* added a few comments

---------

Signed-off-by: Patrick Foley <[email protected]>
Co-authored-by: Patrick Foley <[email protected]>
Signed-off-by: manuelhsantana <[email protected]>
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