Hi all
ML-DSA-44 signs are an order of magnitude slower than ECDSA P-256. For
some months now, Loop has included a Vulkan GPU crypto library and its
nameserver has been able to start a Vulkan manager thread. MLDSA44
support has been added to it, and Loop's dnssec-signzone and
dnssec-verify have been updated to use the async DNSSEC and DST library
interfaces that make it possible for end-users to choose GPU signing. I
am sharing some notes and measurements from this work.
Some OpenSSL 3.5 and Loop GPU library benchmarks follow (extract from a
spreadsheet with other algorithms removed):
| ML-DSA-44 sign and verify ops/s | signs/s | vs.
24-CPU | verifies/s (*) | vs. 24-CPU |
|----------------------------------------------------------|----------:|-----------:|---------------:|-----------:|
| OpenSSL 3.5.9 on Intel Core Ultra 9 275HX with -multi 24 | 54,859 |
100% | 272,280 | 100% |
| OpenSSL 3.5.9 on AMD Ryzen 5 220 with -multi 12 | 11,656 |
21% | 59,143 | 22% |
| OpenSSL 3.5.7 on Raspberry Pi 5 with -multi 4 | 3,524 |
6% | 17,819 | 7% |
|----------------------------------------------------------|----------:|-----------:|---------------:|-----------:|
| Loop library on NVIDIA RTX 5070 laptop GPU @85W | 321,920 |
587% | 1,100,688 | 404% |
| Loop library *projection* for 2x NVIDIA RTX 5080 GPU (+) | 1,429,565 |
2,606% | 4,953,098 | 1,819% |
These are raw library ML-DSA-44 performance numbers without DNSSEC. The
Vulkan implementation uses hedged signing and implements the
requirements of sections 3.6.x of FIPS 204. Section 3.6.3 requirements
are implemented across the program, library, and Vulkan code.
(*) OpenSSL's speed benchmark program uses a single key (whose context
caches precomputed fields). A single signature is verified
repeatedly. It's highly unlikely for a network service to perform many
verifications with a single key. For verification, this can greatly skew
the results as OpenSSL caches parsed/precomputed fields (as an example,
in the case of RSA, expensive per-key precomputation of R^2 mod m used
in Montgomery arithmetic) in its key context. For comparison, the <Loop
library on NVIDIA 5070 laptop GPU @85W> result has single-key MLDSA44
verification measured at 3,007,385 verifies/s (1,105%). The Loop
benchmarks in the table used separate raw public keys without
precomputation per verification that reflects real-world usage. This is
just a clarification, not a note against the "speed" benchmark. :)
(+) A single RTX 5090 GPU might deliver a similar result, but it's
currently a USD ~7,000+ part because it shares a GB202 with RTX PRO
cards with which makes it attractive to aftermarket modders. The RTX
5080 is a USD ~1,500 part and two used together as separate Vulkan
physical devices could deliver similar performance as an RTX 5090 for
this application, with slightly higher TDP.
When a GPU is used as a coprocessor for signing and verification, it
frees up the CPU to run application code such as query processing. In
the OpenSSL benchmarks above, the CPU is fully occupied performing
signatures and verifies. When sharing the CPU with sign/verify ops,
application performance can be much lower such as for inline signers and
resolver validators, and vice versa. The lack of CPU overhead when using
a GPU as a coprocessor can be seen in the dnssec-signzone timings below
("user") for a 1 million RRsets zone:
[muks@w2 ~/tmp-signzone]$ cat mldsa44.frankenmodel.com.zone
$ORIGIN mldsa44.frankenmodel.com.
$TTL 3600
@ IN SOA ns-primary.banu.com. support.banu.com. 18 21600
3600 604800 3600
NS ns1.banu.com.
NS ns2.banu.com.
$GENERATE 1-1000000 host$ A 127.0.0.1
[muks@w2 ~/tmp-signzone]$
(a) Loop 1.99.22 (before; CPU signing and post-sign verification)
[muks@w2 ~/tmp-signzone]$ time dnssec-signzone -S -z -o
mldsa44.frankenmodel.com -e +2y mldsa44.frankenmodel.com.zone
Fetching ZSK 46736/MLDSA44 from key repository.
Verifying the zone using the following algorithms: MLDSA44.
Zone fully signed:
Algorithm: MLDSA44: KSKs: 0 active, 0 stand-by, 0 revoked
ZSKs: 1 active, 0 stand-by, 0 revoked
mldsa44.frankenmodel.com.zone.signed
real 3m14.693s
user 17m13.125s
sys 0m15.748s
[muks@w2 ~/tmp-signzone]$
(b) Loop 1.99.23 (after; GPU signing and post-sign verification)
(The first run after install or version upgrade can cause the Vulkan
driver to compile shaders and may take some time to complete.)
[muks@w2 ~/tmp-signzone]$ time dnssec-signzone -G -Y 1 -S -z -o
mldsa44.frankenmodel.com -e +2y mldsa44.frankenmodel.com.zone
Fetching ZSK 46736/MLDSA44 from key repository.
Verifying the zone using the following algorithms: MLDSA44.
Zone fully signed:
Algorithm: MLDSA44: KSKs: 0 active, 0 stand-by, 0 revoked
ZSKs: 1 active, 0 stand-by, 0 revoked
mldsa44.frankenmodel.com.zone.signed
real 0m20.845s
user 1m58.707s
sys 0m38.604s
[muks@w2 ~/tmp-signzone]$
The timings include zone load, dump, and pre-signing steps. The actual
sign and verification times were:
Signing time in seconds: 8.462
Signatures per second: 236325.942
Verification time in seconds: 7.785
Verifications per second: 256885.220
The dnssec-signzone signs/s and verifies/s are lower than the raw
library GPU performance on the RTX 5070 laptop GPU because of lower rate
of submission by the program. dnssec-signzone has high RBTDB lock
contention writing signed records, and its verify is still
single-threaded in zone traversal, etc. These limit the rate at which
sign/verify requests are submitted to the GPU. There's work to be done
to address this.
This dnssec-signzone process was run on Fedora 44 x86_64 with
loop-1.99.23.20261015053924.dce1b9848c-1.fc44.x86_64,
kernel-7.2.10-200.fc44.x86_64, openssl-3.5.9-1.fc44.x86_64,
vulkan-loader-1.4.341.0-1.fc44.x86_64,
xorg-x11-drv-nvidia-libs-615.78.08-1.fc44.x86_64 (rpmfusion).
Although Vulkan compute shaders are used for portability across device
vendors and there's nothing non-portable in the code, AMD (RADV), Intel
(ARL), and others such as as lavapipe have trouble currently due to
shader compilation issues among others. NVIDIA's Vulkan driver does not
use Mesa and does not have these issues. During development, I've
noticed that shader compilers and SPIR-V tools are particularly
problematic, but using Vulkan is advantageous in that it can be used out
of the box on Linux distros. RSA, ECDSA P-256 and P-384 sign/verify
compute shaders are also present but they currently have a large
performance regression due to recent changes. Resolver validation and
inline signing are not yet connected to the async interfaces. These will
be addressed.
On a personal note, this was brutal. I'd been developing this
acceleration branch since October 2025 alongside other work. Though at a
top-level the concept is straightforward (use GPUs to accelerate
DNSSEC), the implementation and considerations were extensive. The
Vulkan GPU manager, the design decisions to keep the units continually
fed, adding async APIs to the DST and DNSSEC library modules, and using
it in dnssec-signzone were all large changes. A/B selection and tuning
the methods used in the compute kernels was long and substantial
work. The work division approaches that perform well for ECDSA and MLDSA
are different at least.
A $GENERATE 1-10000 RRsets GPU-signed mldsa44.frankenmodel.com zone is
published. It can be queried using any validating resolver with MLDSA44
support such as Cloudflare's 1.1.1.1 service.
Mukund
_______________________________________________
DNSOP mailing list -- [email protected]
To unsubscribe send an email to [email protected]