Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uprfc: introduce dropout primitive #760
Conversation
|
I agree that a standalone primitive is tempting, but what about making dropout an attribute (either a postop or a standalone attribute)? In that case, we could still support standalone dropout through eltwise (I guess in a first step), or fuse it with other operations (in a later step). |
| - User should pass seed in execute instead primitive_descriptor (in intial draft, | ||
| seed was passed in the primitive descriptor) | ||
| - User passes seed in execute using DNNL_ARG_SEED. Primitivie in | ||
| DNNL_ARG_SEED memory returns end-state of rng engine. In next calls of 'execute' |
mgouicem
Jun 19, 2020
Contributor
Isn't it enough to let the user pass a seed at each call to the execute function. If they need different seed, they can use any rng on their side to generate those.
Isn't it enough to let the user pass a seed at each call to the execute function. If they need different seed, they can use any rng on their side to generate those.
piotrchmiel
Jun 22, 2020
•
Author
Contributor
Based on statement above user is allowed to pass new seed. There are two use cases:
- user wants to run dropout with completely new seed - by specifying DNNL_ARG_SEED user can pass to execute in each run seed whatever he wants;
- user in next execution wants to use rng starting from end-state of previous execution - we allowing to do that by returning end seed.
At the end user all time is deciding what seed is passed to execution part.
Based on statement above user is allowed to pass new seed. There are two use cases:
- user wants to run dropout with completely new seed - by specifying DNNL_ARG_SEED user can pass to execute in each run seed whatever he wants;
- user in next execution wants to use rng starting from end-state of previous execution - we allowing to do that by returning end seed.
At the end user all time is deciding what seed is passed to execution part.
mgouicem
Jun 22, 2020
Contributor
I am not sure about the second use case since it will introduce a primitive state which can cause a few problems, especially with the use of the primitive cache. I would rather force the user to pass a seed, and default to some fixed value if the seed is not provided.
I am not sure about the second use case since it will introduce a primitive state which can cause a few problems, especially with the use of the primitive cache. I would rather force the user to pass a seed, and default to some fixed value if the seed is not provided.
piotrchmiel
Jun 23, 2020
Author
Contributor
- In our proposition user always must pass DNNL_ARG_SEED.
- Primitive is not storing in it's memory any state between executions. Let's consider proposed MCG31m1. Starting seed (base on passed initial seed) for each thread is computed as described in document MCG31m1 vectorised algorithm. We want also to compute "end seed" and return it to user the same way as we're returning tensors. User is deciding what seed will pass for next execution. He can take returned value and pass as DNNL_ARG_SEED or generate new custom value. Why do you think that it will affect primitive cache ?
- In our proposition user always must pass DNNL_ARG_SEED.
- Primitive is not storing in it's memory any state between executions. Let's consider proposed MCG31m1. Starting seed (base on passed initial seed) for each thread is computed as described in document MCG31m1 vectorised algorithm. We want also to compute "end seed" and return it to user the same way as we're returning tensors. User is deciding what seed will pass for next execution. He can take returned value and pass as DNNL_ARG_SEED or generate new custom value. Why do you think that it will affect primitive cache ?
|
@mgouicem Just to confirm few things:
|
|
@piotrchmiel , |
|
@mgouicem Ok, so if I understand correctly you're proposing attribute instead of post-ops, because you want to enable fused operation not only at the end of execution of the primitive, but also possibly in the middle where applicable.
|
Rendered document
RFC concerns introduction of dropout primitive in oneDNN. Full motivation is described inside document.