aclnnQuantLightningIndexerV2Metadata
Applicable Products
Ascend 950PR&950DT products : Supported
Atlas A3 products : Supported
Atlas A2 products : Supported
Atlas 200I/500 A2 inference products : Not supported
Atlas inference products : Not supported
Atlas training products : Not supported
Function
Description:
aclnnQuantLightningIndexerV2Metadatais the preceding operator ofaclnnQuantLightningIndexerV2, used to generate a load-balanced task partitioning scheme. This operator does not perform actual LightningIndexer computation. Instead, it computes on the AI CPU the start and end range of the computation to be processed by each AI Core based on the input parameters, to maximize compute resource utilization and avoid load imbalance across Cores.This operator is not recommended for standalone use. It is recommended to use it together with the aclnnQuantLightningIndexerV2 operator to form a complete workflow.
- Accepts the input data shape information of the aclnnQuantLightningIndexerV2 operator API, including batchSize, qSeqlen, kSeqlen, and mask. By splitting the input into blocks and simulating the computation time, blocks are evenly distributed across available cores, reducing the overall computation time of the aclnnQuantLightningIndexerV2 operator and improving hardware utilization.
- After the allocation result is output, it serves as input for the aclnnQuantLightningIndexerV2 operator.
- The allocation result contains the start point and end point of the basic block on each AIC core, and the FD task information of each AIV core. For details, see Example.
Function Prototype
Each operator uses a two-phase API. Call "aclnnQuantLightningIndexerV2MetadataGetWorkspaceSize" first to get the workspace size, and then call "aclnnQuantLightningIndexerV2Metadata" to execute the computation.
aclnnStatus aclnnQuantLightningIndexerV2MetadataGetWorkspaceSize(
const aclTensor *cuSeqlensQOptional,
const aclTensor *cuSeqlensKOptional,
const aclTensor *sequsedQOptional,
const aclTensor *sequsedKOptional,
const aclTensor *cmpResidualKOptional,
int64_t numHeadsQ,
int64_t numHeadsK,
int64_t headDim,
int64_t topk,
int64_t quantMode,
int64_t batchSize,
int64_t maxSeqlenQ,
int64_t maxSeqlenK,
char *layoutQOptional,
char *layoutKOptional,
int64_t maskMode,
int64_t cmpRatio,
const aclTensor *metadata,
uint64_t *workspaceSize,
aclOpExecutor **executor)aclnnStatus aclnnQuantLightningIndexerV2Metadata(
void *workspace,
uint64_t workspaceSize,
aclOpExecutor *executor,
aclrtStream stream)aclnnQuantLightningIndexerV2MetadataGetWorkspaceSize
Parameters
Parameter Input/Output Description Instruction Data Type Data Format Dim (shape) Non-contiguous Tensor cuSeqlensQOptional (aclTensor*) Input Indicates the valid Sequence Length of q in different Batches. - Supports empty tensor
- shape is fixed to (B+1, ).
INT32 ND 1D √ cuSeqlensKOptional (aclTensor*) Input Indicates the valid Sequence Length of k in different Batches. - Supports empty tensor.
- Shape is fixed to (B+1, ).
INT32 ND 1-D √ sequsedQOptional (aclTensor*) Input Indicates the actual Sequence Length of q participating in computation in different batches. - Supports empty tensor.
- Shape is fixed to (B, ).
INT32 ND 1-D √ sequsedKOptional(aclTensor*) Input Indicates the sequence length of k actually involved in the computation in different batches. - Supports empty tensors.
- The shape is fixed to (B, ).
INT32 ND 1-D √ cmpResidualKOptional (aclTensor*) Input Indicates the remainders of the compressed Sequence Length of k in different Batches, used together with cmpRatio to implement mask and load calculation. - Supports empty tensor.
- Must be passed in when cmpRatio is not 1 and mask is 3.
- The shape is fixed to (B, ).
INT32 ND 1-D √ numHeadsQ (int64_t) Input Indicates the number of heads of q. Currently supports [1, 64]. - - - - numHeadsK (int64_t) Input Indicates the number of heads of k. Currently only supports 1. - - - - headDim (int64_t) Input Dimension of the attention head. Currently only supports 128. - - - - topk (int64_t) Input Indicates the number of key sparse tokens selected from q. Currently only supports [1, 8192]. - - - - quantMode (int64_t) Input Indicates the quantization mode. - Currently supports 1/2/3/4/5.
- 1: qk: fp8(e4m3) per-token-head; scale: fp32.
- 2: qk: int8 per-token-head; scale: fp16 w: fp16.
- 3: qk: mxfp8(e4m3), scale: fp8(e8m0).
- 4: qk: hif8 per-tensor; scale: fp32.
- 5: mxfp4(e2m1), scale: fp8(e8m0).
- - - - batchSize (int64_t) Input Indicates the number of batches. - Supports non-negative values.
- Recommended value is 0.
- - - - maxSeqlenQ (int64_t) Input Indicates the maximum sequence length of q. - Value range: ≥-1. -1 indicates any possible length.
- Recommended value: -1.
- - - - maxSeqlenK (int64_t) Input Indicates the maximum sequence length of k. - Value range: ≥-1. -1 indicates any possible length.
- Recommended value: -1.
- - - - layoutQOptional (char*) Input Indicates the layout of q. - Supports BSND and TND.
- Recommended Value: BSND.
- - - - layoutKOptional (char*) Input Indicates the layout of k. - Supports BSND, TND, and PA_BBND.
- The recommended value is BSND.
- - - - maskMode (int64_t) Input Indicates the sparse mode. - 0: No mask.
- 3: Mask of the rightDownCausal mode, corresponding to the lower-triangular scenario divided by the right vertex.
- The recommended value is 0.
- - - - cmpRatio (int64_t) Input Indicates the compression ratio of k. - Value Range [1, 128].
- Recommended Value: 1, indicating no compression.
- - - - metadata(aclTensor*) Output Indicates the output of the load balancing result. shape is fixed to (1024, ). INT32 ND 1-D × workspaceSize (uint64_t*) Output Returns the workspace size that must be requested by the Device side. - - - - - executor (aclOpExecutor**) Output Returns the op executor, which contains the operator computation flow. - - - - - Atlas A3 products : numHeadsQ only supports 64, quantMode = 1/3/4/5 is not supported, topk only supports [1, 2048], layoutKOptional = BSND/TND is not supported, cmpRatio does not support any value in [1, 128], and only cmpRatio = 1/2/4/8/16/32/64/128 is supported.Atlas A2 products : numHeadsQ only supports 64, quantMode = 1/3/4/5 is not supported, topk only supports [1, 2048], layoutKOptional = BSND/TND is not supported, cmpRatio does not support any value in [1, 128], and only cmpRatio = 1/2/4/8/16/32/64/128 is supported.
Return value
aclnnStatus: return status code. For details, see aclnn Return Codes.
The first-phase API performs input parameter validation and returns an error in the following scenarios:
Return Value Error Code Description ACLNN_ERR_INNER_CREATE_EXECUTOR 561101 Failed to create aclOpExecutor. ACLNN_ERR_INNER_NULLPTR 561103 The workspaceSize or executor parameter is a null pointer, or the cuSeqlensQOptional, cuSeqlensKOptional, sequsedQOptional, sequsedKOptional, or cmpResidualKOptional parameter is a null pointer after Contiguous processing. ACLNN_ERR_PARAM_INVALID 161002 The specification of the cuSeqlensQOptional, cuSeqlensKOptional, sequsedQOptional, sequsedKOptional, cmpResidualKOptional, numHeadsQ, numHeadsK, headDim, topk, quantMode, batchSize, maxSeqlenQ, maxSeqlenK, layoutQOptional, layoutKOptional, maskMode, or cmpRatio parameter is not within the supported range.
aclnnQuantLightningIndexerV2Metadata
Parameters:
Parameter Input/Output Description workspace Input Workspace memory address requested by the Device. workspaceSize Input Size of the workspace requested by the Device. Get it by calling the first-phase API aclnnQuantLightningIndexerV2MetadataGetWorkspaceSize. executor Input The op executor, containing the operator computation process. stream Input Stream for executing tasks. Return value
aclnnStatus: return status code. For details, see aclnn Return Codes.
Constraints
- aclnnQuantLightningIndexerV2Metadata defaults to a deterministic implementation.
- B (Batch) indicates the batch size of the input samples. q and k are input parameters of the paired aclnnQuantLightningIndexerV2 operator. S1 indicates the size of the S axis in the q shape when layoutQOptional=BSND, and S2 indicates the size of the S axis in the k shape when layoutKOptional=BSND.
- The values of cuSeqlensQOptional and cuSeqlensKOptional must be the cumulative sum of the number of valid tokens in the current and preceding batches. The first element is fixed to 0, and the value of each subsequent element must be greater than or equal to that of the preceding element.
- The values of parameters sequsedQOptional and sequsedKOptional must indicate the number of valid tokens in each batch.
- For non-PA use cases, layoutQOptional and layoutKOptional must be the same.
- Parameter cmpResidualKOptional must satisfy cmpResidualKOptional[i] < cmpRatio.
- layoutQOptional=BSND scenario
- The value of S1 must be passed to maxSeqlenQ.
- For layoutKOptional=BSND use case
- The value of S2 must be passed to maxSeqlenK.
- layoutQOptional=TND scenario
- cuSeqlensQOptional is mandatory.
- For layoutKOptional=TND use case
- cuSeqlensKOptional must be passed.
- layoutKOptional=PA_BBND use case
- sequsedKOptional must be passed.
- Batch value rules
- If layoutQOptional is BSND, prefer to use the shape of sequsedQOptional to derive batch. If sequsedQOptional is not passed in, obtain the number of batches through batchSize.
- When layoutQOptional is TND, prefer to use the shape of sequsedQOptional to derive the batch; if sequsedQOptional is not passed, derive the batch from the shape of cuSeqlensQOptional.
- q Seqlen value rules
- When layoutQOptional is BSND, prefer to use the elements in sequsedQOptional to obtain the seqlen; if sequsedQOptional is not passed, obtain the seqlen from maxSeqlenQ.
- When layoutQOptional is TND, prefer to use the elements in sequsedQOptional to obtain the seqlen; if sequsedQOptional is not passed, obtain the seqlen from the elements in cuSeqlensQOptional.
- k Seqlen value rule
- For layoutKOptional=BSND, prefer through elements in sequsedKOptional to obtain seqlen. If sequsedKOptional is not passed, obtain seqlen through maxSeqlenK.
- For layoutKOptional=TND, prefer through elements in sequsedKOptional to obtain seqlen. If sequsedKOptional is not passed, obtain seqlen through elements in cuSeqlensKOptional.
Example
The sample code is for reference only. For details about the compilation and execution procedure, see Compile and Run Samples.
#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>
#include <limits>
#include <functional>
#include <utility>
#include "acl/acl.h"
#include "aclnnop/aclnn_quant_lightning_indexer_v2_metadata.h"
#define CHECK_LOG_RET(cond, ret_val, fmt, ...) \
do { \
if (!(cond)) { \
printf(fmt "\n", ##__VA_ARGS__); \
return (ret_val); \
} \
} while (0)
// Refer to quant_lightning_indexer_v2_metadata.h.
constexpr uint32_t AIC_CORE_MAX_NUM = 36;
constexpr uint32_t AIV_CORE_MAX_NUM = 72;
constexpr uint32_t QLI_V2_METADATA_TOTAL_SIZE = 1024;
constexpr uint32_t QLI_V2_METADATA_SIZE = 8;
constexpr uint32_t QLD_V2_METADATA_SIZE = 8;
// QLI Metadata Index Definitions
constexpr uint32_t QLI_V2_CORE_ENABLE_INDEX = 0;
constexpr uint32_t QLI_V2_BN2_START_INDEX = 1;
constexpr uint32_t QLI_V2_M_START_INDEX = 2;
constexpr uint32_t QLI_V2_S2_START_INDEX = 3;
constexpr uint32_t QLI_V2_BN2_END_INDEX = 4;
constexpr uint32_t QLI_V2_M_END_INDEX = 5;
constexpr uint32_t QLI_V2_S2_END_INDEX = 6;
constexpr uint32_t QLI_V2_FIRST_QLD_V2_DATA_WORKSPACE_IDX_INDEX = 7;
// QLD Metadata Index Definitions
constexpr uint32_t QLD_V2_CORE_ENABLE_INDEX = 0;
constexpr uint32_t QLD_V2_BN2_IDX_INDEX = 1;
constexpr uint32_t QLD_V2_M_IDX_INDEX = 2;
constexpr uint32_t QLD_V2_WORKSPACE_IDX_INDEX = 3;
constexpr uint32_t QLD_V2_WORKSPACE_NUM_INDEX = 4;
constexpr uint32_t QLD_V2_M_START_INDEX = 5;
constexpr uint32_t QLD_V2_M_NUM_INDEX = 6;
struct QliV2Metadata {
uint32_t faData[AIC_CORE_MAX_NUM][QLI_V2_METADATA_SIZE];
uint32_t fdData[AIV_CORE_MAX_NUM][QLD_V2_METADATA_SIZE];
};
struct ScopeGuard
{
explicit ScopeGuard(std::function<void()> onExitScope) : m_exitFunc(std::move(onExitScope)),
m_isDismissed(false) {}
// Do not copy.
ScopeGuard(const ScopeGuard&) = delete;
ScopeGuard& operator=(const ScopeGuard&) = delete;
~ScopeGuard()
{
if (!m_isDismissed) {
m_exitFunc();
}
}
void Dismiss()
{
m_isDismissed = true;
}
std::function<void()> m_exitFunc;
bool m_isDismissed;
};
struct Tensor {
void *hostAddr { nullptr };
void *deviceAddr { nullptr };
aclTensor *data { nullptr };
};
struct ArgScenario {
bool hasCuSeq { false };
bool hasSeqused { false };
};
struct ArgContext {
// required input
int64_t numHeadsQ { 0 };
int64_t numHeadsK { 0 };
int64_t headDim { 0 };
int64_t topk { 0 };
int64_t quantMode { 2 };
// optional input
Tensor cuSeqlensQOptional {};
Tensor cuSeqlensKOptional {};
Tensor sequsedQOptional {};
Tensor sequsedKOptional {};
Tensor cmpResidualKOptional {};
int64_t batchSize { 0 };
int64_t maxSeqlenQ { 0 };
int64_t maxSeqlenK { 0 };
char *layoutQOptional { nullptr };
char *layoutKOptional { nullptr };
int64_t maskMode { 0 };
int64_t cmpRatio { 0 };
// output
Tensor metadata {};
};
int64_t GetShapeSize(const std::vector<int64_t>& shape)
{
int64_t shapeSize = 1;
for (auto i : shape) {
shapeSize *= i;
}
return shapeSize;
}
aclnnStatus Init(int32_t deviceId, aclrtStream* stream)
{
// Boilerplate for initialization.
auto ret = aclInit(nullptr);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclInit failed. ERROR: %d", ret);
ret = aclrtSetDevice(deviceId);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclrtSetDevice failed. ERROR: %d", ret);
ret = aclrtCreateStream(stream);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclrtCreateStream failed. ERROR: %d", ret);
return ACL_SUCCESS;
}
void Finalize(int32_t deviceId, aclrtStream stream)
{
aclrtDestroyStream(stream);
aclrtResetDevice(deviceId);
aclFinalize();
}
aclnnStatus CreateTensor(aclDataType dataType, const std::vector<int64_t> &shape, Tensor &tensor)
{
auto size = GetShapeSize(shape) * aclDataTypeSize(dataType);
// Call aclrtMallocHost to allocate host-side memory.
auto ret = aclrtMallocHost(&(tensor.hostAddr), size);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclrtMallocHost failed. ERROR: %d", ret);
memset(tensor.hostAddr, 0, size);
// Call aclrtMalloc to allocate device-side memory.
ret = aclrtMalloc(&(tensor.deviceAddr), size, ACL_MEM_MALLOC_HUGE_FIRST);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclrtMalloc failed. ERROR: %d", ret);
// Call aclCreateTensor to create an aclTensor.
tensor.data = aclCreateTensor(shape.data(), shape.size(), dataType, nullptr, 0, aclFormat::ACL_FORMAT_ND,
shape.data(), shape.size(), tensor.deviceAddr);
// Call aclrtMemcpy to copy host-side data to device-side memory.
ret = aclrtMemcpy(tensor.deviceAddr, size, tensor.hostAddr, size, ACL_MEMCPY_HOST_TO_DEVICE);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclrtMemcpy failed. ERROR: %d", ret);
return ACL_SUCCESS;
}
void DestroyTensor(Tensor &tensor)
{
if (tensor.data != nullptr) {
aclDestroyTensor(tensor.data);
tensor.data = nullptr;
}
if (tensor.deviceAddr != nullptr) {
aclrtFree(tensor.deviceAddr);
tensor.deviceAddr = nullptr;
}
if (tensor.hostAddr != nullptr) {
aclrtFreeHost(tensor.hostAddr);
tensor.hostAddr = nullptr;
}
}
void DestroyArgs(ArgContext &context)
{
DestroyTensor(context.metadata);
DestroyTensor(context.cuSeqlensQOptional);
DestroyTensor(context.cuSeqlensKOptional);
DestroyTensor(context.sequsedQOptional);
DestroyTensor(context.sequsedKOptional);
DestroyTensor(context.cmpResidualKOptional);
if (context.layoutQOptional != nullptr) {
free(context.layoutQOptional);
context.layoutQOptional = nullptr;
}
if (context.layoutKOptional != nullptr) {
free(context.layoutKOptional);
context.layoutKOptional = nullptr;
}
}
aclnnStatus CreateArgs(const ArgScenario &scenario, ArgContext &context)
{
ScopeGuard argsGuard([&] { DestroyArgs(context); });
aclnnStatus ret;
int64_t batchSize = 4;
context.numHeadsQ = 1;
context.numHeadsK = 1;
context.headDim = 128;
context.topk = 0;
context.quantMode = 2; // 2: per-token-head / 3: group-scaling
ret = CreateTensor(aclDataType::ACL_INT32, { QLI_V2_METADATA_TOTAL_SIZE }, context.metadata); // 1024: Fix size
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "Create meta failed. Error: %d", ret);
context.maskMode = 0; // 0: no mask, 3: causal
context.cmpRatio = 1; // [1, 128], 1: no compress
context.layoutQOptional = (char *)malloc(sizeof(char) * 16);
context.layoutKOptional = (char *)malloc(sizeof(char) * 16);
strcpy(context.layoutQOptional, "BSND"); // BSND,TND
strcpy(context.layoutKOptional, "BSND"); // BSND,TND,PA_BBND
if (!scenario.hasCuSeq && !scenario.hasSeqused) {
context.batchSize = batchSize;
context.maxSeqlenK = 1024;
context.maxSeqlenQ = 1024;
argsGuard.Dismiss();
return ACL_SUCCESS;
}
if (scenario.hasCuSeq) {
// (B+1,), first element is always 0
ret = CreateTensor(aclDataType::ACL_INT32, { batchSize + 1 }, context.cuSeqlensQOptional);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "Create cuSeqlensQOptional failed. Error: %d", ret);
ret = CreateTensor(aclDataType::ACL_INT32, { batchSize + 1 }, context.cuSeqlensKOptional);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "Create cuSeqlensKOptional failed. Error: %d", ret);
}
if (scenario.hasSeqused) {
// (B,)
ret = CreateTensor(aclDataType::ACL_INT32, { batchSize }, context.sequsedQOptional);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "Create sequsedQOptional failed. Error: %d", ret);
ret = CreateTensor(aclDataType::ACL_INT32, { batchSize }, context.sequsedKOptional);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "Create sequsedKOptional failed. Error: %d", ret);
}
argsGuard.Dismiss();
return ACL_SUCCESS;
}
int main() {
// 1. (Boilerplate) Initialize device/stream. For details, see the external API list.
// Set deviceId based on the actual device.
int32_t deviceId = 0;
aclrtStream stream;
auto ret = Init(deviceId, &stream);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "Init acl failed. ERROR: %d", ret);
ScopeGuard sysGuard([&] { Finalize(deviceId, stream); });
// 2. Construct inputs and outputs according to the API definition.
ArgScenario scenario {};
scenario.hasCuSeq = true;
scenario.hasSeqused = true;
ArgContext context {};
ret = CreateArgs(scenario, context);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "Create input arguments failed. ERROR: %d", ret);
ScopeGuard argsGuard([&] { DestroyArgs(context); });
// 3. Call the CANN operator library API. Replace it with the specific API.
// Call the first-phase API of aclnnQuantLightningIndexerV2Metadata.
uint64_t workspaceSize = 0;
aclOpExecutor *executor = nullptr;
void *workspaceAddr = nullptr;
ret = aclnnQuantLightningIndexerV2MetadataGetWorkspaceSize(
context.cuSeqlensQOptional.data, context.cuSeqlensKOptional.data, context.sequsedQOptional.data,
context.sequsedKOptional.data, context.cmpResidualKOptional.data,
context.numHeadsQ, context.numHeadsK, context.headDim, context.topk, context.quantMode,
context.batchSize, context.maxSeqlenQ, context.maxSeqlenK, context.layoutQOptional,
context.layoutKOptional, context.maskMode, context.cmpRatio,
context.metadata.data, &workspaceSize, &executor);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret,
"aclnnQuantLightningIndexerV2MetadataGetWorkspaceSize failed. ERROR: %d\n", ret);
if (workspaceSize > static_cast<uint64_t>(0)) {
ret = aclrtMalloc(&workspaceAddr, workspaceSize, ACL_MEM_MALLOC_HUGE_FIRST);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "allocate workspace failed. ERROR: %d\n", ret);
}
ScopeGuard workspaceGuard([&] {
if (workspaceAddr != nullptr) {
aclrtFree(workspaceAddr);
workspaceAddr = nullptr;
}
});
// Call the second-phase API of aclnnQuantLightningIndexerV2Metadata
ret = aclnnQuantLightningIndexerV2Metadata(workspaceAddr, workspaceSize, executor, stream);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclnnQuantLightningIndexerV2Metadata failed. ERROR: %d\n", ret);
// 4. (boilerplate) Synchronously wait for the task execution to complete
ret = aclrtSynchronizeStream(stream);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclrtSynchronizeStream failed. ERROR: %d\n", ret);
// 5. Print the output
QliV2Metadata result {};
ret = aclrtMemcpy(&result, sizeof(result), context.metadata.deviceAddr, sizeof(result), ACL_MEMCPY_DEVICE_TO_HOST);
CHECK_LOG_RET(ret == ACL_SUCCESS, ret, "aclrtMemcpy failed. ERROR: %d\n", ret);
for (uint32_t i = 0; i < AIC_CORE_MAX_NUM; ++i) {
printf("AIC Core%u\n", i);
printf(" Core Enable : %u\n", result.faData[i][QLI_V2_CORE_ENABLE_INDEX]);
printf(" Start BN2 : %u\n", result.faData[i][QLI_V2_BN2_START_INDEX]);
printf(" Start M : %u\n", result.faData[i][QLI_V2_M_START_INDEX]);
printf(" Start S2 : %u\n", result.faData[i][QLI_V2_S2_START_INDEX]);
printf(" End BN2 : %u\n", result.faData[i][QLI_V2_BN2_END_INDEX]);
printf(" End M : %u\n", result.faData[i][QLI_V2_M_END_INDEX]);
printf(" End S2 : %u\n", result.faData[i][QLI_V2_S2_END_INDEX]);
printf(" First Workspace Index : %u\n", result.faData[i][QLI_V2_FIRST_QLD_V2_DATA_WORKSPACE_IDX_INDEX]);
}
for (uint32_t i = 0; i < AIV_CORE_MAX_NUM; ++i) {
printf("AIV Core%u\n", i);
printf(" Core Enable : %u\n", result.fdData[i][QLD_V2_CORE_ENABLE_INDEX]);
printf(" FD Task BN2 Idx : %u\n", result.fdData[i][QLD_V2_BN2_IDX_INDEX]);
printf(" FD Task M Idx : %u\n", result.fdData[i][QLD_V2_M_IDX_INDEX]);
printf(" FD Task Workspace Idx : %u\n", result.fdData[i][QLD_V2_WORKSPACE_IDX_INDEX]);
printf(" FD Task Workspace Num : %u\n", result.fdData[i][QLD_V2_WORKSPACE_NUM_INDEX]);
printf(" FD Subtask M Start : %u\n", result.fdData[i][QLD_V2_M_START_INDEX]);
printf(" FD Subtask M Num : %u\n", result.fdData[i][QLD_V2_M_NUM_INDEX]);
}
return 0;
}