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

[Fix](bangc-ops): support grad_voxel_feats zero element & fix constra… #713

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

baicaixmj
Copy link
Collaborator

@baicaixmj baicaixmj commented Jun 2, 2023

Thanks for your contribution and we appreciate it a lot.

1. Motivation

  1. support grad_voxel_feats zero element
  2. fix constraint description in header file
  3. fix policy func on MLU370_S4

2. Modification

  1. modified: bangc-ops/kernel_depends.toml
  2. modified: bangc-ops/kernels/dynamic_point_to_voxel_backward/dynamic_point_to_voxel_backward.cpp
  3. modified: bangc-ops/kernels/dynamic_point_to_voxel_backward/dynamic_point_to_voxel_backward.mlu
  4. modified: bangc-ops/mlu_op.h

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.

  • diff3: diff3 <= 0

3.1.2 Operator Scheme checklist

No. Details Check Results
1 Supported hardware MLU370
MLU590
2 Job types U1、U2、U4、U8(看空闲资源)
3 Layouts ARRAY
4 Whether multi-dimensions are supported no
5 Whether element zero is supported yes
6 Data type(half/float) float
7 Whether there is size limit grad_voxel_feats、voxel_feats、voxel_points_count的第一维度 dims[0] 都相等,且<= feats的第一维度 dims[0];feats、point2voxel_map、grad_feats的第一维度 dims[0] 都相等;
voxel_num 的维度为 1;
grad_voxel_feats、feats、voxel_feats、grad_feats的第二维度 dims[1] 都相等;
5 * feats_desc->dims[0]+20 * feats_desc->dims[1]+sizeof(int) <= 640KB(MLU370) 或 384KB(MLU590)

3.1.3 New Feature Test

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

  • Data type test
  • 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
  • Nan/INF tests
  • Bug fix tests
  • For memory leak check details, seeGTest-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.1.4 Parameter Check

When a new operator is submitted, the test points are given and the test results are stated.

Test Point Acceptance Standard Test Result (Error Message)
Whether it conforms to the operator restriction Normal error 通过
Whether illegal parameters are passed Normal error 通过

3.2 Accuracy Test

For the cases used in the New Feature Test section, the features and the number of cases are recorded here. When multiple operations are tested, multiple tables are needed to include details of these operations.

Operation:

Test Point Description Quantity Comment
Data type test float 通过 [----------] Global test environment tear-down
[ SUMMARY ] Total 200 cases of 1 op(s).
ALL PASSED.
[==========] 200 test cases from 1 test suite ran. (77973 ms total)
[ PASSED ] 200 test cases.
Zero element test Whether to support this test 通过 [2023-5-24 16:6:57] [MLUOP] [Vlog]:[DynamicPointToVoxelBackwardExecutor] call compute() Begin.
[2023-5-24 16:6:57] [MLUOP] [Vlog]:[mluOpDynamicPointToVoxelBackward] Skip zero element tensor.
[2023-5-24 16:6:57] [MLUOP] [Vlog]:[DynamicPointToVoxelBackwardExecutor] call compute() End.
Stability test --gtest_repeat=NUM
--thread=NUM
通过 ./mluop_gtest --cases_dir=xxxx --gtest_repeat=100 --thread=100
[----------] Global test environment tear-down
[ SUMMARY ] Total 20000 cases of 600 op(s).
ALL PASSED.
[==========] 6 test cases from 6 test suites ran. (2932 ms total)
[ PASSED ] 6 test cases.
Mult-platform test MLU370/MLU590 通过 MLU370:
[----------] Global test environment tear-down
[ SUMMARY ] Total 200 cases of 1 op(s).
ALL PASSED.
[==========] 200 test cases from 1 test suite ran. (19708 ms total)
[ PASSED ] 200 test cases.
MLU590:
[----------] Global test environment tear-down
[ SUMMARY ] Total 200 cases of 1 op(s).
ALL PASSED.
[==========] 200 test cases from 1 test suite ran. (21528 ms total)
[ PASSED ] 200 test cases.
Nan/INF test Whether to support this test 通过 [----------] Global test environment tear-down
[ SUMMARY ] Total 18 cases of 1 op(s).
ALL PASSED.
[==========] 18 test cases from 1 test suite ran. (636 ms total)
[ PASSED ] 18 test cases.
Memory leak check Test result 通过 MLUOP_BUILD_ASAN_CHECK=ON ./build.sh --filter=dynamic_point_to_voxel_backward
Code coverage check Test result 通过 dynamic_point_to_voxel_backward.mlu
Line Coverage 98.7% 148 / 150 Functions 100.0 % 5 / 5

3.3 Performance Test

See MLU-OPS Performance Acceptance Standard for details.

Platform:MLU370

Operation Mlu_hardware_time(us) Mlu_interface_time(us) Mlu_io_efficiency Mlu_compute_efficiency Mlu_workwpace_size(Bytes) Data_type Shape
dynamic_point_to_voxel_backward 10191 209.829 0.0076793 0.000208799 8.71576e+06 float grad_feats:[17157, 127]
dynamic_point_to_voxel_backward 128 147.71 0.00499349 0.000178711 93696 float grad_feats:[183, 128]

Platform:MLU590

Operation Mlu_hardware_time(us) Mlu_interface_time(us) Mlu_io_efficiency Mlu_compute_efficiency Mlu_workwpace_size(Bytes) Data_type Shape
dynamic_point_to_voxel_backward 2230 138.001 0.00526411 0.00042409 8.71576e+06 float grad_feats:[17157, 127]
dynamic_point_to_voxel_backward 26 91.098 0.0036875 0.000391026 93696 float grad_feats:[183, 128]

3.4 Summary Analysis

1)MLU370上性能与真值相关
2)特征类tensor支持nan/inf,坐标类tensor是整型不支持nan/inf
3) 支持grad_voxel_feats/voxel_feats/voxel_points_count输入规模为0,此时grad_feats输出全0
4)MLU370_S4的cluster数量为6,最多可以起U4任务。

@PetrelYy PetrelYy added the BANGC label Jun 2, 2023
@PetrelYy PetrelYy added this to the 0.7.0 milestone Jun 2, 2023
@duzekunKTH duzekunKTH merged commit 87b89d7 into Cambricon:r0.7 Jun 2, 2023
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.

5 participants