MilesCranmer commited on
Commit
bd4f864
1 Parent(s): 202e3c7

Add `heap_size_hint_in_bytes` parameter

Browse files
Files changed (2) hide show
  1. pysr/param_groupings.yml +1 -0
  2. pysr/sr.py +10 -1
pysr/param_groupings.yml CHANGED
@@ -67,6 +67,7 @@
67
  - procs
68
  - multithreading
69
  - cluster_manager
 
70
  - batching
71
  - batch_size
72
  - precision
 
67
  - procs
68
  - multithreading
69
  - cluster_manager
70
+ - heap_size_hint_in_bytes
71
  - batching
72
  - batch_size
73
  - precision
pysr/sr.py CHANGED
@@ -455,6 +455,12 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
455
  "htc". If set to one of these, PySR will run in distributed
456
  mode, and use `procs` to figure out how many processes to launch.
457
  Default is `None`.
 
 
 
 
 
 
458
  batching : bool
459
  Whether to compare population members on small batches during
460
  evolution. Still uses full dataset for comparing against hall
@@ -709,6 +715,7 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
709
  procs=cpu_count(),
710
  multithreading=None,
711
  cluster_manager=None,
 
712
  batching=False,
713
  batch_size=50,
714
  fast_cycle=False,
@@ -800,10 +807,11 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
800
  # -- Selection parameters
801
  self.tournament_selection_n = tournament_selection_n
802
  self.tournament_selection_p = tournament_selection_p
803
- # Solver parameters
804
  self.procs = procs
805
  self.multithreading = multithreading
806
  self.cluster_manager = cluster_manager
 
807
  self.batching = batching
808
  self.batch_size = batch_size
809
  self.fast_cycle = fast_cycle
@@ -1720,6 +1728,7 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
1720
  saved_state=self.raw_julia_state_,
1721
  return_state=True,
1722
  addprocs_function=cluster_manager,
 
1723
  progress=progress and self.verbosity > 0 and len(y.shape) == 1,
1724
  verbosity=int(self.verbosity),
1725
  )
 
455
  "htc". If set to one of these, PySR will run in distributed
456
  mode, and use `procs` to figure out how many processes to launch.
457
  Default is `None`.
458
+ heap_size_hint_in_bytes : int
459
+ For multiprocessing, this sets the `--heap-size-hint` parameter
460
+ for new Julia processes. This can be configured when using
461
+ multi-node distributed compute, to give a hint to each process
462
+ about how much memory they can use before aggressive garbage
463
+ collection.
464
  batching : bool
465
  Whether to compare population members on small batches during
466
  evolution. Still uses full dataset for comparing against hall
 
715
  procs=cpu_count(),
716
  multithreading=None,
717
  cluster_manager=None,
718
+ heap_size_hint_in_bytes=None,
719
  batching=False,
720
  batch_size=50,
721
  fast_cycle=False,
 
807
  # -- Selection parameters
808
  self.tournament_selection_n = tournament_selection_n
809
  self.tournament_selection_p = tournament_selection_p
810
+ # -- Performance parameters
811
  self.procs = procs
812
  self.multithreading = multithreading
813
  self.cluster_manager = cluster_manager
814
+ self.heap_size_hint_in_bytes = heap_size_hint_in_bytes
815
  self.batching = batching
816
  self.batch_size = batch_size
817
  self.fast_cycle = fast_cycle
 
1728
  saved_state=self.raw_julia_state_,
1729
  return_state=True,
1730
  addprocs_function=cluster_manager,
1731
+ heap_size_hint_in_bytes=self.heap_size_hint_in_bytes,
1732
  progress=progress and self.verbosity > 0 and len(y.shape) == 1,
1733
  verbosity=int(self.verbosity),
1734
  )