XeTLA v0.3.6
IntelĀ® Xe Templates for Linear Algebra - API Definition Document
 
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1/*******************************************************************************
2* Copyright (c) 2022-2023 Intel Corporation
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*******************************************************************************/
16
19
20#pragma once
21
23
24namespace gpu::xetla::kernel {
25
35template <uint32_t wg_tile_n_, uint32_t wg_tile_m_, uint32_t sg_tile_n_,
36 uint32_t sg_tile_m_ = 1, uint32_t wg_num_m_ = 1, uint32_t wg_num_n_ = 1,
37 uint32_t chunk_size_ = 1>
39 static constexpr uint32_t wg_tile_m = wg_tile_m_;
40 static constexpr uint32_t wg_tile_n = wg_tile_n_;
41 static constexpr uint32_t sg_tile_m = sg_tile_m_;
42 static constexpr uint32_t sg_tile_n = sg_tile_n_;
43 static constexpr uint32_t wg_num_m = wg_num_m_;
44 static constexpr uint32_t wg_num_n = wg_num_n_;
45 static constexpr uint32_t chunk_size = chunk_size_;
46
47 static_assert(sg_tile_m == 1,
48 "Currently, we don't see the value to set sg_tile_m > 1. Maybe it "
49 "can be used to save the L1 BW when load gamma/beta");
50 static_assert(wg_num_n == 1,
51 "Current design doesn't support cross workgroup sync. So, wg_num_n "
52 "should be 1, i.e. one entire row should be processed inside the "
53 "workgroup.");
54 static_assert(wg_tile_n % sg_tile_n == 0,
55 "Current design we don't enable the boundary check");
56 static_assert(sg_tile_n_ % chunk_size == 0,
57 "Current design we don't enable the boundary check on chunking "
58 "mechanism");
59};
60
61} // namespace gpu::xetla::kernel
C++ API.
Definition limitation.hpp:734
Sets up attribute of the layer norm.
Definition config.hpp:38
static constexpr uint32_t wg_num_n
Definition config.hpp:44
static constexpr uint32_t wg_tile_n
Definition config.hpp:40
static constexpr uint32_t sg_tile_m
Definition config.hpp:41
static constexpr uint32_t chunk_size
Definition config.hpp:45
static constexpr uint32_t wg_num_m
Definition config.hpp:43
static constexpr uint32_t sg_tile_n
Definition config.hpp:42
static constexpr uint32_t wg_tile_m
Definition config.hpp:39