Created by: backyes
To avoid invalid data access at pserver end while doing prefetch. It could be helpful to understand crash at pserver end.
we implement the check at prefetch stage, so that we will have little performance penalty, because the data traversal is also done by prefetch.
TEST PASS using user's real data: With setting: data = data_layer(name="feature", size=908559). hidden1 = fc_layer(input=data, size=8, param_attr=ParameterAttribute(sparse_update=True))
the patch will capture the error sample in advance, otherwise the perver could crashed with unreadable LOG.
SparseRowMatrix.cpp:231] Check failed: (*(ids + i)) < (this->getHeight()) id:6919838Height:908559sparse id value exceeds the max input dimension, it could be caused invalid input data samples