Why can distributed hyperparameter tuning be non-deterministic even when a global seed is set?

Quick Overview

Asks why a distributed hyperparameter search can give different results across runs even with a global seed set. Tests your understanding of reproducibility in distributed tuning and training, and the practical steps and costs of making a search repeatable.

Why can distributed hyperparameter tuning be non-deterministic even when a global seed is set?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

You run a hyperparameter search across several distributed workers and set a global seed at the start. Why can the experiment still be non-deterministic from one run to the next? ```hint Two layers Separate what happens in the search algorithm from what happens inside a single training run. ``` ```hint Timing Ask what an asynchronous sampler or pruner can see at the moment it makes a decision, and whether the seed decides that. ``` ### What a Strong Answer Covers - What a global seed controls and what it leaves open. - Sources of variation in the search loop that the seed does not control. - Sources of variation inside a single training run. - Concrete mitigations and what each one costs. - A realistic reproducibility target and why. ### Follow-up Questions - How would you make an asynchronous Bayesian optimization run replayable without giving up parallelism entirely? - How would you tell whether the gap between the top two trials is real or within run-to-run noise? - What does `torch.use_deterministic_algorithms(True)` cost, and what happens to operations that have no deterministic implementation? - How should seeds be assigned to data-loader worker processes?

Overview: Asks why a distributed hyperparameter search can give different results across runs even with a global seed set. Tests your understanding of reproducibility in distributed tuning and training, and the practical steps and costs of making a search repeatable.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

You run a hyperparameter search across several distributed workers and set a global seed at the start. Why can the experiment still be non-deterministic from one run to the next?

What a Strong Answer Covers Guidance

  • What a global seed controls and what it leaves open.
  • Sources of variation in the search loop that the seed does not control.
  • Sources of variation inside a single training run.
  • Concrete mitigations and what each one costs.
  • A realistic reproducibility target and why.

Follow-up Questions Guidance

  • How would you make an asynchronous Bayesian optimization run replayable without giving up parallelism entirely?
  • How would you tell whether the gap between the top two trials is real or within run-to-run noise?
  • What does torch.use_deterministic_algorithms(True) cost, and what happens to operations that have no deterministic implementation?
  • How should seeds be assigned to data-loader worker processes?