Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was 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

Description

@Vigilans

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions