BiomedSciAI / fuse-med-ml

A python framework accelerating ML based discovery in the medical field by encouraging code reuse. Batteries included :)
Apache License 2.0
134 stars 34 forks source link

Support Lightning >=2.0.0 and Pandas >=2.0.0 #301

Closed SagiPolaczek closed 1 year ago

SagiPolaczek commented 1 year ago

Ready for CR 🕺🏼

Warning - Lightning >=2.0.0 breaks backward competability

Support Lightning 2.0.0:

References:

https://lightning.ai/pages/releases/2.0.0/ (recommended!!) https://lightning.ai/docs/pytorch/latest/upgrade/migration_guide.html / thanks to @smartdanny *_epoch_end() migration guide

Changes in Fuse:

  1. Trainer(strategy=None) is no longer supported. We should now use strategy="auto". see here for more info.
  2. Trainer(auto_select_gpus=...) also got removed.
  3. Tuner and Trainer broke up :broken_heart: -> relevant for KNIGHT’s fuse baseline.
  4. Migrate *_epoch_end() to on_*_epoch_end(). see changes in run_mnist_custom_pl_imp.py and the relevant reference above for more info.

Remarks:

Support pandas 2.0.0:

References:

https://pandas.pydata.org/docs/whatsnew/v2.0.0.html#deprecations

Changes in Fuse:

  1. df.append() was removed. see here . Relevant for an EHR transformer dataset. Had to switch with pd.concat().
SagiPolaczek commented 1 year ago

Looks good; see if it's possible to be backward compatible though.

Thanks! I thought about it a bit later and it might be possible yes. Will try that on Wednesday.

SagiPolaczek commented 1 year ago

@mosheraboh Now we support both <2.0.0 , >=2.0.0 !

Please see the two last runs that differs only by the Lightning version: Screenshot 2023-04-19 at 13 26 34

I'll do another self-review now.

NOTE

To support both versions I had to delete arguments (and arguments values) that brake the backward computability such as strategy and auto_scale_batch_size.