---
title: 定义
description: "```"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendtb/ascendtb_01_0170.html
sourcePath: /source/zh/canncommercial/900/API/ascendtb/ascendtb_01_0170.html
indexId: f2e3f128c8f73d241bbdefe0b13be1db9ff9baaeb6e2bd970444e71b64c6d71364
---
# 定义

```
struct LinearParallelParam {
    enum ParallelType : int {
        UNDEFINED = -1,
        LINEAR_ALL_REDUCE = 0,
        LINEAR_REDUCE_SCATTER = 1,
        ALL_GATHER_LINEAR = 2,
        PURE_LINEAR = 3,
        ALL_GATHER_LINEAR_REDUCE_SCATTER = 4,
       ALLTOALLVC_ALL_GATHER_GMM = 5,
       GMM_REDUCE_SCATTER_ALLTOALLVC = 6,
        MAX = 7,
    };
    enum QuantType : int {
        QUANT_TYPE_UNDEFINED = -1,
        QUANT_TYPE_UNQUANT = -1,
        QUANT_TYPE_PER_TENSOR = 0,
        QUANT_TYPE_PER_CHANNEL = 1,
        QUANT_TYPE_PER_GROUP = 2,
       QUANT_TYPE_PER_TOKEN = 3,
        QUANT_TYPE_MAX = 4,
    };
   struct MoeInfo {   
       int16_t localExpertNums = 1;   
       int8_t epSize = 1;   
       int8_t tpSize = 1; };
    bool transWeight = true;                    
    int rank = 0;                              
    int rankSize = 0;                          
    int rankRoot = 0;                          
    bool hasResidual = false;
    std::string backend = "hccl";              
    HcclComm hcclComm = nullptr;               
    CommMode commMode = COMM_MULTI_PROCESS;
    std::string rankTableFile;
    ParallelType type = LINEAR_ALL_REDUCE;    
    bool keepIntermediate = false;            
    QuantType quantType = QUANT_TYPE_UNDEFINED; 
    int32_t quantGroupSize = 0;                
    aclDataType outDataType = ACL_DT_UNDEFINED;
    std::string commDomain;
    struct TwoDimTPInfo {
        uint16_t agDim = 0;
        uint16_t rsDim = 0;
        uint8_t innerDimIsAg = 1;
        uint8_t rsv[3] = {0};
    };
    TwoDimTPInfo twoDimTPInfo;
    MoeInfo moeInfo;
    uint8_t rsv[52] = {0};
};
```
