Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel GS threads should call Hyperspace iterator one at a time #8435

Closed
exalate-issue-sync bot opened this issue May 11, 2023 · 1 comment
Closed

Comments

@exalate-issue-sync
Copy link

In the GridSearch class, there is

{code:java}
private MP getNextModelParams(final HyperSpaceWalker.HyperSpaceIterator hyperSpaceWalker, final Model model, final Grid grid){
MP params = null;

  while (params == null) {
    if (hyperSpaceWalker.hasNext(model)) {
      params = hyperSpaceWalker.nextModelParameters(model);
      final Key modelKey = grid.getModelKey(params.checksum(IGNORED_FIELDS_PARAM_HASH));
      if(modelKey != null){
        params = null;
      }
    } else {
      break;
    }
  }

  return params;
}

}
{code}
method which calls hyperspace iterator and asks for next model params. It is perfectly possible (but highly improbable) for two threads accessing the nextModelParams method to obtain the same parameters.

Solution is to use mutually exclusive access.

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Migration Info

Jira Issue: PUBDEV-7197
Assignee: Pavel Pscheidl
Reporter: Pavel Pscheidl
State: Resolved
Fix Version: 3.28.0.2
Attachments: N/A
Development PRs: Available

Linked PRs from JIRA

#4207

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

No branches or pull requests

1 participant