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](mluOpCore): access variable in tensor struct through function in tensor.cpp and tensor.h #1151

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

nth-BYTE
Copy link
Collaborator

@nth-BYTE nth-BYTE commented Nov 20, 2024

Thanks for your contribution and we appreciate it a lot. 🚀🚀

1. Motivation

Please describe your motivation and the goal you want to achieve through this pull request.

2. Modification

In mluOpTensorStruct , pubilc variables have been changed into private variables, except those will be removed in future, e.g. position,positions,scale,scales,offset,offsets. And then, some unused methods are deleted ,including tensorDimN,tensorDimC,tensorDimH,tensorDimW

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
    • diff1
      • float32 mlu diff1 <= 1e-5
      • float32 mlu diff1 <= 3e-3
      • float16 mlu diff1 <= 3e-3
    • diff2
      • float32 mlu diff2 <= 1e-5
      • float32 mlu diff2 <= 3e-3
      • float16 mlu diff2 <= 3e-3
    • diff3
      • mlu diff3 == 0
      • mlu diff3_1 == 0
      • mlu diff3_2 == 0
  • dynamic threshold
    • diff1: mlu diff1 <= max(baseline diff1 * 10, static threshold)
    • diff2: mlu diff2 <= max(baseline diff2 * 10, static threshold)
    • diff3: mlu diff3 <= max(baseline diff3 * 10, static threshold)
      • float32, threshold = 1e-5
      • float16, threshold = 1e-3

3.1.2 Operator Scheme checklist

  • Supported hardware
    • MLU370
    • MLU590
  • Job types
    • BLOCK
    • UNION1
    • UNION2
    • UNION4
    • The operator will dynamically select the most suitable task type, for example, UNION8

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

# The test results should contain Op name, Shape, Data type,  
#   MLU Hardware Time(us), MLU Interface Time(us), MLU IO Efficiency, 
#   MLU Compute Efficiency, and Mlu Workspace Size(Bytes)
# 
# for example:
#
# ----------- case0 -----------
# case0
# [Op name                ]: abs
# [Shape                  ]: input.shape=[1024,1024,3,4], output.shape=[1024,1024,3,4]
# [Data type]             ]: float32
# [MLU Hardware Time      ]: 15728 (us)
# [MLU Interface Time     ]: 369.008 (us)
# [MLU IO Efficiency      ]: 0.23275
# [MLU Compute Efficiency ]: 0.5
# [Mlu Workspace Size     ]: -1 (Bytes)
# 
# ----------- case1 -----------
# ...

Platform:MLU590

# ----------- case0 -----------
# ----------- case1 -----------
# ...

3.4 Summary Analysis

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

@nth-BYTE nth-BYTE force-pushed the nl21427_2 branch 3 times, most recently from aedefba to abfc867 Compare November 22, 2024 10:00
core/tensor.h Outdated Show resolved Hide resolved
core/tensor.h Outdated Show resolved Hide resolved
core/tensor.h Outdated Show resolved Hide resolved
core/tensor.h Outdated Show resolved Hide resolved
@nth-BYTE nth-BYTE force-pushed the nl21427_2 branch 7 times, most recently from fbd3d4e to a6000ac Compare December 2, 2024 10:03
core/tensor.cpp Outdated Show resolved Hide resolved
core/tensor.h Outdated Show resolved Hide resolved
core/tensor.h Outdated Show resolved Hide resolved
@nth-BYTE nth-BYTE force-pushed the nl21427_2 branch 3 times, most recently from 8057c4c to 45ae0ee Compare December 3, 2024 08:05
@nth-BYTE nth-BYTE force-pushed the nl21427_2 branch 2 times, most recently from 772ef6e to 22dee50 Compare December 4, 2024 04:18
@PetrelYy PetrelYy added the Feature Contribute a new feature label Dec 5, 2024
@PetrelYy PetrelYy modified the milestone: v1.4.0 Dec 5, 2024
@PetrelYy PetrelYy added this to the v1.5.0 milestone Dec 5, 2024
Copy link
Collaborator

@PetrelYy PetrelYy left a comment

Choose a reason for hiding this comment

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

LGTM

@duzekunKTH duzekunKTH merged commit b199179 into Cambricon:master Dec 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Contribute a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants