-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Allow user to generate images with initial noise as on M1 / mps system #981
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
Allow user to generate images with initial noise as on M1 / mps system #981
Conversation
|
@ArDiouscuros Do you have an M1? |
|
@Any-Winter-4079 |
|
Awesome! |
89c91c5 to
0b7ca6a
Compare
|
this should be called "use CPU noise", right? the thing that's special about random on MPS is that it doesn't support seeds, so we fallback to CPU. |
|
@Birch-san could we mimic cuda seed behavior on our CPU? |
@Any-Winter-4079 |
|
As far as I can tell whenever any project has wanted consistent random values across platforms they've always fallen back to using their 'own' random number algorithm rather than one built into the OS (or it this case CUDA API). Tends to be a variation on the Mersenne Twister Actually check the Wikipedia page for it. As an aside, II did actually have a play with replacing the noise function with one based on perlins noise, just wanted to see the affect, but I didn't get anything out of it. I was probably building the tensor wrong as I don't really get how a 5 dimension tensor fits together. |
|
On https://numba.pydata.org/numba-doc/0.33.0/cuda/random.html it says:
Is cuRAND the library in question and if so, maybe Also https://en.wikipedia.org/wiki/Xorshift
|
fun idea. dunno how. how about asking CUDA users to join us on CPU seed? 😛 |
|
@ArDiouscuros should we rename it to CPU noise as Birch San says? |
@Any-Winter-4079 sure, why not. |
|
Hi, just reviewed the code and it looks fine. I'll run on my system later today and merge unless I notice anything amiss. |
|
@lstein, @ArDiouscuros and @Any-Winter-4079: If you need someone with M1 to test things, feel free to mention me. I have a MacBook Air M1 2020 with 16GB RAM and 8GPU Cores. I would also have a MacBook Pro available from work, but since it is also "just" a 2020 Model with M1, it is not really different from my MacBook Air (since it already has the 8GPU cores, only difference would be the cooling system which is passive on MacBook Air models and Active on MacBook Pro 🙈 ) |
lstein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this, but since it is been lingering for a while, there are a bunch of conflicts that need to be resolved. I will attempt to do this..


@Any-Winter-4079
Any idea how to test it?