Skip to content

Commit

Permalink
Unify memeff code with CUTLASS
Browse files Browse the repository at this point in the history
ghstack-source-id: f3aa0ec09f8f763d6b7150781e485d1bbdc277d9
Pull Request resolved: https://github.com/fairinternal/xformers/pull/431

__original_commit__ = fairinternal/xformers@0032bbc276ba1696a398e4da8eb4fc5ddfd37477
  • Loading branch information
danthe3rd authored and xFormers Bot committed Jan 19, 2023
1 parent 814314d commit 2e65321
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions xformers/csrc/attention/cuda/fmha/debug_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct __string_view {
char const* data;
std::size_t size;
};
#if __cplusplus >= 201402L
template <class T>
constexpr __string_view __get_type_name() {
char const* p = __PRETTY_FUNCTION__;
Expand All @@ -83,6 +84,12 @@ constexpr __string_view __get_type_name() {
}
return {};
}
#else
template <class T>
constexpr __string_view __get_type_name() {
return {"unsupported", 11};
}
#endif

// Print a given array
#define PRINT_ACCUM8_T0_L0_START(name, accum, start) \
Expand Down
2 changes: 1 addition & 1 deletion xformers/csrc/attention/cuda/fmha/find_default_mma.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
\brief Cutlass provides helper template functions to figure out the right
datastructures to instanciate to run a GEMM with various parameters (see
`cutlass/gemm/threadblock/default_mma.h`). However, due to template
instanciation priority rules, it will only create an MmaMultiStage with
instantiation priority rules, it will only create an MmaMultiStage with
kStages=3 (otherwise creates an MmePipelined - which is not compatible with
FastF32). kStages=3 uses too much shared memory and we want to use kStages=2,
so we just copy-pasted some code from `default_mma.h` and
Expand Down

0 comments on commit 2e65321

Please sign in to comment.