Coverage for  / home / jenkins / .local / lib / python3.10 / site-packages / hyper_multicore / tasks / registry.py: 0%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-11-15 05:03 +0800

1# Copyright 2026 Huawei Technologies Co., Ltd 

2# 

3# Licensed under the Apache License, Version 2.0 (the "License"); 

4# you may not use this file except in compliance with the License. 

5# You may obtain a copy of the License at 

6# 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

12# See the License for the specific language governing permissions and 

13# limitations under the License. 

14# ============================================================================ 

15""" 

16FillConfig registry: maps OpType -> FillConfig class. 

17 

18Used by the @MultiCore decorator path for automatic task filling. 

19Manual graph construction (gen_runtime_data.py) instantiates FillConfig 

20directly in the OperatorNode declaration and does not use this registry. 

21 

22To register a new operator type: 

23 1. Add a value to OpType in runtime/graph.py. 

24 2. Implement a FillConfig subclass in tasks/<op_name>.py. 

25 3. Add an entry to FILL_CONFIG_REGISTRY below. 

26""" 

27from typing import Dict, Type 

28 

29from hyper_multicore.scheduler.graph import OpType 

30from hyper_multicore.tasks.task_base import FillConfig 

31from hyper_multicore.tasks.alltoall import AllToAllFillConfig 

32from hyper_multicore.tasks.gmm import GmmFillConfig 

33from hyper_multicore.tasks.swiglu import SwiGLUFillConfig 

34 

35FILL_CONFIG_REGISTRY: Dict[OpType, Type[FillConfig]] = { 

36 OpType.ALLTOALL: AllToAllFillConfig, 

37 OpType.GMM: GmmFillConfig, 

38 OpType.SWIGLU: SwiGLUFillConfig, 

39 OpType.SWIGLU_GRAD: SwiGLUFillConfig, 

40}