Skip to content

opt(RVV): Optimize max and min float functions with intrinsics#4036

Merged
wangzhaode merged 1 commit intoalibaba:masterfrom
ihb2032:opt/rvv-minmax-float
Dec 22, 2025
Merged

opt(RVV): Optimize max and min float functions with intrinsics#4036
wangzhaode merged 1 commit intoalibaba:masterfrom
ihb2032:opt/rvv-minmax-float

Conversation

@ihb2032
Copy link
Contributor

@ihb2032 ihb2032 commented Dec 1, 2025

Summary

Optimize MNNMaxFloat and MNNMinFloat using RVV intrinsics.

Environment

  • Platform: sg2044
  • OS: EulixOS 3.0

Benchmark

Click to expand full test logs
[root@openeuler-riscv64 hebo]# ./test_max_float
inputCountUnit=4
Scalar time: 0.0000 sec
RVV time   : 0.0000 sec
Speedup    : 0.04x
Test inputCountUnit=4: PASSED
inputCountUnit=1
Scalar time: 0.0000 sec
RVV time   : 0.0000 sec
Speedup    : 0.00x
Test inputCountUnit=1: PASSED
inputCountUnit=3
Scalar time: 0.0000 sec
RVV time   : 0.0000 sec
Speedup    : 0.00x
Test inputCountUnit=3: PASSED
inputCountUnit=65536
Scalar time: 0.0086 sec
RVV time   : 0.0017 sec
Speedup    : 5.02x
Test inputCountUnit=65536: PASSED
inputCountUnit=1000000
Scalar time: 0.1321 sec
RVV time   : 0.0338 sec
Speedup    : 3.91x
Test inputCountUnit=1000000: PASSED
inputCountUnit=10000000
Scalar time: 1.3309 sec
RVV time   : 0.3729 sec
Speedup    : 3.57x
Test inputCountUnit=10000000: PASSED

All tests PASSED
[root@openeuler-riscv64 hebo]# ./test_min_float
inputCountUnit=4
Scalar time: 0.0000 sec
RVV time   : 0.0000 sec
Speedup    : 0.08x
Test inputCountUnit=4: PASSED
inputCountUnit=1
Scalar time: 0.0000 sec
RVV time   : 0.0000 sec
Speedup    : 0.00x
Test inputCountUnit=1: PASSED
inputCountUnit=3
Scalar time: 0.0000 sec
RVV time   : 0.0000 sec
Speedup    : 1.00x
Test inputCountUnit=3: PASSED
inputCountUnit=65536
Scalar time: 0.0105 sec
RVV time   : 0.0017 sec
Speedup    : 6.34x
Test inputCountUnit=65536: PASSED
inputCountUnit=1000000
Scalar time: 0.1587 sec
RVV time   : 0.0340 sec
Speedup    : 4.67x
Test inputCountUnit=1000000: PASSED
inputCountUnit=10000000
Scalar time: 1.5811 sec
RVV time   : 0.3776 sec
Speedup    : 4.19x
Test inputCountUnit=10000000: PASSED

All tests PASSED

</details>

Optimize MNNMaxFloat and MNNMinFloat using RVV intrinsics.

Signed-off-by: ihb2032 <1355790728@qq.com>
Co-authored-by: lyd1992 <liuyudong@iscas.ac.cn>
@wangzhaode wangzhaode merged commit dd30a2e into alibaba:master Dec 22, 2025
6 checks passed
wangzhaode added a commit that referenced this pull request Dec 22, 2025
opt(RVV): Optimize max and min float functions with intrinsics

GitOrigin-RevId: cf83302a16083000f569672536d270edb597b0a5
wangzhaode added a commit that referenced this pull request Dec 23, 2025
opt(RVV): Optimize max and min float functions with intrinsics

GitOrigin-RevId: 826e9dd9b4bb8b260d29bc9574840b83ec8e9154
@ihb2032 ihb2032 deleted the opt/rvv-minmax-float branch December 23, 2025 05:54
wangzhaode added a commit that referenced this pull request Dec 23, 2025
opt(RVV): Optimize max and min float functions with intrinsics

GitOrigin-RevId: cf83302a16083000f569672536d270edb597b0a5
wangzhaode added a commit that referenced this pull request Dec 23, 2025
opt(RVV): Optimize max and min float functions with intrinsics

GitOrigin-RevId: 826e9dd9b4bb8b260d29bc9574840b83ec8e9154
wangzhaode added a commit that referenced this pull request Dec 26, 2025
opt(RVV): Optimize max and min float functions with intrinsics

GitOrigin-RevId: d246089d9de5602aeb58e91d1169923d58ed9712
wangzhaode added a commit that referenced this pull request Dec 26, 2025
opt(RVV): Optimize max and min float functions with intrinsics

GitOrigin-RevId: 25bead2e772a50e179ef24daccd41ef4a3c7fc2e
wangzhaode added a commit that referenced this pull request Dec 26, 2025
opt(RVV): Optimize max and min float functions with intrinsics

GitOrigin-RevId: de26fbb514262653b70f182b7e892432cd5039b1
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.

2 participants