Skip to content

[compute/cker] Fix einsum test error#15161

Merged
chunseoklee merged 1 commit intoSamsung:masterfrom
ragmani:cker/fix_shape_replace_size_0
Apr 15, 2025
Merged

[compute/cker] Fix einsum test error#15161
chunseoklee merged 1 commit intoSamsung:masterfrom
ragmani:cker/fix_shape_replace_size_0

Conversation

@ragmani
Copy link
Copy Markdown
Contributor

@ragmani ragmani commented Apr 14, 2025

This commit allows dims_data to be nullptr when dimensions_count is 0.

ONE-DCO-1.0-Signed-off-by: ragmani ragmani0216@gmail.com

This commit allows dims_data to be nullptr when dimensions_count is 0.

ONE-DCO-1.0-Signed-off-by: ragmani <ragmani0216@gmail.com>
@ragmani ragmani added the PR/ready for review It is ready to review. Please review it. label Apr 14, 2025
@ragmani ragmani requested a review from a team April 14, 2025 12:02
// Allow dims_data to be nullptr when dimensions_count is 0,
// because there are no dimensions to copy. For any non-zero dimensions_count,
// dims_data must not be nullptr to ensure valid shape data is provided.
assert(dimensions_count == 0 || dims_data != nullptr);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the Einsum kernel, MatMulBCast is used with arguments where the dimensions_count is 0 and dims_data is nullptr. This happens when there are no batch dimensions (e.g., for 2D matrices), so passing an empty dimensions vector (size 0 and nullptr data) is valid.

@ragmani
Copy link
Copy Markdown
Contributor Author

ragmani commented Apr 14, 2025

This PR fixes a test error(#15030 (comment)).

Copy link
Copy Markdown
Contributor

@ys44kim ys44kim left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@seockho-kim seockho-kim left a comment

Choose a reason for hiding this comment

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

LGTM

@chunseoklee chunseoklee merged commit 0c55c99 into Samsung:master Apr 15, 2025
10 checks passed
@ragmani ragmani deleted the cker/fix_shape_replace_size_0 branch April 15, 2025 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR/ready for review It is ready to review. Please review it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants