-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix sm100 gemm wrong static constexpr that breaks compilation on Windows #2167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This PR has been labeled |
Signed-off-by: Javier <25750030+SystemPanic@users.noreply.github.com>
include/cutlass/platform/platform.h
Outdated
@@ -523,7 +523,7 @@ using std::is_trivially_copyable; | |||
|
|||
#endif | |||
|
|||
#if (201703L <=__cplusplus) | |||
#if defined(_MSC_VER) || (201703L <=__cplusplus) |
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 looks like a symptom of another issue. What error did you see here?
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.
@d-k-b If defined(_MSC_VER)
is not included, is_unsigned_v
is missing.
For example, with the latest MSVC 2022 with CL 19.43.34810, it raises the following error:
include/cutlass/exmy_base.h(404): error: namespace "cutlass::platform" has no member "is_unsigned_v"
static_assert(cutlass::platform::is_unsigned_v<Storage>, "Use an unsigned integer for StorageType");
Related: https://learn.microsoft.com/es-es/cpp/build/reference/zc-cplusplus?view=msvc-170
If -Xcompiler=/Zc:__cplusplus
is added to NVCC, version is detected correctly without including defined(_MSC_VER)
I don't have the time to fully check if including defined(_MSC_VER)
in this place is problematic when compiling Cutlass with a standard lower than C++17, in my limited tests, it's not.
If it's the case, tell me and I remove it from the PR.
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.
The CUTLASS CMake code applies the __cplusplus
flag to MSVC compilation automatically. Is the error being seen with a build outside of CMake? I'd prefer we revert this change for this PR and then if it's needed for some scenario we handle it in a separate request.
Line 561 in 9d165a3
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus") |
#if defined(_MSC_VER) || (201703L <=__cplusplus) | |
#if (201703L <= __cplusplus) |
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.
Ok, I see where the problem is.
vLLM it's being built with CMake, but it's not adding CUTLASS in the standard way, so the MSVC specific flags
Line 561 in 9d165a3
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus") |
Commit reverted.
This reverts commit 2e8cfc1.
constexpr
was incorrectly added to the function definition only for this architecture, breaking the compilation of Cutlass on Windows.