Coverage for /opt/cloud/slavespace/usr1/096471637100f3de0fcfc01072822a80/dttest/api/python/llm_datadist_v1/__init__.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-07-27 10:03 +0800

1#!/usr/bin/env python3 

2# -*- coding: utf-8 -*- 

3# ----------------------------------------------------------------------------------------------------------- 

4# Copyright (c) 2025 Huawei Technologies Co., Ltd. 

5# This program is free software, you can redistribute it and/or modify it under the terms and conditions of 

6# CANN Open Software License Agreement Version 2.0 (the "License"). 

7# Please refer to the License for details. You may not use this file except in compliance with the License. 

8# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, 

9# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 

10# See LICENSE in the root of the software repository for the full text of the License. 

11# ----------------------------------------------------------------------------------------------------------- 

12 

13import os 

14 

15from .configs import LLMClusterInfo, LlmConfig, LLMRole 

16from .configs import LlmConfig as LLMConfig 

17from .data_type import DataType 

18from .kv_cache_manager import KvCacheManager 

19from .llm_datadist import LLMDataDist 

20from .llm_types import ( 

21 BlocksCacheKey, 

22 CacheDesc, 

23 CacheKey, 

24 CacheKeyByIdAndIndex, 

25 CacheTask, 

26 KvCache, 

27 LayerSynchronizer, 

28 MemInfo, 

29 Memtype, 

30 Placement, 

31 RegisterMemStatus, 

32 TransferConfig, 

33 TransferWithCacheKeyConfig, 

34) 

35from .status import LLMException, LLMStatusCode, Status 

36from .tensor import Tensor, TensorDesc 

37 

38__all__ = [ 

39 "LLMClusterInfo", 

40 "LLMStatusCode", 

41 "LLMException", 

42 "LLMRole", 

43 "LlmConfig", 

44 "LLMConfig", 

45 "TensorDesc", 

46 "Tensor", 

47 "DataType", 

48 "Status", 

49 "KvCacheManager", 

50 "CacheDesc", 

51 "CacheKey", 

52 "CacheKeyByIdAndIndex", 

53 "KvCache", 

54 "BlocksCacheKey", 

55 "LLMDataDist", 

56 "Placement", 

57 "RegisterMemStatus", 

58 "LayerSynchronizer", 

59 "TransferConfig", 

60 "CacheTask", 

61 "TransferWithCacheKeyConfig", 

62 "Memtype", 

63 "MemInfo", 

64] 

65 

66_ENV_VAR_NAME_AUTO_USE_UC_MEMORY = "AUTO_USE_UC_MEMORY" 

67 

68if _ENV_VAR_NAME_AUTO_USE_UC_MEMORY not in os.environ: 

69 os.environ[_ENV_VAR_NAME_AUTO_USE_UC_MEMORY] = "0"