Repository navigation
scoreboard: dispatch credits beyond the queue depth for the ALU and FPU (VX_CFG_DISPATCH_CREDITS) - #582
Open
jel221 wants to merge 2 commits into
Open
scoreboard: dispatch credits beyond the queue depth for the ALU and FPU (VX_CFG_DISPATCH_CREDITS)#582jel221 wants to merge 2 commits into
jel221 wants to merge 2 commits into
Conversation
…PU (VX_CFG_DISPATCH_CREDITS)
The scoreboard holds one credit per dispatch-queue entry, and an op's
credit comes back only when the unit takes it from the queue, not through
the operand read in between. With one credit per entry, issue stops while
the queue still has room for ops that are only being read.
VX_CFG_DISPATCH_CREDITS sets the credits of the ALU and the FPU per issue
slice; the other units keep one per entry. An op issued beyond the queue
depth waits at the operand collector's output until its queue frees an
entry. Default: the queue depth, the same hardware as before (Beacon:
identical depth and LUTs on core, core_ldst, tensor and top_vortex).
SimX: update_queue_full() takes the same limit (dispatch_credits()).
model_parity: parity-dispatch-credits-{sgemm,sgemmx,q2-lanes,iw2}.
The new knob changes the resolved config, so every perf_gate case's config_hash moves. Cycles and instruction counts are unchanged in all 51 cases (the default is the queue depth). Command: pytest ../ci -m perf_gate --update-baselines (from a configured XLEN 32 build tree). Re-recorded by: agent, authorized by jel221 2026-12-03
jel221
marked this pull request as ready for review
December 3, 2026 21:54
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comment: This gives more dispatch credits than the number of dispatch queue depth for ALU and FPU. The credit doesn't come back through the ~6 cycle operand read, so it's actually a lot more pessimistic than it needs to be, which actually puts the bottleneck at issue. LSU and TCU keeps one credit per entry.
Summary
A new knob,
VX_CFG_DISPATCH_CREDITS, sets the ALU's and FPU's scoreboard credits per issue slice above their dispatch queue depth. Default: the queue depth, which is the same hardware as master.The scoreboard holds one credit per dispatch-queue entry. An op's credit comes back only when its unit takes the op from the queue, not when the op reaches the queue. So the ~6-cycle operand read between issue and the queue holds credits that no queue entry is using, and issue stops while the queue still has room.
With more credits than entries:
update_queue_full()takes the same per-unit limit (dispatch_credits()).Gain on master: small and kernel-dependent. This is preliminary work for 256 registers per thread. Its target is a frontend that no longer bounds issue (the fetch L0, #581) with the few warps that many registers leave. rtlsim cycles, 1 core, 4 threads, 8 credits, against the base (default credits). The isolated alternative, a dispatch queue of 8 (
VX_CFG_DISPATCH_QUEUE_SIZE=8), is beside it for V-ISO-6:At 2 and 4 warps without the L0, both are within ±0.6%: fetch bounds issue there.
Where it loses: sgemmx at 8 warps without the L0 loses with either form of extra room (+8.4% credits, +7.3% queue). SimX counters for the credits run, base → 8 credits:
The kernel is 39% loads and 49% FPU, and bound by load latency. FPU ops issued into the extra room delay the loads behind them in the same issue stream. With the L0 on, the same kernel at 8 warps gains 1.6% with credits. So the knob stays at the queue depth by default, for the register-file work to turn on where it pays.
Impact and evidence
Impact class: R3 (
pipeline-stage,gpu-pkg-types,config-knobs).Contracts touched:
VX_config.toml. AddsVX_CFG_DISPATCH_CREDITS(default$VX_CFG_DISPATCH_QUEUE_SIZE).VX_gpu_pkg. AddsDISPATCH_CREDIT_UNITSandDISPATCH_CREDITS, withPACKAGE_ASSERT(DISPATCH_CREDITS >= 2). SimX has the matchingstatic_assert.make -C tests/regression run-simxandrun-rtlsimwith-DVX_CFG_DISPATCH_CREDITS=8: all pass. xrt not run: no FPGA flow for this preliminary change.model_parityparity-dispatch-credits-sgemm1.26%,-sgemmx0.29%,-q2-lanes0.98%,-iw20.89%; instruction counts equal in all four.perf_gatepytest ../ci -m perf_gate --update-baselines: onlyconfig_hashchanges; cycles and instruction counts are identical in all 51.logic_gatecore,core_ldst,tensorandtop_vortexPASS with identical depth and LUTs (e.g.core15 → 15 levels, 127,132 → 127,132 LUTs). 8 credits,coreagainst 923d4e2 (the parent before the rebase): 15 → 15 levels, +7 LUTs; Beacon ASICcore: +2 cells, +2 FFs. The deeper queue's numbers are in V-ISO-6 item 3.fpga_gate/asic_gate)Self-check: precheck: 7 pass, 0 with findings, 0 fail, 0 not run
Departures from SHOULD rules: none
Design note:
docs/proposals/dispatch_credits_design_note.mdV-ISO-6 justification
VX_CFG_DISPATCH_QUEUE_SIZE=8.core: +36 LUTs and +18 FFs for the queue, against +7 LUTs for the credits.core: +13,810 FFs (+14.7%) and +13,922 cells for the queue, against +2 FFs and +2 cells for the credits.core,core_ldst,tensorandtop_vortex(evidence table).perf_gate: all 51 cases identical in cycles and instructions.Review notes
An independent review found no correctness bug. Its notes:
parity-dispatch-credits-q2-lanes(a two-entry queue with half-width ALU and FPU lanes, so the longest wait) andparity-dispatch-credits-iw2(issue width 2).Pre-existing on master, out of scope: the scoreboard spends a credit per issued instruction (
fu_issue), and the dispatcher returns one per packet it hands to the unit (fu_release). WithSIMD_WIDTH < NUM_THREADSan instruction is several packets, so the two counts differ. This change does not touch that accounting.Checklist
known_issue:, wider tolerance, smaller args, removed case) without a root-cause plan.