Skip to content

fix!: Add tensor size check to kernels#1268

Merged
gunes-arm merged 1 commit intomainfrom
pr/tensor-size-checks
Mar 30, 2026
Merged

fix!: Add tensor size check to kernels#1268
gunes-arm merged 1 commit intomainfrom
pr/tensor-size-checks

Conversation

@andflo-Arm
Copy link
Copy Markdown
Contributor

@andflo-Arm andflo-Arm commented Mar 12, 2026

The size check implies a tensor size restriction to 2^31-1 bytes. Kernel
configurations larger than that will no longer validate.

Resolves: COMPMID-8697

Change-Id: I54f73ade5cb4a0d34d831505d83d1d7ef526b5db

@gunes-arm
Copy link
Copy Markdown
Contributor

I didn't look yet, but it'd be useful anyways. Could you explain why this is a breaking change in the description? And, I suppose we need to add smth like BREAKING CHANGE (?) somewhere

@andflo-Arm andflo-Arm force-pushed the pr/tensor-size-checks branch from 493638b to 773dc2f Compare March 13, 2026 08:41
@andflo-Arm
Copy link
Copy Markdown
Contributor Author

I didn't look yet, but it'd be useful anyways. Could you explain why this is a breaking change in the description? And, I suppose we need to add smth like BREAKING CHANGE (?) somewhere

Done. The exclamation mark serves the purpose of conveying breaking changes.

@gunes-arm
Copy link
Copy Markdown
Contributor

I didn't look yet, but it'd be useful anyways. Could you explain why this is a breaking change in the description? And, I suppose we need to add smth like BREAKING CHANGE (?) somewhere

Done. The exclamation mark serves the purpose of conveying breaking changes.

Are we adding a feature here, or are we fixing something?

@andflo-Arm
Copy link
Copy Markdown
Contributor Author

I didn't look yet, but it'd be useful anyways. Could you explain why this is a breaking change in the description? And, I suppose we need to add smth like BREAKING CHANGE (?) somewhere

Done. The exclamation mark serves the purpose of conveying breaking changes.

Are we adding a feature here, or are we fixing something?

I have thought a little about it, and I'm not sure what to call it. I'm hesitant to call it a fix because we're not fixing broken functionality (bug) -- we are adding something that simply didn't exist before. On the other hand it's also a bit of a stretch to call it a feature because the validation doesn't bring any new usable functionality. But I do lean more towards feat because it's still something new that is added.

@gunes-arm
Copy link
Copy Markdown
Contributor

I didn't look yet, but it'd be useful anyways. Could you explain why this is a breaking change in the description? And, I suppose we need to add smth like BREAKING CHANGE (?) somewhere

Done. The exclamation mark serves the purpose of conveying breaking changes.

Are we adding a feature here, or are we fixing something?

I have thought a little about it, and I'm not sure what to call it. I'm hesitant to call it a fix because we're not fixing broken functionality (bug) -- we are adding something that simply didn't exist before. On the other hand it's also a bit of a stretch to call it a feature because the validation doesn't bring any new usable functionality. But I do lean more towards feat because it's still something new that is added.

Here is my perspective, let me know what you think: I think we're fixing a bug because in the validate() calls, we should have been returning false for certain combinations. Those combinations weren't supported, but we were saying we were supporting them.

And, this is not a feature because we're not adding any new functionality. We're merely fixing a bug and possibly limiting our support set as a result of this conservative checks.

@andflo-Arm
Copy link
Copy Markdown
Contributor Author

I didn't look yet, but it'd be useful anyways. Could you explain why this is a breaking change in the description? And, I suppose we need to add smth like BREAKING CHANGE (?) somewhere

Done. The exclamation mark serves the purpose of conveying breaking changes.

Are we adding a feature here, or are we fixing something?

I have thought a little about it, and I'm not sure what to call it. I'm hesitant to call it a fix because we're not fixing broken functionality (bug) -- we are adding something that simply didn't exist before. On the other hand it's also a bit of a stretch to call it a feature because the validation doesn't bring any new usable functionality. But I do lean more towards feat because it's still something new that is added.

Here is my perspective, let me know what you think: I think we're fixing a bug because in the validate() calls, we should have been returning false for certain combinations. Those combinations weren't supported, but we were saying we were supporting them.

And, this is not a feature because we're not adding any new functionality. We're merely fixing a bug and possibly limiting our support set as a result of this conservative checks.

Yes it also makes sense. I think my reasoning was that if the library is used as intended, will something then go wrong? From that perspective, no, it's not a bug. But if validate defines what is intended, then yes, it's a bug because as you say, validate lied for certain combinations. I think this case is a bit muddy because validation by nature only makes a difference when the user tries to color outside the lines :) I'm happy to change to fix.

@andflo-Arm andflo-Arm force-pushed the pr/tensor-size-checks branch from 773dc2f to f6ceb31 Compare March 16, 2026 16:07
@andflo-Arm andflo-Arm changed the title feat!: Add tensor size check to kernels fix!: Add tensor size check to kernels Mar 16, 2026
Copy link
Copy Markdown
Contributor

@gunes-arm gunes-arm left a comment

Choose a reason for hiding this comment

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

I've only been able to check until NEGather. I'll continue.

@andflo-Arm andflo-Arm force-pushed the pr/tensor-size-checks branch from f6ceb31 to b8c4667 Compare March 17, 2026 14:11
@andflo-Arm andflo-Arm force-pushed the pr/tensor-size-checks branch 2 times, most recently from eae088c to a9f0051 Compare March 20, 2026 14:39
Copy link
Copy Markdown
Contributor

@morgolock morgolock left a comment

Choose a reason for hiding this comment

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

Good work, I think if we solve the duplication problem with const size_t one_channel = 1u; acrosss multiple files this will be ready to be merged

The size check implies a tensor size restriction to 2^31-1 bytes. Kernel
configurations larger than that will no longer validate.

Resolves: COMPMID-8697
Signed-off-by: Andreas Flöjt <andreas.floejt@arm.com>
Change-Id: I54f73ade5cb4a0d34d831505d83d1d7ef526b5db
@andflo-Arm andflo-Arm force-pushed the pr/tensor-size-checks branch from a9f0051 to 3411b63 Compare March 25, 2026 14:17
Copy link
Copy Markdown
Contributor

@morgolock morgolock left a comment

Choose a reason for hiding this comment

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

Great work @andflo-Arm !

The PR looks good to me. I see no obvious problems. I'll let @gunes-arm have a final review at it.

@gunes-arm gunes-arm self-requested a review March 30, 2026 09:05
@gunes-arm gunes-arm merged commit 7d0d25f into main Mar 30, 2026
2 checks passed
@gunes-arm gunes-arm deleted the pr/tensor-size-checks branch March 30, 2026 09:06
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.

3 participants