mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Windows shared build (#13550)
Summary: Hi guys, I'd like to build Caffe2 with more supported options in Windows with Microsoft Visual Studios. This is the first pull request. Running scripts/build_windows_shared.bat is able to build Caffe2 with both CMAKE_BUILD_TYPE=Debug and CMAKE_BUILD_TYPE=Release with Visual Studio 14 2015. CUDA is 9.0, cudnn is 7.0.5, glog, gflags and lmdb are supported on my system. Python is 3.5, Detectron works from python interface as well. It was even possible to debug detectron code and step into caffe2_gpu.dll with pdbs built. What is disappointing, that c10/experimental ops don't build with this Visual Studio generator, I added special option INCLUDE_EXPERIMENTAL_C10_OPS (default ON) to deal with it in build_windows_shared.bat. After this pull request the next step is to add Visual Studio 2017 support in the script. Pull Request resolved: https://github.com/pytorch/pytorch/pull/13550 Reviewed By: ezyang Differential Revision: D13042597 Pulled By: orionr fbshipit-source-id: f313f909f599cd582a1d000eff766eef3a9fc4fc
This commit is contained in:
committed by
Facebook Github Bot
parent
2c21de2007
commit
8e91da4cb3
@ -1,9 +1,4 @@
|
||||
# ---[ Add modules
|
||||
# TODO(orionr): Enable Detectron ops for Windows DLL when we
|
||||
# can figure out how to get it to build
|
||||
if (NOT (MSVC AND BUILD_SHARED_LIBS))
|
||||
add_subdirectory(detectron)
|
||||
endif()
|
||||
add_subdirectory(detectron)
|
||||
add_subdirectory(module_test)
|
||||
add_subdirectory(observers)
|
||||
add_subdirectory(rocksdb)
|
||||
|
@ -19,24 +19,22 @@ void NetObserverReporterPrint::report(
|
||||
for (auto& p : info) {
|
||||
if ((p.first == "NET_DELAY") && (info.size() == 1)) {
|
||||
// for Net_delay perf
|
||||
caffe2_perf.push_back(
|
||||
{{"type", "NET"},
|
||||
{"value", caffe2::to_string(p.second.latency * 1000)},
|
||||
{"unit", "us"},
|
||||
{"metric", "latency"}});
|
||||
caffe2_perf.push_back({{"type", "NET"},
|
||||
{"value", c10::to_string(p.second.latency * 1000)},
|
||||
{"unit", "us"},
|
||||
{"metric", "latency"}});
|
||||
} else if (p.first != "NET_DELAY") {
|
||||
// for operator perf
|
||||
std::string shape_str = get_tensor_shapes(p.second);
|
||||
std::string args_str = get_op_args(p.second);
|
||||
|
||||
caffe2_perf.push_back(
|
||||
{{"type", p.first},
|
||||
{"value", caffe2::to_string(p.second.latency * 1000)},
|
||||
{"unit", "us"},
|
||||
{"metric", "latency"}});
|
||||
caffe2_perf.push_back({{"type", p.first},
|
||||
{"value", c10::to_string(p.second.latency * 1000)},
|
||||
{"unit", "us"},
|
||||
{"metric", "latency"}});
|
||||
if (p.second.flops > 0) {
|
||||
caffe2_perf.push_back({{"type", p.first},
|
||||
{"value", caffe2::to_string(p.second.flops)},
|
||||
{"value", c10::to_string(p.second.flops)},
|
||||
{"unit", "flop"},
|
||||
{"metric", "flops"}});
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ caffe2::string PerfNetObserver::getObserverName(const OperatorBase* op, int idx)
|
||||
: "NO_OUTPUT")
|
||||
: "NO_DEF");
|
||||
caffe2::string name =
|
||||
"ID_" + caffe2::to_string(idx) + "_" + opType + "_" + displayName;
|
||||
"ID_" + c10::to_string(idx) + "_" + opType + "_" + displayName;
|
||||
return name;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user