question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When and how one can set a random seed for Chainer

See original GitHub issue

I cannot find any guarantee on how to set a random seed to make Chainer deterministic. I want Chainer to clarify when and how it is deterministic.

numpy.random.seed and cupy.random.seed may work, but there seems no guarantee that Chainer has no other random sources, and I can find some exceptions: cudnn, atomicAdd (https://groups.google.com/forum/#!topic/chainer-jp/JN9H9aF4TA8), https://github.com/chainer/chainer/blob/master/chainer/datasets/sub_dataset.py, https://github.com/chainer/chainer/blob/master/chainer/functions/connection/n_step_rnn.py.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kmaehashicommented, Jun 18, 2018

We discussed offline:

  • We need to document how to make Chainer computation deterministic.
  • We need system to show warnings for non-deterministic computations, e.g.,
    • introduce decorator (like @chainer.non_deterministic) to annotate known non-deterministic functions (e.g., using atomicAdd)
    • introduce configuration option (like chainer.config.check_deterministic)
    • if the configuration is True and the function with the annotation is invoked, raise warning.
0reactions
Crissmancommented, Feb 21, 2019

After discussion, we’ve decided that the PRs done covers the issue of flagging code which is non-deterministic, and cannot be given a seed. Closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variables — Chainer 3.5.0 documentation
Here are the environment variables Chainer uses. Default seed value of random number generators for CUDA. If it is not set, the seed...
Read more >
Randomness FAQs - Gnosis Chain
How do I generate multiple random numbers from a single block? It is possible to create an on-chain PRNG where the currentSeed value...
Read more >
[R] Random seed problem in MCMC coupling of chains
This is really neat and simple. I am just wondering if this is OK from "RNG point of view". Can someone comment on...
Read more >
How to generate random numbers on-chain?
Players commit a hash and after the reveal, all the secrets could be smashed together to generate the seed for your randomness. Obviously,...
Read more >
Random Numbers: Using Chainlink VRF
What is the payment process for generating a random number? How can I use Chainlink VRF? Create and fund a subscription; Importing VRFConsumerBaseV2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found