1 | /** |
2 | * Copyright (c) Glow Contributors. See CONTRIBUTORS file. |
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 | #ifndef GLOW_PARTITIONER_PARTITIONERVALIDATION_H |
17 | #define GLOW_PARTITIONER_PARTITIONERVALIDATION_H |
18 | |
19 | #include "glow/Partitioner/PartitionerTypes.h" |
20 | |
21 | namespace glow { |
22 | /// Check if \p partitions satisfies number of physical devices restriction. |
23 | /// I.e. check if the number of logical devices is less than the given |
24 | /// physical devices. |
25 | Error logicalDevicesValidation( |
26 | const NodeToFunctionMap &partitions, |
27 | const std::map<std::string, BackendInfo> &backendMap); |
28 | |
29 | /// Check if the memory usage of each partition meets the physical device |
30 | /// memory restriction. |
31 | Error memoryUsageValidation( |
32 | const NodeToFunctionMap &partitions, |
33 | const std::map<std::string, BackendInfo> &backendMap); |
34 | |
35 | /// Verify number of input resources meet the backend constraints. Only intended |
36 | /// for homogeneous backends. |
37 | Error resourceCountValidation( |
38 | const NodeToFunctionMap &partitions, |
39 | const std::map<std::string, BackendInfo> &backendMap); |
40 | |
41 | /// Check if the current partition is a valid DAG. This check can only be |
42 | /// called after a real partition is created and the DAG is generated. |
43 | Error dagValidation(const DAG &dag); |
44 | |
45 | } // namespace glow |
46 | #endif // GLOW_PARTITIONER_PARTITIONERVALIDATION_H |
47 | |