Stream: t-compiler

Topic: do we have graphs/tables/something of cgu partitioning?


simulacrum (May 22 2020 at 15:03, on Zulip):

@Wesley Wiser I was thinking during the meeting -- to what extent would it be helpful to have some visualization (at least a set of bullet-y lists) of the CGUs we ended up with and how we got there?

simulacrum (May 22 2020 at 15:03, on Zulip):

Do we dump this somehow today?

simulacrum (May 22 2020 at 15:03, on Zulip):

Like, has anyone looked at the CGUs for say serde and said "hm these make sense"

davidtwco (May 22 2020 at 15:04, on Zulip):

-Z print-mono-items={lazy,eager} prints the mono-items and the cgu(s) that they're in, IIRC

pnkfelix (May 22 2020 at 15:06, on Zulip):

I assume the print out is not in a format usable by graphviz though?

Félix Fischer (May 22 2020 at 15:06, on Zulip):

I think having visualizations at hand would help a ton. Maybe we could show these from the perf runs reports. Like, having a button that pops up the visualization for this or that particular run?

pnkfelix (May 22 2020 at 15:06, on Zulip):

not sure how much that would help/hinder analysis, but it seems worth considering

simulacrum (May 22 2020 at 15:06, on Zulip):

yes, I ask this primarily to gauge whether they'd be useful for perf

davidtwco (May 22 2020 at 15:06, on Zulip):

pnkfelix said:

I assume the print out is not in a format usable by graphviz though?

no, but all the information we'd need is there though, I think

simulacrum (May 22 2020 at 15:07, on Zulip):

@davidtwco I don't think they show the merging strategy, or maybe I'm not seeing it

simulacrum (May 22 2020 at 15:07, on Zulip):

basically what I was thinking is sort of a "tree" where the initial set is at the bottom collapsing to ~16 at the top if that makes sense

Félix Fischer (May 22 2020 at 15:07, on Zulip):

Maybe we could dump detailed reports with a flag? Like... "here's how we started, and this is how it looked after each merging"

davidtwco (May 22 2020 at 15:08, on Zulip):

Oh, you're right - it wouldn't give you that - it would just tell you where things ended up; misread the initial message.

Félix Fischer (May 22 2020 at 15:08, on Zulip):

Yes, exactly what simulacrum said!

simulacrum (May 22 2020 at 15:08, on Zulip):

I think the end state is useful, but I imagine that the way there is also pretty key to understanding the decisions made

Félix Fischer (May 22 2020 at 15:08, on Zulip):

And to potentially spot weaknesses in the current scheme

Wesley Wiser (May 22 2020 at 15:09, on Zulip):

davidtwco said:

-Z print-mono-items={lazy,eager} prints the mono-items and the cgu(s) that they're in, IIRC

Oh, that's super useful! I've been using RUSTC_LOG=rustc_mir::monomorphize::partitioning which prints out similar data at each step of the algorithm.

davidtwco (May 22 2020 at 15:11, on Zulip):

the output looks like the following, for anyone who's interested and can't check:

MONO_ITEM fn alloc::alloc[0]::alloc[0] @@ 1nzjqubjkxlft6bh[External]
MONO_ITEM fn alloc::alloc[0]::alloc_zeroed[0] @@ 1nzjqubjkxlft6bh[Internal]
simulacrum (May 22 2020 at 15:12, on Zulip):

anyway, @Wesley Wiser do you think exposing even just the raw dumps in perf somehow would be helpful?

Wesley Wiser (May 22 2020 at 15:14, on Zulip):

I would love that honestly

Wesley Wiser (May 22 2020 at 15:14, on Zulip):

Just getting the data out of rustc to look at isn't trivial

Wesley Wiser (May 22 2020 at 15:14, on Zulip):

Although @davidtwco's flag should help quite a bit

Wesley Wiser (May 22 2020 at 15:15, on Zulip):

The other thing I ended up doing was dumping the log output to a file and then using a graphical diff tool on it between runs

Wesley Wiser (May 22 2020 at 15:15, on Zulip):

(especially in the incremental test case)

davidtwco (May 22 2020 at 15:15, on Zulip):

I've got the output of those flags for servo-script with and without polymorphisation in debug and release to try look into, not gotten to doing it yet.

Last update: Jun 04 2020 at 18:45UTC