|
|
@@ -22,7 +22,7 @@ class SublinearMemoryConfig: |
|
|
|
:param genetic_pool_size: number of samples for the crossover random selection |
|
|
|
during genetic optimization. Default: 20. |
|
|
|
It can also be set through the environmental variable 'MGB_SUBLINEAR_MEMORY_GENETIC_POOL_SIZE'. |
|
|
|
:param lb_memory: memory lower bound of bottleneck size in MB for sublinear memory optimization. |
|
|
|
:param lb_memory_mb: memory lower bound of bottleneck size in MB for sublinear memory optimization. |
|
|
|
It can be used to perform manual tradeoff between memory and speed. Default: 0. |
|
|
|
It can also be set through the environmental variable 'MGB_SUBLINEAR_MEMORY_LOWER_BOUND_MB'. |
|
|
|
:param num_worker: number of thread workers to search the optimum checkpoints |
|
|
@@ -39,7 +39,7 @@ class SublinearMemoryConfig: |
|
|
|
thresh_nr_try: int = 10, |
|
|
|
genetic_nr_iter: int = 0, |
|
|
|
genetic_pool_size: int = 20, |
|
|
|
lb_memory: int = 0, |
|
|
|
lb_memory_mb: int = 0, |
|
|
|
num_worker: int = max(1, get_device_count("cpu") // 2), |
|
|
|
): |
|
|
|
assert thresh_nr_try >= 0, "thresh_nr_try must be greater or equal to zero" |
|
|
@@ -50,6 +50,6 @@ class SublinearMemoryConfig: |
|
|
|
genetic_pool_size >= 0 |
|
|
|
), "genetic_pool_size must be greater or equal to zero" |
|
|
|
self.genetic_pool_size = genetic_pool_size |
|
|
|
self.lb_memory = lb_memory |
|
|
|
self.lb_memory_mb = lb_memory_mb |
|
|
|
assert num_worker > 0, "num_worker must be greater or equal to one" |
|
|
|
self.num_worker = num_worker |