Skip to content

Conversation

@yuchuan-cao
Copy link
Contributor

fixes #15330
fix the alloc size of acl_rstd
the parameter dims is set to 3 according to CANN document

@yuchuan-cao yuchuan-cao changed the title fix ggml_cann_rms_norm CANN: fix ggml_cann_rms_norm Aug 14, 2025
@github-actions github-actions bot added ggml changes relating to the ggml tensor library for machine learning Ascend NPU issues specific to Ascend NPUs labels Aug 14, 2025
@hipudding
Copy link
Collaborator

@yuchuan-cao Thanks for your contribution!

@hipudding
Copy link
Collaborator

@yuchuan-cao Do you mind rebasing to the latest code to avoid CI failure?

@yuchuan-cao
Copy link
Contributor Author

@yuchuan-cao Do you mind rebasing to the latest code to avoid CI failure?

Thanks for the reminder! I’ve rebased my code to the latest master.

aclTensor* acl_rstd =
aclnn_zero(ctx, zero_tensor_allocator.get(), zero_tensor_n_bytes,
src->ne, GGML_MAX_DIMS, ggml_cann_type_mapping(src->type),
rstd_ne, 3, ggml_cann_type_mapping(src->type),
Copy link
Collaborator

@hipudding hipudding Aug 20, 2025

Choose a reason for hiding this comment

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

I think you can just change GGML_MAX_DIMS to GGML_MAX_DIMS-1, and rstd_ne is not needed. aclnn_zero will only use acl_rstd as a 3-dim tensor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, thanks! I suppose #15419 would better fix this issue.

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.

Misc. bug: ggml_cann_rms_norm causes CANN kernel crash when running llama-bench.

2 participants