Skip to content

Clarify random seeding for training and sampling #4

@aigclover

Description

@aigclover

Hi team,
I’m trying to reproduce results and noticed some seeding gaps:
Sampling (test.py): The prior RNG is seeded via cfg.seed, but there’s no global torch.manual_seed / np.random.seed / random.seed, so other stochastic parts (e.g., model ops) are unseeded.
Training (liflow/experiment/train.py): DataModules pass cfg.seed into the torch.Generator and worker init for dataloaders (so shuffling/splits are deterministic), but the model initialization and any other randomness aren’t globally seeded. Also, priors default to seed=42 unless explicitly overridden in config, so they may diverge from cfg.seed.
Could you clarify:

  1. Should global seeds (torch, numpy, Python random) be set in training and sampling entrypoints for full reproducibility?
  2. Should prior seeds be tied to cfg.seed by default?
  3. Are there recommended deterministic settings (e.g., CUDA/Lightning flags) to match reported results?
    Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions