sc_neurocore.chiplet

July 13, 2026 · View on GitHub

Scope

sc_neurocore.chiplet maps partitioned neuron networks onto multiple dies. It models package topology, derives AER routes, analyses communication and thermal constraints, and emits connected SystemVerilog plus XDC timing constraints. sc_neurocore.chiplet.hierarchical_partitioner supplies the upstream graph partition.

The package is research-tier. Generated RTL is an input to downstream FPGA or ASIC verification and physical-design tools; it is not a foundry sign-off artefact.

Responsibility modules

The historical sc_neurocore.chiplet.chiplet_gen and sc_neurocore.chiplet.hierarchical_partitioner import paths remain compatibility facades. The 36 chiplet-generator objects are implemented by focused, acyclic modules:

ModuleResponsibility
topologyDies, interposer links, mesh/ring/star/torus construction, and 3D stacking
routingAER routes, link-disjoint paths, timing, congestion, decorrelation seeds, and energy
thermalSteady-state and implicit-Euler transient package thermal solving
rtlDie wrappers, CDC bridges, routing tables, package top, and XDC emission
link_protocolsClock-domain configuration, CRC-32, and credit flow control
powerVoltage-island ownership and sequenced power-gating RTL
partitionNeuron-to-die assignments translated into routing tables

The package root continues to re-export 57 objects: 36 from the historical chiplet-generator surface and 21 from hierarchical_partitioner.

from sc_neurocore.chiplet import (
    ChipletGenerator,
    ChipletTopology,
    HierarchicalPartitioner,
    InterposerTech,
    RoutingTable,
    estimate_congestion,
    estimate_package_energy,
    make_torus,
    simulate_thermal,
)

Historical imports and pickle-qualified names remain valid:

from sc_neurocore.chiplet.chiplet_gen import ChipletTopology

assert ChipletTopology.__module__ == "sc_neurocore.chiplet.chiplet_gen"

Topology and interposer models

InterposerLink.from_tech(source, destination, technology) applies the following default link contract:

TechnologyLatency (ns)Jitter (ns)Bandwidth (Gb/s)BER
UCIe2.00.05321e-15
BoW1.50.03161e-12
EMIB1.00.02641e-15
CoWoS0.50.011281e-16
Organic5.00.581e-12
Custom2.00.1321e-15

Link identifiers must be non-negative. Latency and jitter must be finite and non-negative; bandwidth and data width must be positive; BER must be in [0, 1]. A measured custom thermal resistance may be supplied in K/W and must be finite and positive.

ChipletTopology.mesh_2d, .ring, .star, and make_torus construct deterministic layouts with non-zero per-die LFSR seeds. add_3d_stack adds reciprocal links for TSV, hybrid-bonded, or coplanar associations.

Routing and package analysis

RoutingTable maps a source neuron to a destination die, destination neuron, and Q8.8 weight. PartitionAssignment.to_routing_tables omits local and unmapped connections and creates tables only for source dies with cross-die traffic.

compute_decorrelation_seeds assigns each directed link a deterministic non-zero 16-bit seed using a golden-ratio sequence. find_disjoint_paths, adaptive_route, and bandwidth_aware_route operate on the same directed topology graph.

Communication energy uses the following package-model coefficients:

TechnologyEnergy (pJ/bit)
UCIe0.5
BoW0.3
EMIB0.2
CoWoS0.1
Organic2.0
Custom0.5

estimate_package_energy(topology, bits_per_link) applies uniform traffic to each directed link. estimate_congestion converts routed events at the historical 200 MHz reference clock into capacity utilisation. Negative traffic or event-rate inputs are rejected.

Thermal model

simulate_thermal builds a symmetric inter-die conductance matrix and a per-die ambient path. The steady state solves

[ (D-G)T=P+g_{amb}T_{amb}, ]

where G is the off-diagonal bond conductance and D contains row sums plus ambient conductance. Optional transients use implicit Euler:

[ (C/\Delta t + D-G)T_{k+1}=C/\Delta t,T_k + P + g_{amb}T_{amb}. ]

The returned PackageThermalReport contains steady-state temperatures, throttled die identifiers, the exact conductance matrix, and optional transient time and temperature arrays. Empty topologies, non-finite values, negative power, non-positive time steps, duplicate die identifiers, and invalid material properties fail before solving.

Generated RTL

ChipletGenerator.generate(topology, routing) emits:

  • one die wrapper per die, including the local AER router and LFSR;
  • one asynchronous FIFO, latency pipe, and decorrelator per directed link;
  • optional per-die AER routing tables;
  • a package top that connects every die and bridge AXI-Stream port;
  • XDC clocks and link-delay constraints.

emit_crc32_sv emits IEEE 802.3 normal and reflected CRC-32 feedback logic. emit_credit_controller_sv emits a saturating receiver-credit controller. emit_power_gating_sv isolates a voltage island before switch-off and waits four cycles after restoration before de-isolating it.

The modularisation preserves generated bytes for the canonical three-die EMIB ring, including die wrappers, bridges, routing table, package top, XDC, CRC, credit, and power-controller outputs.

Hierarchical partitioner

HierarchicalPartitioner recursively bisects a correlation-aware CSR graph, then applies KL refinement. Its objective combines edge cut, load balance, and boundary stochastic correlation. Ghost-cell, boundary-synchronisation, LFSR seed-allocation, migration, and MPI-rank mapping objects are exposed through the same package root.

The historical module is a 104-line facade. Its 21 public definitions retain their established import identity, qualified names, and pickle paths while ten acyclic implementation modules own one responsibility each:

ModuleResponsibility
hierarchical_graphTyped graph, edge, CSR, hierarchy, and deterministic seed models
hierarchical_backend_runtimeLazy discovery and loading of installed backend runtimes
hierarchical_backendsShared flat-buffer ABI encoding, validation, dispatch, and result decoding
hierarchical_bisectionCoarsening, deterministic spectral scoring, and recursive bisection
hierarchical_refinementPython reference KL refinement and incremental repartitioning
hierarchical_corePublic partitioning orchestration and backend selection
hierarchical_metricsEdge-cut, SCC-boundary, imbalance, and communication metrics
hierarchical_boundaryGhost-cell discovery and SCC-budgeted boundary synchronisation
hierarchical_balancingRuntime load metrics, migrations, and MPI rank mapping
hierarchical_reportingStable report model and deterministic report composition

The KL refinement has real Rust, Julia, Go, Mojo, and Python implementations behind a shared CSR-flat ABI. Backend output must decode to one complete, duplicate-free partition map before it can replace the Python result. Auto dispatch tries only installed maintained backends and falls back to the Python reference; an explicitly requested unavailable or malformed backend fails closed.

Pipeline wiring

  1. A network graph is partitioned across target dies.
  2. PartitionAssignment derives cross-die routing tables.
  3. ChipletGenerator emits connected RTL and constraints.
  4. Timing, energy, congestion, and thermal functions produce package evidence.
  5. Generated artefacts feed sc_neurocore.asic_flow and sc_neurocore.uvm_gen.

Backend truth

The chiplet-control operations have no installed non-Python compute backend. Historical files named for Rust, Julia, Go, and Mojo were non-executable scaffolds and are absent. This is distinct from the real multi-language KL refinement used by hierarchical_partitioner.

Chiplet-control backendInstalledReason
PythonyesAuthoritative package-control and analysis path
RustnoNumerical operations are sub-ms; RTL generation is textual graph orchestration
JulianoSame boundary; first-call JIT also exceeds the numerical operation budget
GonoSame boundary; the former service contained empty functions
MojonoSame boundary; the former kernel stored source text and returned zero

benchmarks/results/bench_chiplet.json records these backends as unavailable and exempt, rather than claiming that scaffold files are acceleration.

The partitioner is a different boundary. Its maintained implementations are engine/src/partition.rs, accel/julia/chiplet/kl_refine.jl, accel/go/partition/partition.go, and accel/mojo/partition/partition.mojo. Historical files named hierarchical_partitioner in generated acceleration directories were non-executable mirrors and are absent; they are not counted as backends.

Performance evidence

Reproduce the committed Python measurement with:

PYTHONPATH=src taskset -c 10 .venv/bin/python benchmarks/bench_chiplet.py \
  --json benchmarks/results/bench_chiplet.json

The committed run used Python 3.12.3, NumPy 2.2.6, Linux 6.17.0-35, 30 repeats per cell, and scheduler affinity [10]. One-minute load was 20.27, so the numbers are diagnostic and are not isolated-core throughput claims. The JSON includes the runner hash and every imported chiplet source hash.

OperationSizeMedian (ms)Minimum (ms)
make_torus2×20.0340.031
make_torus4×40.1500.126
make_torus8×80.5900.529
compute_decorrelation_seeds16 links0.0080.008
compute_decorrelation_seeds64 links0.0330.031
compute_decorrelation_seeds256 links0.1350.124
estimate_package_energy4 dies0.0030.002
estimate_package_energy16 dies0.0110.010
estimate_package_energy64 dies0.0420.040
simulate_thermal4 dies0.0650.058
simulate_thermal16 dies0.1850.155
simulate_thermal64 dies0.5040.464
ChipletGenerator.generate2 dies0.4370.385
ChipletGenerator.generate8 dies2.2001.808
ChipletGenerator.generate32 dies8.1663.561
HierarchicalPartitioner.partitionV=50, P=21.1980.980
HierarchicalPartitioner.partitionV=100, P=43.2262.031
HierarchicalPartitioner.partitionV=200, P=48.7964.176

A same-process, alternating-order comparison against the pre-refactor source showed topology construction 26–33% faster, seed and energy operations within approximately ±10%, full RTL generation within −7% to +7%, and thermal solving 22–38% slower because each die, power input, and solver boundary now validates finite physical values. The comparison was pinned but not exclusive and ran under high host load; it supports regression diagnosis, not a performance promotion claim.

The maintained cross-language KL evidence is reproduced with:

PYTHONPATH=src .venv/bin/python benchmarks/bench_kl_refine.py \
  --label candidate --json benchmarks/results/bench_kl_refine.json

The source-bound parent (d9c172c84) and candidate runs produced the same canonical partition SHA-256, 258b5c0c54ea33758f60090e68b7ce2a7657800ec16a6c90bc0eb52fbbd3585f, for every workload and all five backends. The V=1000 medians are diagnostic:

BackendParent (ms)Candidate (ms)Exact membership parity
Python287.309113.720yes
Rust0.2750.180yes
Julia0.4730.260yes
Go0.7670.360yes
Mojo0.4950.240yes

The committed result hashes the benchmark runner, all eleven Python partitioner modules, every maintained kernel source, and the available compiled binaries. The host used the powersave governor, affinity CPUs 0–11, and no isolated CPU reservation, so timing is local regression evidence rather than a throughput claim.

Verification

The partitioner-owning exact cohort contains 111 tests and covers all 664 statements and 186 branches across the eleven hierarchical*.py modules, with no misses or partial branches. The broader public-API, architecture, and benchmark cohort contains 134 passing tests, and the complete chiplet package contains 238 passing tests. Architecture tests enforce the acyclic dependency graph, one implementation owner per public object, dynamic backend diagnostics, historical pickling, maintained kernel presence, false mirror absence, the exact CI gate, and maximum file sizes of 258 production lines and 291 test lines. Strict MyPy, complete public docstrings, and Ruff cover the affected source, tests, and benchmark runner.

Limitations

  • The package remains research-tier; physical PPA and foundry sign-off happen in downstream flows.
  • Chiplet-control functions are Python-only by measured architectural choice.
  • Benchmark timings are host-load-sensitive and the committed run was not exclusive.

References

  • UCIe Consortium. UCIe Specification 1.0. 2022.
  • Open Compute Project. Bunch of Wires Specification. 2022.
  • Skadron, K. et al. “HotSpot: A Compact Thermal Modeling Methodology for Early-Stage VLSI Design.” IEEE Transactions on VLSI Systems, 2006.
  • Karypis, G. and Kumar, V. METIS: A Software Package for Partitioning Unstructured Graphs and Computing Fill-Reducing Orderings of Sparse Matrices. University of Minnesota, 1998.