Skip to content

Lightning methods and portable configs - #167

Closed
selmanozleyen wants to merge 46 commits into
refactor/methodsfrom
refactor/lightning-methods
Closed

selmanozleyen wants to merge 46 commits into
refactor/methodsfrom
refactor/lightning-methods

Conversation

@selmanozleyen

Copy link
Copy Markdown
Collaborator

Stacked on refactor/methods.

  • Training on Lightning: TrainingPlan (LightningModule) and FlowDataModule (LightningDataModule). Model is removed.
  • Portable configs on scfit.registry: CFMConfig, ODEConfig, FlowDataConfig, path and splitter configs. save_run / load_run write specs.json plus weights.pt, with nothing pickled.
  • Config builds pass every field explicitly, so pyright checks them against the constructors. The spec schema is the config's fields, not the constructor signature.
  • Merges Drop legacy global numpy RNG #166 (no global numpy RNG, splitter rng).

Draft: test_base, test_opt, test_model, test_callbacks and test_trainer still use names this removes.

lorenzo-consoli and others added 30 commits September 8, 2026 18:16
# Conflicts:
#	src/sckitflow/_model.py
#	src/sckitflow/core/_data_utils.py
#	src/sckitflow/core/methods/_base.py
#	tests/core/methods/library/test_cfm.py
#	tests/core/methods/test_custom.py
#	tests/core/methods/test_methods.py
#	tests/test_model.py
Replace the hand-rolled training stack with lightning.pytorch and cut the
abstraction layers around it.

- delete Trainer, TrainingCallbacks, WandBLogger, OptimConfig,
  OptimizationManager; add TrainingPlan (LightningModule) and
  FlowDataModule (LightningDataModule), whose state_dict carries the
  schema inside the Lightning checkpoint
- Model takes prebuilt methods and a data module; no module/protocol
  building, no registries, no *_cls/_id/_kwargs, no ModelKwargs
- collapse ProtocolSpecs/FlowSpecs/_SpecsHolder and the Abstract*/
  wrapper hierarchies: two Protocols plus AbstractMethod/AbstractFlowMethod
- rename protocol -> method throughout; drop BaseModule for nn.Module
- methods no longer take dtype/device_id and no longer move the module
  they are given; the batch is the reference, and the loader builds it
  in the module's dtype
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

…ators

# Conflicts:
#	src/sckitflow/_model.py
#	src/sckitflow/_types.py
#	src/sckitflow/core/_data_utils.py
#	src/sckitflow/core/_types.py
#	src/sckitflow/core/methods/_base.py
#	src/sckitflow/core/methods/library/_cfm.py
#	src/sckitflow/core/nn/_modules.py
#	src/sckitflow/core/nn/_vf.py
#	src/sckitflow/trainer/_callbacks.py
#	tests/core/methods/library/test_cfm.py
#	tests/core/methods/test_custom.py
#	tests/core/methods/test_methods.py
#	tests/test_model.py
@selmanozleyen

Copy link
Copy Markdown
Collaborator Author

closed in favor of #170

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