lmcinnes / lmcinnes/umap

Setting random_state and multi-threading

Open
#853 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.3k
Forks
871
Avg merge
1d 13h
Merged PRs (30d)
5

Description

Hi,

I wanted to report a bug I’ve noticed in setting random_state. The documentation regarding UMAP reproducibility (https://umap-learn.readthedocs.io/en/latest/reproducibility.html) seems to be incorrect in saying that setting random_state will halt multi-threading. When running UMAP on the same data with the same random_state set, the results vary when I allocate a single core vs. many cores (16).

Parameters: UMAP(n_components=3, a=2.0, b=1.5, random_state=42)

First instance components with single core: (10.861118, 3.735592, 8.769404)
First instance components with 16 cores: (11.034830, 4.050596, 8.633882)

Info:
Python 3.9.7
umap-learn 0.5.2
numpy 1.21.2
numba 0.55.1

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproducibility documentation linked in the issue and run UMAP with n_components=3, a=2.0, b=1.5, and random_state=42 using one core and 16 cores. Compare the reported component values and determine whether the implementation or the documentation needs to change so the reproducibility claim matches observed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.