-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add option to set determinism with bundle configs #4942
Comments
Hi @holgerroth , Thanks for raising the question. Thanks. |
Yes, perhaps we have this hardcoded in monaialgo for FL, and later extending this to the primary bundle parser if we receive feature requests? cc @Nic-Ma |
I feel MonaiAlgo is the wrong place for handling this. Determinism is a general MONAI feature that is used by many bundles. Why not have some purpose logic for this in the config parser?
…________________________________
From: Wenqi Li ***@***.***>
Sent: Friday, August 19, 2022 12:07:02 PM
To: Project-MONAI/MONAI ***@***.***>
Cc: Holger Roth ***@***.***>; Mention ***@***.***>
Subject: Re: [Project-MONAI/MONAI] Add option to set determinism with bundle configs (Issue #4942)
Yes, perhaps we have this hardcoded in monaialgo for FL, and later extending this to the primary bundle parser if we receive feature requests? cc @Nic-Ma<https://github.com/Nic-Ma>
—
Reply to this email directly, view it on GitHub<#4942 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABQDH4W73GSRO47OCSNJOX3VZ6WKNANCNFSM57A7BMCA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
currently the config parser connects the structured configs and the python-based components. It is quite generic and decoupled from the underlying machine learning APIs. So adding numpy/torch specific code logic to it doesn't make sense to me... however, we can define some system default pre-set config json, and the user can choose to load it as system-wide predefined commands, and override these default keys in their own config files. "rng_seed": null,
"deterministic": [
"$monai.utils.set_determinism(seed=@rng_seed)",
"..."
] the pre-set configs could be hosted in monai's data storage and requires checksum matching before loading/running |
maybe one valid feature request is to create two types of permissions for the MONAI/monai/bundle/config_item.py Line 318 in 1941283
so that when option 1 is disabled at a system level, the user can still have the flexibility to use the 2nd option to run some predefined commonly used commands. |
Hi @wyli , Interesting idea, need further step to gather some predefined expressions? Thanks. |
Exactly, adding something like this to the config would be independent of the underlying implementation. There's no dependency on numpy/pytorch:
|
Hi @holgerroth , Based on the latest comment from @wyli , I think he means a different proposal: " Thanks. |
Is your feature request related to a problem? Please describe.
There should be a configuration option to enable deterministic training with monai bundle. Currently, a user has to add python code in the "training" portion of the config:
This can be difficult to use in security-constrained environments such as in federated learning, where one might want to disable the python code execution in the bundle.
Describe the solution you'd like
There should be an option to set the deterministic behavior using configuration style options, e.g., the below to achieve the same behavior as above:
Describe alternatives you've considered
MonaiAlgo for executing FL training does not run the "training" section in the config. Therefore the code there is not being executed. One can achieve determinism by using the "required" option for the SupervisedTrainer but this will not work if python code is disabled.
Additional context
Especially important feature to support FL.
The text was updated successfully, but these errors were encountered: