# Parallel HPO when using \`trainer.hyperparameter\_search()\`

**URL:** <https://discuss.huggingface.co/t/parallel-hpo-when-using-trainer-hyperparameter-search/13226>\
**Category:** 🤗Transformers\
**Created:** [December 30, 2021, 2:37am UTC](https://discuss.huggingface.co/t/parallel-hpo-when-using-trainer-hyperparameter-search/13226 "2021-12-30T02:37:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrRobot](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@MrRobot](https://discuss.huggingface.co/u/MrRobot)\
**Post date:** [December 30, 2021, 2:37am UTC](https://discuss.huggingface.co/t/parallel-hpo-when-using-trainer-hyperparameter-search/13226/1 "2021-12-30T02:37:23Z")

</div>

One of the features of `optuna` is its support for asynchronous parallelization of trials across multiple devices (see its [doc](https://optuna.readthedocs.io/en/stable/tutorial/10_key_features/004_distributed.html)) . But from my experiences of using `trainer.hyperparameter_search()`, it seems that different trials are executed one after another. So even though I do have access to multiple devices, I could not leverage them for parallel HPO.

I am wondering if it is possible to use the parallelization feature of `optuna`. Any input is appreciated.
