Performance issue debugging #518
-
Coming from MilesCranmer/SymbolicRegression.jl#270 (comment) If the time complexity roughly scales as It runs on 4 nodes each with 64 icelake cores for almost 2 days, and evaluates about 5e4 expr/sec. model = pysr.PySRRegressor(
# Search Space & Complexity
binary_operators=['+', '-', '*', '/', 'pow'],
unary_operators=['exp', 'log', 'tanh_p1(x) = tanh(x)+1',
'atan_p1(x) = atan(x)+1', 'alg_sgmd(x) = x/sqrt(x^2+1)'],
extra_sympy_mappings={
'tanh_p1': lambda x: sympy.tanh(x) + 1,
'atan_p1': lambda x: sympy.atan(x) + 1,
'alg_sgmd': lambda x: x / sympy.sqrt(x**2 + 1)
},
maxsize=64,
full_objective=objective,
parsimony=1e-5,
adaptive_parsimony_scaling=1e3,
# Search Size
niterations=1000000,
populations=num_cores*4,
ncyclesperiteration=10000,
# Mutations
weight_simplify=0.01,
weight_optimize=0.01,
# Performance and Parallelization
procs=num_cores,
cluster_manager='slurm',
batching=True,
batch_size=1000,
turbo=True,
# Monitoring
verbosity=1,
print_precision=2,
progress=False,
) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @eelregit, Sorry, I forget if you already solved this. Is this issue still in place? One quick tip is that the batch size is very large. I usually do batch size of 50 or even less. With 1000 points batch size and 7000 total, you might as well just run on the total dataset (because non-contiguous slicing can be expensive). Also the Also what is the Cheers, |
Beta Was this translation helpful? Give feedback.
Hey @eelregit,
Sorry, I forget if you already solved this. Is this issue still in place?
One quick tip is that the batch size is very large. I usually do batch size of 50 or even less. With 1000 points batch size and 7000 total, you might as well just run on the total dataset (because non-contiguous slicing can be expensive).
Also the
weight_optimize=0.01
is a bit high. Generally constant optimization is the bottleneck, and you are doing it more frequently than normal (I usually do 0.001 or less, even for multi-node). Especially with a large maxsize and large batches, it perhaps is not too surprising that it is quite slow in the search.Also what is the
objective
here you are using?Cheers,
…