Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

dmlc::type_name_helper<T> specialization of mxnet::tuple<T> should not be disabled for MSVC #15143

Closed
Vigilans opened this issue Jun 4, 2019 · 4 comments · Fixed by #15144
Closed
Labels

Comments

@Vigilans
Copy link
Contributor

Vigilans commented Jun 4, 2019

Description

In this PR, @junrushao1994 brought mxnet::Tuple<T> to mxnet.

For the specialization of dmlc::type_name_helper<T>, it was disabled completely for MSVC:

namespace dmlc {
/*! \brief description for optional TShape */
DMLC_DECLARE_TYPE_NAME(optional<mxnet::TShape>, "Shape or None");
DMLC_DECLARE_TYPE_NAME(optional<mxnet::Tuple<int>>, "Shape or None");
// avoid low version of MSVC
#if !defined(_MSC_VER) // <----------- Here
template<typename T>
struct type_name_helper<mxnet::Tuple<T> > {
  static inline std::string value() {
    return "tuple of <" + type_name<T>() + ">";
  }
};
#endif
}  // namespace dmlc

It then brought up an issue that has not been solved in 4 months: #14116, and costed me some effort to dig it out.

Since this choice brought more problem than it was intended to solve ("avoid low version of MSVC"), I think we should at least:

  • allow the condition to pass on newer version of visual studio (at least 2015 and later)
  • or remove the #if block completely.

Build info

Compiler: Visual Studio 2019

MXNet commit hash: 9125f6a

Build config:

cmake -G "Visual Studio 16 2019" -DCMAKE_TOOLCHAIN_FILE=C:/Programs/Vcpkg/scripts/buildsystems/vcpkg.cmake -A x64 -T host=x64  -DUSE_CUDA=0 -DUSE_CUDNN=0 -DUSE_NVRTC=1 -DUSE_OPENCV=1 -DUSE_OPENMP=1 -DUSE_BLAS=mkl -DUSE_MKLDNN=1 -DUSE_LAPACK=1 -DUSE_DIST_KVSTORE=0 -DUSE_CPP_PACKAGE=1 "C:/Programs/mxnet"

Error Message:

1>"Running: OpWrapperGenerator.py"
1>D:/Projects/MXNet-versions/MxNet1-3-1/build/Release/libmxnet.dll
1>argument "lrs" of operator "multi_sgd_update" has unknown type ", required"
1>argument "wds" of operator "multi_sgd_update" has unknown type ", required"
1>argument "lrs" of operator "multi_sgd_mom_update" has unknown type ", required"
1>argument "wds" of operator "multi_sgd_mom_update" has unknown type ", required"
1>argument "lrs" of operator "multi_mp_sgd_update" has unknown type ", required"
1>argument "wds" of operator "multi_mp_sgd_update" has unknown type ", required"
1>argument "lrs" of operator "multi_mp_sgd_mom_update" has unknown type ", required"
1>argument "wds" of operator "multi_mp_sgd_mom_update" has unknown type ", required"

Steps to reproduce

See #14116 (comment)

What have you tried to solve it?

See #14116 (comment)

Environment info

----------Python Info----------
Version      : 3.7.1
Compiler     : MSC v.1915 64 bit (AMD64)
Build        : ('default', 'Dec 10 2018 22:54:23')
Arch         : ('64bit', 'WindowsPE')
------------Pip Info-----------
Version      : 18.1
Directory    : C:\Programs\Anaconda3\lib\site-packages\pip
----------MXNet Info-----------
Version      : 1.4.1
Directory    : C:\Programs\Anaconda3\lib\site-packages\mxnet
Hashtag not found. Not installed from pre-built package.
----------System Info----------
Platform     : Windows-10-10.0.17763-SP0
system       : Windows
node         : SRTP-desktop
release      : 10
version      : 10.0.17763
----------Hardware Info----------
machine      : AMD64
processor    : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
Name
Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz

Package used (Python/R/Scala/Julia): Cpp

@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Feature

@junrushao
Copy link
Member

(CC: @reminisce)

Thanks for bringing this up! Please be aware that I am not the original author of the file, and I am not super familiar with MSVC.

@reminisce Is there any reason that we disable this?

@leleamol
Copy link
Contributor

leleamol commented Jun 7, 2019

@mxnet-label-bot add [Windows]

@JiaoPaner
Copy link

JiaoPaner commented Sep 20, 2019

I read the #15144 ,modified the line " #if !defined(_MSC_VER)" which is 744 to "#if !(defined(_MSC_VER) && _MSC_VER < 1900)" .Then, compile again that config includes USE_CPP_PACKAGE, my operating system is win10 x64 and IDE is Visual Studio 2015.
After that the compile result has no any errors and no any above errors.
And the examples can run without error , the solution does work.

zachgk pushed a commit that referenced this issue Sep 20, 2019
Relax Visual Studio version constraint in the specialization of `dmlc::type_name_helper<DT>` for `DT=mxnet::Tuple<T>`
drivanov pushed a commit to drivanov/incubator-mxnet that referenced this issue Sep 26, 2019
Relax Visual Studio version constraint in the specialization of `dmlc::type_name_helper<DT>` for `DT=mxnet::Tuple<T>`
larroy pushed a commit to larroy/mxnet that referenced this issue Sep 28, 2019
Relax Visual Studio version constraint in the specialization of `dmlc::type_name_helper<DT>` for `DT=mxnet::Tuple<T>`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
6 participants