File tree Expand file tree Collapse file tree 6 files changed +34
-17
lines changed
fbgemm_gpu/experimental/gen_ai/src/quantize
common/include/fbgemm_gpu/quantize Expand file tree Collapse file tree 6 files changed +34
-17
lines changed Original file line number Diff line number Diff line change 11
11
#include < climits>
12
12
#include < cstdint>
13
13
14
- #include < ATen/cuda/CUDAContext.h>
15
-
16
14
namespace fbgemm_gpu {
17
15
18
16
constexpr int64_t nextPowerOf2 (int64_t num) {
@@ -21,19 +19,4 @@ constexpr int64_t nextPowerOf2(int64_t num) {
21
19
return 1 << (CHAR_BIT * sizeof (num) - __builtin_clz (num - 1 ));
22
20
}
23
21
24
- inline int getDeviceArch () {
25
- static int arch = []() {
26
- const int majorVersion =
27
- at::cuda::getDeviceProperties (at::cuda::current_device ())->major ;
28
- if (majorVersion >= 10 ) {
29
- int runtimeVersion = 0 ;
30
- C10_CUDA_CHECK (cudaRuntimeGetVersion (&runtimeVersion));
31
- TORCH_CHECK (
32
- runtimeVersion >= 12080 , " SM100a+ kernels require cuda >= 12.8" );
33
- }
34
- return majorVersion;
35
- }();
36
- return arch;
37
- }
38
-
39
22
} // namespace fbgemm_gpu
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ #pragma once
10
+
11
+ #include < ATen/cuda/CUDAContext.h>
12
+
13
+ namespace fbgemm_gpu {
14
+
15
+ inline int getDeviceArch () {
16
+ static int arch = []() {
17
+ const int majorVersion =
18
+ at::cuda::getDeviceProperties (at::cuda::current_device ())->major ;
19
+ if (majorVersion >= 10 ) {
20
+ int runtimeVersion = 0 ;
21
+ C10_CUDA_CHECK (cudaRuntimeGetVersion (&runtimeVersion));
22
+ TORCH_CHECK (
23
+ runtimeVersion >= 12080 , " SM100a+ kernels require cuda >= 12.8" );
24
+ }
25
+ return majorVersion;
26
+ }();
27
+ return arch;
28
+ }
29
+
30
+ } // namespace fbgemm_gpu
Original file line number Diff line number Diff line change 12
12
#include " bf16bf16bf16_grouped/bf16bf16bf16_grouped_manifest.cuh"
13
13
#include " fbgemm_gpu/quantize/tuning_cache.hpp"
14
14
#include " fbgemm_gpu/quantize/utils.h"
15
+ #include " fbgemm_gpu/quantize/utils_gpu.h"
15
16
16
17
namespace fbgemm_gpu {
17
18
Original file line number Diff line number Diff line change 13
13
#include " f8f8bf16_groupwise/f8f8bf16_groupwise_manifest.cuh"
14
14
#include " fbgemm_gpu/quantize/tuning_cache.hpp"
15
15
#include " fbgemm_gpu/quantize/utils.h"
16
+ #include " fbgemm_gpu/quantize/utils_gpu.h"
16
17
17
18
namespace fbgemm_gpu {
18
19
Original file line number Diff line number Diff line change 11
11
#include " f8f8bf16_rowwise_batched/f8f8bf16_rowwise_batched_manifest.cuh"
12
12
13
13
#include " fbgemm_gpu/quantize/utils.h"
14
+ #include " fbgemm_gpu/quantize/utils_gpu.h"
14
15
15
16
namespace fbgemm_gpu {
16
17
Original file line number Diff line number Diff line change 14
14
#include " f8f8bf16_rowwise_grouped_sm100/f8f8bf16_rowwise_grouped_manifest.cuh"
15
15
#include " fbgemm_gpu/quantize/tuning_cache.hpp"
16
16
#include " fbgemm_gpu/quantize/utils.h"
17
+ #include " fbgemm_gpu/quantize/utils_gpu.h"
17
18
18
19
namespace fbgemm_gpu {
19
20
You can’t perform that action at this time.
0 commit comments