Skip to content

Conversation

@noemotiovon
Copy link
Collaborator

@noemotiovon noemotiovon commented Apr 9, 2025

Optimize the LOG , MEAN, PAD_REFLECT_1D, COUNT_EQUAL, STEP, SGN operator in the CANN backend with the aclnn acceleration library.

Test

  # LOG
Backend 1/2: CANN0
  Device description: Ascend910B3
  Device memory: 62432 MB (62163 MB free)

  LOG(type=f16,ne=[10,5,4,3]): OK
  LOG(type=f32,ne=[10,5,4,3]): OK
  5294/5294 tests passed
  Backend CANN0: OK

Backend 2/2: CPU
  Skipping
2/2 backends passed
OK
  
  # MEAN
Backend 1/2: CANN0
  Device description: Ascend910B3
  Device memory: 62432 MB (62163 MB free)

  MEAN(type=f32,ne=[10,5,4,3]): OK
  5294/5294 tests passed
  Backend CANN0: OK

Backend 2/2: CPU
  Skipping
2/2 backends passed
OK

  # PAD_REFLECT_1D
Backend 1/2: CANN0
  Device description: Ascend910B3
  Device memory: 62432 MB (62163 MB free)

  PAD_REFLECT_1D(type=f32,ne_a=[512,34,2,1],pad_0=10,pad_1=9): OK
  5294/5294 tests passed
  Backend CANN0: OK

Backend 2/2: CPU
  Skipping
2/2 backends passed
OK

  # STEP
Backend 1/2: CANN0
  Device description: Ascend910B3
  Device memory: 62432 MB (62163 MB free)

  STEP(type=f16,ne_a=[128,2,2,2],v=0): OK
  STEP(type=f16,ne_a=[5,7,11,13],v=0): OK
  STEP(type=f16,ne_a=[128,2,2,2],v=1): OK
  STEP(type=f16,ne_a=[5,7,11,13],v=1): OK
  STEP(type=f32,ne_a=[128,2,2,2],v=0): OK
  STEP(type=f32,ne_a=[5,7,11,13],v=0): OK
  STEP(type=f32,ne_a=[128,2,2,2],v=1): OK
  STEP(type=f32,ne_a=[5,7,11,13],v=1): OK
  5294/5294 tests passed
  Backend CANN0: OK

Backend 2/2: CPU
  Skipping
2/2 backends passed
OK

  # COUNT_EQUAL
Backend 1/2: CANN0
  Device description: Ascend910B3
  Device memory: 62432 MB (62163 MB free)

  COUNT_EQUAL(type=f32,ne=[4,500,1,1]): OK
  COUNT_EQUAL(type=f32,ne=[4,5000,1,1]): OK
  5294/5294 tests passed
  Backend CANN0: OK

Backend 2/2: CPU
  Skipping
2/2 backends passed
OK

  # SGN
Backend 1/2: CANN0
  Device description: Ascend910B3
  Device memory: 62432 MB (62163 MB free)

  SGN(type=f16,ne_a=[128,2,2,2],v=0): OK
  SGN(type=f16,ne_a=[5,7,11,13],v=0): OK
  SGN(type=f16,ne_a=[128,2,2,2],v=1): OK
  SGN(type=f16,ne_a=[5,7,11,13],v=1): OK
  SGN(type=f32,ne_a=[128,2,2,2],v=0): OK
  SGN(type=f32,ne_a=[5,7,11,13],v=0): OK
  SGN(type=f32,ne_a=[128,2,2,2],v=1): OK
  SGN(type=f32,ne_a=[5,7,11,13],v=1): OK
  5294/5294 tests passed
  Backend CANN0: OK

Backend 2/2: CPU
  Skipping
2/2 backends passed
OK

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Apr 9, 2025
@noemotiovon noemotiovon changed the title [CANN]Support Opt LOG && MEAN && PAD_REFLECT_1D [CANN]Support Opt LOG && MEAN && PAD_REFLECT_1D && STEP ... Apr 9, 2025
noemotiovon added 2 commits April 9, 2025 09:52
Signed-off-by: noemotiovon <[email protected]>
Signed-off-by: noemotiovon <[email protected]>
@hipudding hipudding merged commit fe5b78c into ggml-org:master Apr 10, 2025
51 checks passed
@hipudding hipudding added the Ascend NPU issues specific to Ascend NPUs label Apr 10, 2025
colout pushed a commit to colout/llama.cpp that referenced this pull request Apr 21, 2025
* [CANN]Support Opt LOG && MEAN && PAD_REFLECT_1D

* [CANN]Support COUNT_EQUAL && STEP && SGN

* [CANN]codestyle adjustment

* [CANN]codestyle adjustment

---------

Signed-off-by: noemotiovon <[email protected]>
timwu pushed a commit to timwu/llama.cpp that referenced this pull request May 5, 2025
* [CANN]Support Opt LOG && MEAN && PAD_REFLECT_1D

* [CANN]Support COUNT_EQUAL && STEP && SGN

* [CANN]codestyle adjustment

* [CANN]codestyle adjustment

---------

Signed-off-by: noemotiovon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ascend NPU issues specific to Ascend NPUs ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants