Conversation
@willyd updated the pull request - view changes |
Thanks! We had some glitches in the pull request import process, and it's solved now. Will merge. |
@willyd updated the pull request - view changes |
@Yangqing has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@@ -6,6 +6,9 @@ | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#include <sys/stat.h> | |||
#if defined(_MSC_VER) | |||
#include <direct.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already being included further down on line 19.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly rebase and remove this?
caffe2/utils/GpuBitonicSort.cuh
Outdated
@@ -39,9 +39,11 @@ __device__ inline void bitonicSort(K* keys, | |||
// Assume the sort is taking place in shared memory | |||
// static_assert(Power2SortSize * (sizeof(K) + sizeof(V)) < 32768, | |||
// "sort data too large (>32768 bytes)"); | |||
static_assert(math::integerIsPowerOf2(Power2SortSize), | |||
static_assert(math::integerIsPowerOf2( | |||
std::integral_constant<int, Power2SortSize>()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be std::integral_constant<int, Power2SortSize>()::value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this seems to be needed, otherwise build errors.
caffe2/utils/GpuBitonicSort.cuh
Outdated
"sort size must be power of 2"); | ||
static_assert(math::integerIsPowerOf2(ThreadsPerBlock), | ||
static_assert(math::integerIsPowerOf2( | ||
std::integral_constant<int, ThreadsPerBlock>()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well
caffe2/utils/GpuBitonicSort.cuh
Outdated
@@ -107,7 +109,8 @@ __device__ inline void warpBitonicSort(K* keys, | |||
// Smaller sorts should use a warp shuffle sort | |||
static_assert(Power2SortSize > kWarpSize, | |||
"sort not large enough"); | |||
static_assert(math::integerIsPowerOf2(Power2SortSize), | |||
static_assert(math::integerIsPowerOf2( | |||
std::integral_constant<int, Power2SortSize>()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(kindly see comments above)
@willyd updated the pull request - view changes - changes since last import |
@willyd updated the pull request - view changes - changes since last import |
@Yangqing Thanks for the review. I rebased and removed the requested #include. Plus I fixed a few other issues. One that you might want to look into is the missing CMakeLists.txt file in |
Thanks @willyd - yeah, we traced the issue back to our sync script ignoring the CMakeLists.txt files during syncing, and we are fixing it. Let me pull the PR and land it if all checks out. |
@Yangqing has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@willyd updated the pull request - view changes - changes since last import |
@willyd do you mind rebase to master, and also address the std::integral_constant<int, Power2SortSize>()::value comment? |
- file_store_handler.cc: mkdir only accepts one argument and requires inclusion of <direct.h> - math.h: macro workaround does not work for integerIsPowerOf2 when prefixed with `math` namespace. - GpuBitonicSort.cuh: use std::integral_constant since nvcc ignores constexpr with MSVC - pool_op_cudnn.cu: undefine IN and OUT macros defined in minwindef.h - logging.cc: Prefix glog logging levels with name since MSVC cannot use the abbreviated macros
…ion problems with MSVC
@willyd updated the pull request - view changes - changes since last import |
@willyd updated the pull request - view changes - changes since last import |
@Yangqing Rebase done. Also addressed the |
@Yangqing has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@harouwu I rebased on master last time @Yangqing asked. Since then 69 new commits have been pushed to master, but none of them have conflicting changes as per github. I don't see the need for another rebase, can you please elaborate on why I would need to rebase again? I am basically waiting for his feedback or for him to merge the PR. |
Did a fresh build from latest master commit @ 799d7cc. Merged with this pull request @ 6784956. Successful compilation with the following change: Minor issue where MSVC complains about type narrowing conversions in {base}\caffe2\caffe2\layer_norm_op.cu at lines 264 and 294. 264: gscratch_.Resize(std::vector<size_t>{left, right}); 294: dstdev_.Resize(vector<size_t>{left, 1}); Looks promising after successful convnet_benchmark runs for AlexNet, OverFeat, Inception. VGGA model crashes. MLP returns with error: Traceback (most recent call last): |
- Narrowing conversions in image_input_op.h, batch_matmul_op.cc and layer_norm_op.cu - Removed ThreadPool.cc from Windows build since it requires pthread
@willyd updated the pull request - view changes - changes since last import |
@willyd This PR is very useful, I have compiled successfully, thanks. Hope it could be merged soon. |
@willyd updated the pull request - view changes - changes since last import |
caffe2 (CPU and C++ only) is now available on windows via vcpkg. Installing should be as simple as: |
to compile with MSVC
Not sure if this is the best place to mention this - and it might be covered by the PRs here - some of the other issues I had were. |
@@ -56,6 +56,14 @@ option(USE_ROCKSDB "Use RocksDB" ON) | |||
option(USE_SNPE "Use Qualcomm's SNPE library" OFF) | |||
option(USE_THREADS "Use Threads" ON) | |||
option(USE_ZMQ "Use ZMQ" OFF) | |||
if(MSVC) | |||
if(BUILD_BUILD_SHARED_LIBS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the variable be 'BUILD_SHARED_LIBS'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aralph You are right! Thanks for pointing out. I must'nt have had enough coffee when I wrote this. When I get back to caffe2 on Windows I will update the PR.
Hi, I tried add the dependencies of cuda library in VS 2015, but it didn't work. |
Thank you for your contribution! PyTorch and Caffe2 are now officially merged with the PyTorch 1.0 preview release. Please submit on https://github.com/pytorch/pytorch if this is still an issue over there. |
mkdir
only accepts one argument and requires inclusion of <direct.h>math
namespace.std::integral_constant
since nvcc ignores constexpr with MSVC (fixes Compile Error on Windows #997)IN
andOUT
macros defined inminwindef.h