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

[0029] Clarify 16-byte underlying allocation requirement #430

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

damyanp
Copy link
Member

@damyanp damyanp commented Mar 14, 2025

No description provided.

@@ -318,7 +318,9 @@ interpretation** and **matrix layout** behaving as described [above]
The base address of **matrix resource** and **matrix offset** must be 128 byte
aligned. Also note that the size of the underlying allocation is guaranteed to
be a multiple of 16 bytes ensuring that the 16 bytes access of the last
row/column of the matrix is valid memory
row/column of the matrix is valid memory. Implementations may write to the
Copy link
Contributor

Choose a reason for hiding this comment

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

One idea is to rewrite this as : Implemetations may need to use the padding space (e.g while using smaller types like FP16 that certain hardware might not natively support and are therefore emulated with bigger native types), so as a general rule using the padding space is undefined behavior.

Just to give the reader more information of why we have this restriction.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is more about supporting cases where there is native support for the type but it has additional alignment requirements. I think I might leave this as it is for now, can add clarification later, but that really belongs in the user documentation.

Comment on lines 927 to +930
* If SrcLayout is row-major or column-major, then SrcStride should be greater than the length of a row/column, and a
multiple of the element size.
* If DestLayout is row-major or column-major, then DestStride should be greater than the length of a row/column, and a
multiple of the element size.
multiple of 16.
Copy link
Member

Choose a reason for hiding this comment

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

Is it correct that both of these bullets are talking about row-major/column-major, but only dests have this stride requirement? Perhaps the 16 byte stride requirement should be unconditionally applied to the dest wording here, i.e. a new bullet that's not coupled to the row-major/column-major bit.

Copy link
Member Author

Choose a reason for hiding this comment

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

The stride value is ignored for non row-major/column-major layouts, so it isn't really unconditionally applied to the dest. Or am I misunderstanding your suggestion?

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, forgot that spec detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants