/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/fused_moe/kernel/fused_moegemm_tile_partitioner.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/fused_moe/kernel/fused_moegemm_tile_partitioner.hpp Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/fused_moe/kernel/fused_moegemm_tile_partitioner.hpp Source File
fused_moegemm_tile_partitioner.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
2 // Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
3 
4 #pragma once
5 
6 namespace ck_tile {
7 
8 template <typename BlockShape_>
10 {
11  // FusedMoeGemmShape
13 
14  static constexpr const char* name = "lin";
15 
16  CK_TILE_DEVICE auto operator()(ck_tile::index_t /*num_sorted_tiles*/,
17  ck_tile::index_t /*intermediate_size*/)
18  {
19  index_t i_n = blockIdx.x;
20  index_t i_m = blockIdx.y;
21 
22  return ck_tile::make_tuple(i_m, i_n);
23  }
24 
25  CK_TILE_HOST static constexpr auto GridSize(index_t max_tokens, index_t intermediate_size)
26  {
27  // TODO: this may need tuning
28  index_t ms = ck_tile::integer_divide_ceil(max_tokens, BlockShape::Block_M0);
29  index_t ns = ck_tile::integer_divide_ceil(intermediate_size, BlockShape::Block_N0);
30  return dim3(ns, ms, 1);
31  }
32 };
33 } // namespace ck_tile
#define CK_TILE_DEVICE
Definition: config.hpp:41
#define CK_TILE_HOST
Definition: config.hpp:40
Definition: cluster_descriptor.hpp:13
constexpr CK_TILE_HOST_DEVICE auto integer_divide_ceil(X x, Y y)
Definition: math.hpp:149
int32_t index_t
Definition: integer.hpp:9
remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
Definition: type_traits.hpp:21
constexpr CK_TILE_HOST_DEVICE auto make_tuple(Xs &&... xs)
Definition: tuple.hpp:360
Definition: fused_moegemm_tile_partitioner.hpp:10
CK_TILE_DEVICE auto operator()(ck_tile::index_t, ck_tile::index_t)
Definition: fused_moegemm_tile_partitioner.hpp:16
ck_tile::remove_cvref_t< BlockShape_ > BlockShape
Definition: fused_moegemm_tile_partitioner.hpp:12
static constexpr CK_TILE_HOST auto GridSize(index_t max_tokens, index_t intermediate_size)
Definition: fused_moegemm_tile_partitioner.hpp:25
static constexpr const char * name
Definition: fused_moegemm_tile_partitioner.hpp:14