Skip to content

RISC-V: use the RVV DSDOT kernel for RISCV64_ZVL256B - #6171

Open
HiderX wants to merge 1 commit into
OpenMathLib:developfrom
HiderX:riscv-zvl256b-dsdot-rvv
Open

HiderX wants to merge 1 commit into
OpenMathLib:developfrom
HiderX:riscv-zvl256b-dsdot-rvv

Conversation

@HiderX

@HiderX HiderX commented Oct 25, 2026

Copy link
Copy Markdown

Summary

RISCV64_ZVL256B builds DSDOT from the scalar ../generic/dot.c. This patch
switches it to dot_rvv.c, compiled with -DDSDOT, which RISCV64_ZVL128B
already uses. It is a one-line change in KERNEL.RISCV64_ZVL256B.

Performance

Platform: SpacemiT K3, one X100 core (2.2 GHz), single thread, GCC 15.2,
cblas_dsdot with unit stride. Each number is the median ns per call, built
exactly from this patch:

n develop patched speed-up
1024 1235.2 249.7 4.9x
32768 38841 11315 3.4x
4194304 5019082 4426346 1.13x

At every size, all patched processes were faster than all develop processes.
Two earlier jobs ran the same DSDOT kernel object in a larger kernel-selection
experiment: an exploratory job and a separate confirmation job, each with
4 processes per build, alternating. They measured 4.2x, 3.4x and 1.14–1.17x.

Testing

  • OpenBLAS tests. The default make goal's tests give identical results
    before and after the patch: utest 141/141, extension tests 1479/1479, and all
    BLAS/CBLAS tests PASSED.

  • Accuracy checks against a long-double reference. The result must be
    within 2·n·eps·Σ|x·y| of the reference. The cases cover:

    • tail-heavy lengths from 1 to 32775;
    • strides 1, 2 and 3;
    • zero vectors;
    • magnitudes around 1e30 and 1e-30, and mixtures of the two;
    • Inf/NaN propagation.

    There were no failures, before or after the patch.

Disclosure: an AI coding agent (Anthropic Claude) prepared this patch, its
validation runs and this description on behalf of the account owner. All
numbers above come from archived runs on the board.

RISCV64_ZVL256B built DSDOT from the scalar ../generic/dot.c. Use dot_rvv.c
(compiled with -DDSDOT, as RISCV64_ZVL128B already does): on the SpacemiT X100
it is 4.9x faster at n = 1024, 3.4x at n = 32768 and 13% faster at n = 4M.

This branch has not been deployed

No deployments
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.

1 participant