-
Notifications
You must be signed in to change notification settings - Fork 75
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
chore: add another implementation of multiversion #446
Conversation
Signed-off-by: usamoi <usamoi@outlook.com>
Signed-off-by: usamoi <usamoi@outlook.com>
Signed-off-by: usamoi <usamoi@outlook.com>
Signed-off-by: usamoi <usamoi@outlook.com>
I have a question, why it's hard to test multiversions of a function? Could you explain it more detailed? Could we use same name for different version like: #[multiversion(targets("x86_64+avx"))]
#[cfg(test)]
fn g() {
...
}
#[multiversion(targets("aarch64+neon"))]
#[cfg(test)]
fn g() {
...
}
#[cfg(test)]
#[multiversion(targets("aarch64+neon", "x86_64+avx"))]
fn g_test() {
g();
} Or a flattened test: #[multiversion(targets("x86_64+avx"))]
#[cfg(test)]
fn xxx_x86_64_avx_test() {
g();
}
#[multiversion(targets("aarch64+neon"))]
#[cfg(test)]
fn xxx_aarch64_neon_test() {
g_aarch64_neon();
} |
It can be written incorrectly. Some cases:
I do not understand what do you mean. |
Signed-off-by: usamoi <usamoi@outlook.com>
Can you help me with it? Edit:
|
Signed-off-by: usamoi <usamoi@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a comments for multiversion, other LGTM.
sparse vector should not have precision problem I think. 1e-5 should be enough, the failure might mean something is wrong |
Signed-off-by: usamoi <usamoi@outlook.com>
a9d7444
to
2da3ede
Compare
Signed-off-by: usamoi <usamoi@outlook.com>
9eba749
to
03ddcd7
Compare
Signed-off-by: usamoi <usamoi@outlook.com>
silver-ymz@5f0bac3 can fix |
Also, in my tests.
|
100 times evaluation on emulator shows EPS should be larger than Are you testing on a real machine? Is the difference caused by emulating? |
I found if I just copy the code in
All tests should be stressful to get real EPS... |
Signed-off-by: usamoi <usamoi@outlook.com>
Yes, I test on real machine.
I'm not sure. Could you provide the vectors which caused large EPS to reproduce? |
Signed-off-by: usamoi <usamoi@outlook.com>
I think I know why now. I should copy code in left zone to my editor. |
Signed-off-by: Mingzhuo Yin <yinmingzhuo@gmail.com>
Signed-off-by: usamoi <usamoi@outlook.com>
Signed-off-by: usamoi <usamoi@outlook.com>
Signed-off-by: usamoi <usamoi@outlook.com>
b83a179
to
9cbd82b
Compare
Signed-off-by: usamoi <usamoi@outlook.com>
* chore: add another implementation of multiversion Signed-off-by: usamoi <usamoi@outlook.com> * chore: update rust-toolchain Signed-off-by: usamoi <usamoi@outlook.com> * chore: use detect::multiversion Signed-off-by: usamoi <usamoi@outlook.com> * test: use detect::multiversion Signed-off-by: usamoi <usamoi@outlook.com> * ci: add sde test Signed-off-by: usamoi <usamoi@outlook.com> * test: add dot_internal_v4_avx512vnni_test Signed-off-by: usamoi <usamoi@outlook.com> * test: bvector tests Signed-off-by: usamoi <usamoi@outlook.com> * chore: add comments for detect Signed-off-by: usamoi <usamoi@outlook.com> * ci: do not run rust test 3 times Signed-off-by: usamoi <usamoi@outlook.com> * fix: svector sl2_v4 Signed-off-by: usamoi <usamoi@outlook.com> * test: run svector tests 10000 times Signed-off-by: usamoi <usamoi@outlook.com> * fix: svecf32_sl2_v4 Signed-off-by: Mingzhuo Yin <yinmingzhuo@gmail.com> * test: run vecf16 and veci8 test for 10000 times Signed-off-by: usamoi <usamoi@outlook.com> * test: run bvecf32 test for 10000 times Signed-off-by: usamoi <usamoi@outlook.com> * test: run tests for 300 times to reduce ci time Signed-off-by: usamoi <usamoi@outlook.com> * chore: update rust toolchain Signed-off-by: usamoi <usamoi@outlook.com> --------- Signed-off-by: usamoi <usamoi@outlook.com> Signed-off-by: Mingzhuo Yin <yinmingzhuo@gmail.com> Co-authored-by: Mingzhuo Yin <yinmingzhuo@gmail.com> Signed-off-by: jinweios <jinwei.peng@beingthink.com>
I noticed that it's hard to test multiversions of a function and the code can be written incorrectly easily.
Also, dispatching manual versions is not efficient.
So I reimplemented
multiversion
.Examples