Skip to content

Fix reduction behavior#111

Open
igor-sachok wants to merge 2 commits into
pulp-platform:mainfrom
igor-sachok:reduction-fix
Open

Fix reduction behavior#111
igor-sachok wants to merge 2 commits into
pulp-platform:mainfrom
igor-sachok:reduction-fix

Conversation

@igor-sachok

Copy link
Copy Markdown

A reduction instruction whose operand depends on a preceding arithmetic instruction can deadlock: once the reduction enters the Reduction_Reduce stage. The preceding instruction's retire condition in control_proc is never satisfied — it can't retire and release its result. The reduction, in turn, is stuck waiting on that same result. That creates a deadlock.
Code example:
asm volatile("vsetvli %0, %1, e8, m8, ta, ma" : "=r"(vl) : "r"(64));
asm volatile("vmv.v.i v0, 1");
asm volatile("vrsub.vi v16, v0, 0");
asm volatile("vmv.v.i v24, -1");
asm volatile("vredand.vs v8, v16, v24");
asm volatile("vmv.x.s %0, v8" : "=r"(result));
A solution is to add a check to control_proc that non-reduction instructions can retire regardless of reduction_state_q

Ihor Sachok (ihor.sachok@unibo.it) and others added 2 commits July 9, 2026 12:50
@igor-sachok igor-sachok reopened this Jul 10, 2026
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