DP - Getting tensor properties #1649
Labels
feature
Is an improvement or enhancement
help wanted
Open to be worked on
priority: 0
High priority task
won't fix
This will not be worked on
🐛 Bug
In validation step, I get a metric computed on parameters tensor that have an attribute that is set when initializing the network. E.g. some parameters have a binary flag "ptype" attached like so :
tensor.ptype = True
.It works well with Pytorch native DataParallel or with single GPU. However, when using Lightning DataParallel the issue is that the validation step is done on a child process for which only the network replica exist: however those replica do not preserve tensors arbitrary properties.
To Reproduce
Steps to reproduce the behavior:
[param.ptype for param in self.model.parameters() if hasattr(param, 'ptype')]
Code sample
See above.
Expected behavior
The returned list shouldn't be empty. On another hand, since the metric is a constant across replica, the function needn't be run in parallel.
Environment
The text was updated successfully, but these errors were encountered: