Question on unique keys generation per operator instance
Created by: jczaja
Hi,
We are working on concept of storing/reusing once created MKLDNN primitives. This challenge requires to generate key for storing data in device context.
Currently key is a hash value generated in a quite complex way . which will be difficult to maintain as operators are modified eg. generating key name based on params of operator and sizes of input. To make things easier it would be good to have better method to generate keys that will be unique to the instance of operator.
One considered way is to used name of output tensor as key eg. ctx.op().Output("Out") . However this is not good enough, as it fails to work for more complex models like machine_translation.py where we have RNNs and block operators. For example: ctx.op().Output("Out") evaluates to "fc.tmp.2" in softmax operator in machine_translation.py . But it is not unique as we can inspect that there will be number of instances of softmax operator with the same name of output tensor but with diffrent input shape eg. (16,30000 fc.tmp.2) , (15, 30000 fc.tmp.2) (14, 30000 fc.tmp.2) etc. Hence ctx.op().Output("Out") is not good enough.
Please advice on key name generation that is guaranteed to be unique within considered iteration .