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

Add a section with examples #333

Merged
merged 7 commits into from
May 22, 2024
Merged

Conversation

rofirrim
Copy link
Collaborator

The examples are non-normative. I've taken a subset of the examples in the examples directory of the repository.

This fixes #319

The examples are non-normative. I've taken a subset of the examples
in the examples directory of the repository.
@rofirrim
Copy link
Collaborator Author

@nick-knight can you take a closer look at the matrix multiplication? I took the existing example but it presumes a transposed matrix in B (I think) so I reimplemented it for a more naive approach so we can show a strided access. Also I understand partial accumulations should use tail undisturbed (regardless of the fact that this is a vfmacc with already 3 input operands).

@nick-knight
Copy link
Collaborator

@rofirrim I've always strongly disliked the matmul example in this repo: it's not how a sane person would implement it.

@camel-cdr
Copy link
Contributor

I agree with @nick-knight, I think we should stick with code we can confidently say will portable perform at close to the peak performance.

@rofirrim
Copy link
Collaborator Author

I agree with @nick-knight, I think we should stick with code we can confidently say will portable perform at close to the peak performance.

We are using vector instructions because there is an assumption that those can speed-up our applications. However, it is going to be risky to make claims about performance in the examples. Different implementations will expose different performance characterístics and we do not want to/can cater to each one.

I think the examples should be that, examples, and not necessarily a reference or library of efficient functions. The matrix multiply example is intentionally qualifed as "naive" in the examples for this reason.

Copy link
Collaborator

@kito-cheng kito-cheng left a comment

Choose a reason for hiding this comment

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

LGTM, and...

I think the examples should be that, examples, and not necessarily a reference or library of efficient functions. The matrix multiply example is intentionally qualifed as "naive" in the examples for this reason.

+1 for that, the main goal of those example in this document is demonstrate the intrinsic programming model rather than providing best implementation :)

Where I accidentally used "n" I wanted to use "m". The vector access was
correct already.
@kito-cheng kito-cheng merged commit 9a02dc9 into riscv-non-isa:main May 22, 2024
4 checks passed
@rofirrim rofirrim deleted the rvv-examples branch May 22, 2024 10:04
@rofirrim
Copy link
Collaborator Author

Hi @kito-cheng thanks a lot for merging this for me.

I will update v1.0.x to the current main so not to stall further work (such as bf16).

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.

Add a section with examples
5 participants