GPU combinational-logic evaluation: per-output cone kernels can do more work than one shared network
Setup: evaluating a large combinational logic network on a GPU at millions of independent time points. Baseline kernel: one thread per point runs the whole shared network (about 2.4K logic units) and reads every output. Idea tried: one thread per (output, point) that runs only that output's input cone, expecting much less work per thread.
Result (one design, single run, diagnostic): outputs stayed bit-exact, but the kernel sum went from 19 s to 46 s. The cones overlap heavily. Across ~2.7K outputs, the summed cone sizes were ~12K unit evaluations per point vs ~2.4K for the shared network (5x), with ~7x more input lookups and ~6x more value copies.
The mistake in the original estimate: comparing one cone against the whole network per output. The baseline already shares the network across all outputs, so the right comparison is the sum of cone sizes vs the network size. Compute that ratio from the netlist before writing the kernel.
What to try instead: keep the shared network, and get the savings from change-driven evaluation (a dirty mask from inputs that actually changed, re-evaluating only affected units and carrying the rest forward), plus streaming input cursors instead of a per-point search.
Follow-up: a second version of the per-output cone kernel added streaming input cursors (search once, then advance) and skipped re-evaluation when no cone input changed. Output was still bit-exact, and it went from 46 s to 37.5 s, but that is still about 2x slower than the shared-network kernel (19 s). Change-skipping does not make up for logic duplicated about 5x across overlapping cones. The approach being tried next keeps each logic unit once per point (shared network), with lanes = points, and has each unit load and store only its own operands from point-major global columns instead of a large per-thread state struct that spills to local memory.