You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gpl: per-region GPU density field for multi-region placement
gpl builds one NesterovBase per placement region (top-level core plus one per
power-domain / odb group) but a single shared NesterovBaseCommon with one GPU
DeviceState. The four FFT field Views (d_bin_density / d_bin_phi / d_bin_elec_*)
and the bin-grid metadata lived in that shared DeviceState and were overwritten
per region by DeviceState::initBinViews; the Nesterov loop also solves all
regions and only then gathers all regions, so with more than one region a
region's density solve read another region's (or a wrong-sized) bin buffer.
That is an out-of-bounds device access when the regions' bin counts differ, or
a silently wrong placement when they match (measured +119% HPWL on the dual
voltage-domain region01 design). Single-region placement was unaffected, so the
existing tests passed. Reported by a Codex review.
Move the per-region state into a new RegionDensityField (PIMPL, one per
NesterovBase, declared before fft_/density_grad_backend_ so it outlives the
backends that borrow it); it holds only the four field Views + bin metadata.
The shared DeviceState keeps the netlist/HPWL pool and the per-inst density
params + gather output, which are indexed by the global gCellStor instance id
and identical across regions; their allocation moves out of the old
initBinViews into the DeviceState constructor. Both GPU density paths are
repointed at the region field: the device-resident pipeline
(NesterovDeviceContext) and the host-staged FFT path (GpuFftBackend /
GpuDensityGradientBackend), the latter used in timing-driven / routability mode
where the device context is disabled -- which is why the field is owned by
NesterovBase rather than the device context.
Harden two previously-silent seams: the bin-count check in densitySolveIteration
now aborts in release builds (was a debug-only assert), and NesterovBase errors
out if a GPU region's bin grid is empty instead of silently using CPU density.
Add two GPU-only regression tests (CMake-only, like the other GPU tests):
region01_gpu (two same-size domains; the silent-interleaving case) and
region01_gpu_asym (different-size domains; the out-of-bounds case), each
checking the GPU total HPWL within 3% of the CPU reference and pinned to
ENABLE_GPU=1 so they cannot pass on the CPU backend.
Verified: CPU goldens unchanged (including multi-region CPU region01);
single-region GPU within 0.001% of CPU; multi-region GPU now within 0.7% /
0.28% of CPU (was +119%). Also trimmed redundant comments across the GPU path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Minjae Kim <develop.minjae@gmail.com>
0 commit comments