[Question/Design] Make Trial serializable with cloudpickle
Author: ocramz-mhcCreated Mar 4, 2026Updated Mar 26, 2026
Labelsfeature
Motivation
The design of study.optimize(callback, ..., n_jobs = ...) lends itself to parallel execution i.e. callback could be a remote procedure call.
However for this to work, Trial should be serializable whereas currently it is not (it holds some state which cannot be reconstructed across the wire).
Would this even be possible? What are the tradeoffs involved?
Description
This is just an exploratory question, but I imagine the change would entail some heavy refactoring.
Alternatives (optional)
No response
Additional context (optional)
No response
Source: optuna/optuna