Skip to content
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

Closed
wants to merge 0 commits into from

Conversation

zhengleiZL
Copy link
Collaborator

@zhengleiZL zhengleiZL commented Oct 16, 2023

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.

  • static threshold
    • diff3
      • mlu diff3 == 0
      • mlu diff3_1 == 0
      • mlu diff3_2 == 0

3.1.2 Operator Scheme checklist

  • Supported hardware
    • MLU370
    • MLU590

3.2 Accuracy Test

3.2.1 Accuracy Test

If you have checked the following items, please tick the relevant box.

  • Data type test (e.g. float32/int8)
  • Multi-dimensional tensor test
  • Layout test
  • Different size/integer remainder end segment/alignment misalignment test
  • Zero dimensional tensor test/zero element test
  • stability test
  • Multiple platform test
  • Gen_case module test, see: Gencase-User-Guide-zh
  • Nan/INF tests
  • Bug fix tests
  • For memory leak check details, see: GTest-User-Guide-zh
  • For code coverage check details, see: GTest-User-Guide-zh
  • For I/O calculation efficiency check details, see: MLU-OPS-Performance-Acceptance-Standard

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.

Please fill your test results(Error Message) in here, ...

Test Point-2: Whether illegal parameters are passed. Acceptance Standard: Normal error.

Test results...

3.3 Performance Test

See MLU-OPS Performance Acceptance Standard for details.

Platform:MLU370

[----------] Global test environment tear-down
[ SUMMARY  ] Total 131 cases of 79 op(s).
ALL PASSED.
[==========] 131 test cases from 79 test suites ran. (30884 ms total)
[  PASSED  ] 131 test cases.

3.4 Summary Analysis

Please give a brief overview here, if you want to note and summarize the content.

@zhengleiZL zhengleiZL force-pushed the binary-op-concat branch 8 times, most recently from a1fef85 to 6fc6037 Compare October 19, 2023 12:33

input_1 = [DIM_0, ..., axis_1, ..., DIM_(N-1)],
... ,
input_M = [DIM0, ..., axis_m, ..., DIM_(N-1)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是dim0少了个下划线?

Comment on lines 1001 to 1004
- ``M`` 为input的个数。
- ``N`` 为每个input和output的维度数。
- ``sum(axis_1, ..., axis_m)`` 表示对待拼接维度求和,output的拼接维度大小为所有input拼接维度的总和。
- 除拼接维度外,其余维度的大小需要相等。
Copy link
Collaborator

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)]

其中:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
其中:
.. note::

* - 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - 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

* - None.
*
* @par Scale Limitation
* - The parameters must meet the following requirements:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

列表如果就一条没必要有这句话吧?

* 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

* @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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

* 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

* @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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

*
* @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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* ::mluOpConcat operation. For detailed information, see ::mluOpHandle_t.
* For detailed information, see ::mluOpHandle_t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants