grt: lower the virtual memory a 9.4 M-instance run must be configured with

Abierto
#12,075 9 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
cpp
Área
performance

Línea de trabajo

Start with the supplied XSTile_top_grt.tar.gz reproducer and run its run-me.sh script with OpenROAD on PATH; global_route.tcl shows the routing command and settings. Compare per-phase memory use with the reported profiles, focusing on obstruction setup and the mentioned findNetsObstructions, savePositionWithReducedResources, and getViaBoxes paths. Done means identifying what drives global_route's memory growth and whether that memory needs to remain resident all at once.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

grt Memory

The goal: lower the virtual memory (RAM plus swap) a machine must be configured with to run a large design through the flow. Configuring memory and swap per job is inconvenient in CI. There are two levers, and both have moved the needle on this reproducer:

  • Lower total consumption: #12074 (merged), global route 124.1 → 120.0 GiB; #12119, CTS 117 → 51.5 GiB; #12120, the legaliser's pixel grid freed, 116.5 → 94.3 GiB.
  • Memory-mapped backing files: carried in bazel-orfs as patches 0188–0199, not upstreamed: global_route -backing_file for the routing grid and read_db -backing_file for the database's table pages, with the file in ORFS's OBJECTS_DIR. The kernel pages to that file instead of to swap, so no swap has to be configured, and the file is reserved up front, so a disk that can't hold it stops the run at once instead of hours in.

Direction is welcome on which of these upstream wants, and where to look next.

The design

XiangShan's XSTile with every macro dissolved: about 9.4 M instances on an asap7 die of about 34 M GCells on 9 routing layers.

Which stages use what

Floorplan through global route in one process, before #12119, #12120 and the backing files, 56 GB of RAM plus swap. Memory a step no longer needs is not given back, so the peak is the sum:

step peak RAM + swap
read_db and CTS 117.1 GiB
legaliser, check_placement 157.4 GiB
global route 196.3 GiB

Global route alone, per phase, on unpatched master (this reproducer, tcmalloc's heap counter):

global route heap per phase

Setup takes global route from 23 to 92 GB before any routing. Those phases are sized by the die, not by the nets routed.

Why a backing file for the .odb helps

The database is about 23 GB, and global route keeps all of it resident to the end, though after setup it reads few of its tables. With read_db -backing_file each table is paged out to the file once global route stops reading it, and write_db brings back one table at a time. The grid goes the same way between the phases that use it. The plan, step by step: the black line is what is in RAM, red checkered is allocated but in the file, the dashed line a 62 GB machine:

the Top's memory under the plan

That timeline is planned, with sizes scaled from the measured phases. Measured with every carried patch, global route alone on XSTile's Top, from its CTS checkpoint, peaks at 57.4 GiB without swap, with the kept guides, routed nets, vias, wirelength and congestion report identical to the unpatched run. Floorplan through global route in one process goes from 196.3 to 96.0 GiB with #12119, #12120 and the backing files.

Reproducer

Download the reproducer, an untar-and-run archive (1.85 GB): XSTile_top_grt.tar.gz (release, SHA256SUMS)

tar xf XSTile_top_grt.tar.gz
cd XSTile_top_grt
PATH=<dir with openroad>:$PATH ./run-me.sh

It holds the global route's input .odb (the checkpoint after global route, guides cleared), a global_route.tcl that is just

read_db XSTile_top_grt.odb
set_global_routing_layer_adjustment M2-M9 0.5
set_routing_layers -clock M2-M9
set_routing_layers -signal M2-M9
global_route -congestion_iterations 0 -allow_congestion -verbose

and a run-me.sh that runs the openroad on PATH under /usr/bin/time -v. On origin/master abd3af8deb global route alone peaks at 124.1 GiB (resident plus swap) and takes 47 minutes; the per-phase breakdown is in this comment.

Lenguaje dominante
Verilog
Estrellas
3.4k
Forks
1.1k
Merge medio
3 d 11 h
PR fusionados (30 d)
245

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de The-OpenROAD-Project/OpenROAD

Todos los issues de The-OpenROAD-Project/OpenROAD

Issues similares

Más issues de Performance

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.