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

オープン
#12,075 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
cpp
領域
performance

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Verilog
スター
3.4k
フォーク
1.1k
平均マージ
3日 11時間
マージ済み PR(30日)
245

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

The-OpenROAD-Project/OpenROAD のほかの issue

The-OpenROAD-Project/OpenROAD の issue をすべて見る

似ている issue

Performance の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。