forked from flashinfer-ai/flashinfer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: refactor cutlass includes (flashinfer-ai#594)
Move cutlass utilities outside of gemm folder as we are about to use cutlass for attention kernels. This PR also bumps cutlass version to v3.6.0, where the cutlass include order issue (flashinfer-ai#589) was resolved (it was fixed by https://github.com/NVIDIA/cutlass/blob/d656afbd2a01112c0e4d90aafe0f8f78145c6585/include/cutlass/epilogue/collective/collective_builder.hpp#L106 ).
- Loading branch information
Showing
8 changed files
with
84 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright (c) 2024 by FlashInfer team. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#ifndef FLASHINFER_CUTLASS_UTILS_CUH_ | ||
#define FLASHINFER_CUTLASS_UTILS_CUH_ | ||
|
||
#include <cuda_runtime.h> | ||
#include <cutlass/cutlass.h> | ||
|
||
#include "cute/tensor.hpp" | ||
#include "cutlass/cutlass.h" | ||
#include "cutlass/epilogue/collective/collective_builder.hpp" | ||
#include "cutlass/epilogue/collective/default_epilogue.hpp" | ||
#include "cutlass/epilogue/thread/linear_combination.h" | ||
#include "cutlass/gemm/collective/collective_builder.hpp" | ||
#include "cutlass/gemm/device/gemm_grouped.h" | ||
#include "cutlass/gemm/device/gemm_universal_adapter.h" | ||
#include "cutlass/gemm/dispatch_policy.hpp" | ||
#include "cutlass/gemm/group_array_problem_shape.hpp" | ||
#include "cutlass/gemm/kernel/default_gemm_grouped.h" | ||
#include "cutlass/gemm/kernel/gemm_universal.hpp" | ||
#include "cutlass/layout/matrix.h" | ||
#include "cutlass/numeric_types.h" | ||
#include "cutlass/tensor_ref.h" | ||
#include "cutlass/util/command_line.h" | ||
#include "cutlass/util/distribution.h" | ||
#include "cutlass/util/host_tensor.h" | ||
#include "cutlass/util/packed_stride.hpp" | ||
#include "cutlass/util/reference/device/gemm.h" | ||
#include "cutlass/util/reference/device/tensor_compare.h" | ||
#include "cutlass/util/reference/device/tensor_fill.h" | ||
#include "cutlass/util/tensor_view_io.h" | ||
|
||
namespace flashinfer { | ||
|
||
template <typename T> | ||
struct cutlass_dtype { | ||
using value = T; | ||
}; | ||
|
||
template <> | ||
struct cutlass_dtype<half> { | ||
using value = cutlass::half_t; | ||
}; | ||
|
||
template <> | ||
struct cutlass_dtype<nv_bfloat16> { | ||
using value = cutlass::bfloat16_t; | ||
}; | ||
|
||
template <> | ||
struct cutlass_dtype<__nv_fp8_e4m3> { | ||
using value = cutlass::float_e4m3_t; | ||
}; | ||
|
||
template <> | ||
struct cutlass_dtype<__nv_fp8_e5m2> { | ||
using value = cutlass::float_e5m2_t; | ||
}; | ||
|
||
} // namespace flashinfer | ||
|
||
#endif // FLASHINFER_CUTLASS_UTILS_CUH_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters