access2rohit commented on a change in pull request #17444: [Large Tensor] Add
LT support for NN optimizers and 1 activation function
URL: https://github.com/apache/incubator-mxnet/pull/17444#discussion_r374382517
##########
File path: src/operator/optimizer_op-inl.h
##########
@@ -225,7 +225,7 @@ struct MultiSGDKernelParam {
template <typename MPDType, bool has_momentum, bool has_mixed_precision>
struct MultiSGDKernel {
template<typename DType>
- MSHADOW_XINLINE static void Map(int i, const MultiSGDKernelParam<DType,
MPDType>& param,
+ MSHADOW_XINLINE static void Map(index_t i, const MultiSGDKernelParam<DType,
MPDType>& param,
const OpReqType req) {
for (int index = 0; index < param.count; ++index) {
if ((size_t)i < param.sizes[index]) {
Review comment:
> @ChaiBapchya size_t is platform dependent. It is safer to static_cast
param.sizes[index] to index_t. When large tensor is not enabled and
param.sizes[index] is greater than 2^32 we already have error check at python
level.
@apeforest @szhengac sinze size_t is platform dependent even if we build
with large tensor flag int64_t won't be supported there if size_t is not
uint_64. My concern here is: "if the value of (param.sizes[index])is between
2^63 and 2^64-1 then type casting it to int64_t will corrupt the value, which
is incorrect. Let me know if you need more details to understand this use case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services