From: Jiaxing Hu <gahing@gahingwoo.com>
To: royalnet026@gmail.com
Cc: tomeu@tomeuvizoso.net, boogiepop@gmx.com,
linux-rockchip@lists.infradead.org,
dri-devel@lists.freedesktop.org
Subject: Re: [RFC] accel/rocket: DVFS on RK3588 - a hardware constraint, and some numbers
Date: Fri, 4 Sep 2026 23:08:53 +1200 [thread overview]
Message-ID: <20260904110853.85150-1-gahing@gahingwoo.com> (raw)
In-Reply-To: <20260903091646.7183-1-royalnet026@gmail.com>
Hi Igor,
> One honest gap: I could not yet take the voltage-vs-frequency
> curve [...] Future work.
I took one on RK3576 this week, from the correctness side, and it
turned out to be the answer to a fault I had been chasing for four
days. Short version: solved, and the fix is a voltage.
The fault. Two NPU cores with jobs in flight at the same time, and the
second one writes single words of its output wrong: the right value
plus a bit of the accumulator. Of 64 wrong words I took apart, 63 are
an integer away from the right one and 25 of those by exactly 1024,
and re-reading the same word after invalidating the CPU's cache of the
buffer gave the same wrong value 48 times out of 48, so it is what the
hardware wrote. One core is always exact. It took four days because it
is invisible to a single threaded harness.
The cause. Mainline sets no rate for CLK_RKNN_DSU0 and no board sets
vdd_npu_s0, so my ROCK 4D runs the NPU at 786.432 MHz on 750 mV, while
Rockchip's own table for this NPU asks 800 mV of its 800 MHz step at
the worst leakage bin. Same wall as yours on the rail, so the curve is
one device tree per point. A pass below is 5400 rows of a batched
matrix multiply, each row against the same multiply done one row at a
time:
786 MHz, 750 mV 11 to 25 wrong rows a pass
594 MHz, 750 mV 0, 0, 0, 0
786 MHz, 800 mV 0, 0, 0, 0
786 MHz, 850 mV 0, 0, 0, 0
The fix, two of them, both measured. Give the rail 800 mV and keep
786 MHz: both cores run, nine models come out identical, and my time
to first token drops about 20%. Or leave the rail alone and clock the
NPU at 594: also exact, and still ahead of one core at 786, because
what 786 MHz costs is the second core. My v12 takes 594 in the SoC
dtsi, since a board that describes no NPU rail has to be correct too,
and my runtime now reads the rail and the clock out of sysfs and only
runs the two cores together inside the vendor's envelope.
What I would do on RK3588. Your rows are one inference thread with a
bit-exact oracle, so they cannot see this class at all. Before the OPP
table is settled, run the oracle with all three cores loaded at 900
and 1000 MHz on 850 mV. And whatever the table ends up as, it needs
the voltage column with the rate: a rate without its rail is what
mainline has today, and it is what corrupts.
One SCMI note, since you are reading rates through it now. On RK3576
an assigned-clock-rates on the SCMI clock in the NPU node hangs the
board before the console comes up, with no kernel output at all. I
have not proven why, but the vendor's driver never sets that rate from
DT either: rockchip_opp_config_clks() returns early when the clock is
an SCMI clock and the device is not runtime active, so the rate is
only ever written from the runtime resume path with the domains
already on. Your EL3 path is a read, so none of this touches it.
Cheers,
Jiaxing
next prev parent reply other threads:[~2026-09-04 11:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 13:16 [RFC] accel/rocket: DVFS on RK3588 - a hardware constraint, and some numbers Igor Paunovic
2026-08-01 19:32 ` Jiaxing Hu
2026-08-02 12:04 ` Igor Paunovic
2026-08-15 18:24 ` Tomeu Vizoso
2026-08-17 18:22 ` Nicolas Dufresne
2026-08-18 7:27 ` Igor Paunovic
2026-08-18 12:12 ` Jonas Karlman
2026-08-18 12:30 ` Jonas Karlman
2026-08-19 5:52 ` Igor Paunovic
2026-08-19 9:40 ` Jonas Karlman
2026-08-19 12:59 ` Igor Paunovic
2026-08-19 16:20 ` Jonas Karlman
2026-08-19 18:48 ` Igor Paunovic
2026-08-19 20:07 ` Hüseyin BIYIK
2026-09-02 11:04 ` Igor Paunovic
2026-09-03 9:16 ` Igor Paunovic
[not found] ` <2f88072c-6aa3-4294-a35d-722d1c7a405c@email.android.com>
2026-09-03 18:51 ` Igor Paunovic
2026-09-04 11:08 ` Jiaxing Hu [this message]
2026-09-04 12:46 ` Igor Paunovic
2026-09-05 5:13 ` Jiaxing Hu
2026-09-05 7:01 ` Igor Paunovic
2026-08-19 18:47 ` Nicolas Dufresne
2026-09-04 11:19 ` Jiaxing Hu
[not found] <DKDOBW9CJ2Y3.10EEIZDTXPYJZ@cknow-tech.com>
2026-08-01 14:40 ` Igor Paunovic
2026-08-01 16:29 ` Diederik de Haas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260904110853.85150-1-gahing@gahingwoo.com \
--to=gahing@gahingwoo.com \
--cc=boogiepop@gmx.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=royalnet026@gmail.com \
--cc=tomeu@tomeuvizoso.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox