-
Notifications
You must be signed in to change notification settings - Fork 705
Open
Labels
minor bugBugs that aren't too bad, only concern documentation, or have easy work-aroundsBugs that aren't too bad, only concern documentation, or have easy work-arounds
Description
Hi,
as far as I understand, we are allowed to create one computational graph per thread (or we can use the dynet multi-processing API).
Of course, parameters are shared (but not expressions).
However, the RNN API, using builder.new_graph(cg), does not seems thread-safe (ie. states are shared between threads).
In the example provided:
- this function is called for each thread https://github.com/clab/dynet/blob/master/examples/multiprocessing/rnnlm.h#L35
- one expression is created in each thread for each parameter, for example : https://github.com/clab/dynet/blob/master/examples/multiprocessing/rnnlm.h#L39
- however, the RNN internal expressions are shared https://github.com/clab/dynet/blob/master/examples/multiprocessing/rnnlm.h#L37
Metadata
Metadata
Assignees
Labels
minor bugBugs that aren't too bad, only concern documentation, or have easy work-aroundsBugs that aren't too bad, only concern documentation, or have easy work-arounds