Skip to content

Conversation

@nicha-api
Copy link
Owner

Allow catch kwarg passthrough in Trainer.hyperparameter_search(backend="optuna") in order to expose Optuna’s Study.optimize(..., catch=...) argument by popping out catch kwargs before calling Optuna's study.optimize().

Motivation
The current Hugging Face Transformers integration with Optuna does not expose Optuna’s Study.optimize(..., catch=...) argument.
As a result, when a trial raises an exception (e.g., CUDA OOM, data mismatch, tokenizer failure, nan/inf loss), the entire hyperparameter search stops prematurely instead of marking the trial as failed or pruned.

Adding support for a catch parameter—forwarded to Optuna’s backend—would allow users to continue tuning even when individual trials encounter errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants