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

[Data] seed not respected in Dataset.random_sample() #48497

Open
scottjlee opened this issue Nov 1, 2024 · 0 comments · May be fixed by #49443
Open

[Data] seed not respected in Dataset.random_sample() #48497

scottjlee opened this issue Nov 1, 2024 · 0 comments · May be fixed by #49443
Labels
bug Something that is supposed to be working; but isn't data Ray Data-related issues P1 Issue that should be fixed within a few weeks

Comments

@scottjlee
Copy link
Contributor

scottjlee commented Nov 1, 2024

What happened + What you expected to happen

When running Dataset.random_sample() multiple times with the same seed, the resulting dataset is not consistent. We would expect that with a fixed seed, the output dataset is reproducible and deterministic.

Versions / Dependencies

ray master (ray 2.38)

Reproduction script

import ray

ds = ray.data.range(1219)
ds = ds.random_sample(0.1, seed=0)
check1 = ds.count()
print(f"=== Check 1: {check1}")

check2 = ds.count()
print(f"=== Check 2 {check2}")

assert check1 == check2, f"{check1=} vs. {check2=}"

Without the

Issue Severity

Medium: It is a significant difficulty but I can work around it.

@scottjlee scottjlee added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) P1 Issue that should be fixed within a few weeks data Ray Data-related issues and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 1, 2024
@Jay-ju Jay-ju linked a pull request Dec 26, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't data Ray Data-related issues P1 Issue that should be fixed within a few weeks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant