Skip to content

Can't write out large rr_graphs in capnp format #2352

@duck2

Description

@duck2

direct_rf from titan_quick_qor with default settings creates a rr_graph with ~236M edges. Trying to write it out will result in a crash with the message failed: total size of struct list is larger than max segment size.

Expected Behaviour

If the rr_graph fits in memory, we should be able to write it out to the disk.

Current Behaviour

We can't

Possible Solution

Apparently Cap'n Proto has a hard limit [1] [2] for words in a single segment. A similar limit applies to lists of structs. From [2]:

D (29 bits) = Size of the list:
when C <> 7: Number of elements in the list.
when C = 7: Number of words in the list, not counting the tag word
(see below).
[...]
A struct list must always be written using C = 7.

In my understanding, this means the size of a list of structs is limited to 8 bytes * 2^29 = 2 GiB. When the list of edges is bigger than that capnp just refuses to serialize it.

A serialized rr_graph edge is 3 uint32s plus a metadata list (which I suppose is a "list tag" of 64 bits) so it's 20 bytes. 236M edges will require ~4.7 GB.

Any ideas on how to go about this? I can't think of a way to solve it without manually tweaking the schema, which somewhat ruins the purpose of having a auto-generated one.

(Maybe this can be an excuse to finally drop uxsdcxx and provide a standalone converter for XML rr graph owners, but I need to progress on the parallel router first...)

Steps to Reproduce

  1. Run titan_quick_qor
  2. Go to run directory for directrf_stratixiv_arch_timing.blif
  3. Get run command from vpr.out, append --write_rr_graph rr_graph.bin and execute it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions