You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

hccl_stub.cc 4.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /**
  2. * Copyright 2020 Huawei Technologies Co., Ltd
  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. /* runtime基础数据类型声明 */
  17. /* HCCL基础数据类型声明 */
  18. #include "hccl/hcom.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /* 集合通信域初始化 */
  23. hcclResult_t hcom_init(const char *rank_table, const char *identify) { return HCCL_SUCCESS; }
  24. /* 解析ranktable for python */
  25. hcclResult_t hcom_rank_info_init(const char *rank_table, const char *identify, u32 device_id) { return HCCL_SUCCESS; }
  26. /* 集合通信域销毁 */
  27. hcclResult_t hcom_destroy(void) { return HCCL_SUCCESS; }
  28. /* 绑定model */
  29. hcclResult_t hcom_bind_model(rtModel_t model, rtStream_t stream) { return HCCL_SUCCESS; }
  30. /* 绑解定model */
  31. hcclResult_t hcom_unbind_model(rtModel_t model) { return HCCL_SUCCESS; }
  32. /* allgather功能实现 */
  33. hcclResult_t hcom_all_gather(const char *tag, void *inputPtr, void *outputPtr, u64 inputCount, hcclDataType_t dataType,
  34. const char *group, rtStream_t stream) {
  35. return HCCL_SUCCESS;
  36. }
  37. /* allreduce功能实现 */
  38. hcclResult_t hcom_all_reduce(const char *tag, void *inputPtr, void *outputPtr, u64 count, hcclDataType_t dataType,
  39. hcclRedOp_t op, const char *group, rtStream_t stream) {
  40. return HCCL_SUCCESS;
  41. }
  42. /* broadcas功能实现 */
  43. hcclResult_t hcom_broadcast(const char *tag, void *ptr, u64 count, hcclDataType_t dataType, u32 root, const char *group,
  44. rtStream_t stream) {
  45. return HCCL_SUCCESS;
  46. }
  47. /* reduce_scatter功能实现 */
  48. hcclResult_t hcom_reduce_scatter(const char *tag, void *inputPtr, void *outputPtr, u64 count, hcclDataType_t dataType,
  49. hcclRedOp_t op, const char *group, rtStream_t stream) {
  50. return HCCL_SUCCESS;
  51. }
  52. /* 获取group内的rank个数 */
  53. hcclResult_t hcom_get_rank_size(const char *group, u32 *rankSize) { return HCCL_SUCCESS; }
  54. /* python获取上云场景内的rank个数 */
  55. hcclResult_t hcom_python_get_rank_size(u32 *rankSize) { return HCCL_SUCCESS; }
  56. /* 获取本rank的id */
  57. hcclResult_t hcom_get_rank_id(const char *group, u32 *rankId) { return HCCL_SUCCESS; }
  58. /* 获取本rank的id */
  59. hcclResult_t hcom_python_get_rank_id(u32 *rankId) { return HCCL_SUCCESS; }
  60. /* 获取本rank的id */
  61. hcclResult_t hcom_get_world_rank_from_group_rank(const char *group, u32 groupRank, u32 *worldRank) {
  62. return HCCL_SUCCESS;
  63. }
  64. /* 获取通信域的rank个数 */
  65. hcclResult_t hcom_get_group_rank_from_world_rank(u32 worldRank, const char *group, u32 *groupRank) {
  66. return HCCL_SUCCESS;
  67. }
  68. /* 创建group */
  69. hcclResult_t hcom_create_group(const char *group, u32 rankNum, u32 *rankIds) { return HCCL_SUCCESS; }
  70. /* 销毁group */
  71. hcclResult_t hcom_destroy_group(const char *group) { return HCCL_SUCCESS; }
  72. /* 发送消息 */
  73. hcclResult_t hcom_send(const char *tag, void *inputPtr, u64 count, hcclDataType_t dataType, u32 destRank, u32 srTag,
  74. const char *group, rtStream_t stream) {
  75. return HCCL_SUCCESS;
  76. }
  77. /* 接收消息 */
  78. hcclResult_t hcom_receive(const char *tag, void *outputPtr, u64 count, hcclDataType_t dataType, u32 srcRank, u32 srTag,
  79. const char *group, rtStream_t stream) {
  80. return HCCL_SUCCESS;
  81. }
  82. /* 获取梯度参数切分方案 */
  83. hcclResult_t hcom_get_split_strategy(const char *group, const struct model_feature *feature, u32 maxSegmentNum,
  84. u32 *segmentNum, u32 *segmentIdx, GradSplitForceMode force) {
  85. return HCCL_SUCCESS;
  86. }
  87. /* 连通性检测 */
  88. hcclResult_t hcom_connectivity_detection(s32 *result) { return HCCL_SUCCESS; }
  89. hcclResult_t hcom_set_split_strategy_by_index(const char *group, u32 segmentNum, const u32 *IdxList) {
  90. return HCCL_SUCCESS;
  91. }
  92. hcclResult_t hcom_set_split_strategy_by_size(const char *group, u32 segmentNum, const float *sizeList) {
  93. return HCCL_SUCCESS;
  94. }
  95. #ifdef __cplusplus
  96. }
  97. #endif