-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature](bangc-ops): add concat binary operator. #857
Conversation
a1fef85
to
6fc6037
Compare
|
||
input_1 = [DIM_0, ..., axis_1, ..., DIM_(N-1)], | ||
... , | ||
input_M = [DIM0, ..., axis_m, ..., DIM_(N-1)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是dim0少了个下划线?
- ``M`` 为input的个数。 | ||
- ``N`` 为每个input和output的维度数。 | ||
- ``sum(axis_1, ..., axis_m)`` 表示对待拼接维度求和,output的拼接维度大小为所有input拼接维度的总和。 | ||
- 除拼接维度外,其余维度的大小需要相等。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 前加个空格吧
|
||
output = [DIM_0, ... , sum(axis_1, ..., axis_m), ..., DIM_(N-1)] | ||
|
||
其中: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其中: | |
.. note:: |
bangc-ops/mlu_op.h
Outdated
* - The parameter \b concat_num should be greater than 0. | ||
* | ||
* @par API Dependency | ||
* - The allocated extra workspace should be passed to the ::mluOpConcat function to perform the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* - The allocated extra workspace should be passed to the ::mluOpConcat function to perform the | |
* - The allocated extra workspace should be passed to ::mluOpConcat function to perform |
bangc-ops/mlu_op.h
Outdated
* - None. | ||
* | ||
* @par Scale Limitation | ||
* - The parameters must meet the following requirements: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
列表如果就一条没必要有这句话吧?
bangc-ops/mlu_op.h
Outdated
* For more information about workspace, see "Cambricon BANG C OPS User Guide". Because ::mluOpConcat | ||
* does not need extra workspace, the \b workspace can be set to NULL. | ||
* @param[in] workspace_size | ||
* The size of the extra workspace in bytes that needs to be used in the concat operation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The size of the extra workspace in bytes that needs to be used in the concat operation. | |
* The size of the extra workspace in bytes. |
bangc-ops/mlu_op.h
Outdated
* @param[in] workspace | ||
* Pointer to the MLU memory that is used as an extra workspace for the concat operation. | ||
* For more information about workspace, see "Cambricon BANG C OPS User Guide". Because ::mluOpConcat | ||
* does not need extra workspace, the \b workspace can be set to NULL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* does not need extra workspace, the \b workspace can be set to NULL. | |
* does not need extra workspace, \b workspace can be set to NULL. |
bangc-ops/mlu_op.h
Outdated
* A host pointer to a list of MLU pointers, which point to the MLU memory that store the | ||
* input tensors. | ||
* @param[in] workspace | ||
* Pointer to the MLU memory that is used as an extra workspace for the concat operation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Pointer to the MLU memory that is used as an extra workspace for the concat operation. | |
* Pointer to the MLU memory that is used as an extra workspace. |
bangc-ops/mlu_op.h
Outdated
* @brief Concatenates the list of input tensors \b inputs along the given dimension \b axis. | ||
* | ||
* @param[in] handle | ||
* Handle to a Cambricon MLUOP context that is used to manage MLU devices and queues in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Handle to a Cambricon MLUOP context that is used to manage MLU devices and queues in | |
* Handle to a Cambricon MLUOP context that is used to manage MLU devices and queues. |
bangc-ops/mlu_op.h
Outdated
* | ||
* @param[in] handle | ||
* Handle to a Cambricon MLUOP context that is used to manage MLU devices and queues in | ||
* ::mluOpConcat operation. For detailed information, see ::mluOpHandle_t. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* ::mluOpConcat operation. For detailed information, see ::mluOpHandle_t. | |
* For detailed information, see ::mluOpHandle_t. |
6fc6037
to
232ec2c
Compare
Thanks for your contribution and we appreciate it a lot. 🚀🚀
1. Motivation
将concat算子以二进制形式合入mluops
2. Modification
增加concat算子
3. Test Report
If you want to know how to do operator testing, you can see GTest-User-Guide-zh.
3.1 Modification Details
3.1.1 Accuracy Acceptance Standard
For static threshold standard details, see: MLU-OPS Accuracy Acceptance Standard.
3.1.2 Operator Scheme checklist
3.2 Accuracy Test
3.2.1 Accuracy Test
If you have checked the following items, please tick the relevant box.
3.2.2 Parameter Check
Test Point-1:
When a new operator is submitted, the test points are given and the test results are stated
. Acceptance Standard:Normal error
.Test Point-2:
Whether illegal parameters are passed
. Acceptance Standard:Normal error
.3.3 Performance Test
See MLU-OPS Performance Acceptance Standard for details.
Platform:MLU370
3.4 Summary Analysis
Please give a brief overview here, if you want to note and summarize the content.