[GHC] #12437: 20% regression in max_bytes_used for T1969

#12437: 20% regression in max_bytes_used for T1969
-------------------------------------+-------------------------------------
Reporter: simonmar | Owner: osa1
Type: bug | Status: new
Priority: highest | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
This is 20% worse:
{{{
=====> T1969(normal) 1 of 1 [0, 0, 0]
cd "./T1969.run" && "/data/users/smarlow/ghc/inplace/test spaces/ghc-
stage2" -c T1969.hs -dno-debug-output -no-user-package-db -rtsopts -fno-
warn-missed-specialisations -fshow-warning-groups +RTS -G1 -RTS +RTS -V0
-tT1969.comp.stats --machine-readable -RTS
max_bytes_used value is too high:
Expected T1969(normal) max_bytes_used: 15017528 +/-15%
Lower bound T1969(normal) max_bytes_used: 12764898
Upper bound T1969(normal) max_bytes_used: 17270158
Actual T1969(normal) max_bytes_used: 18071064
Deviation T1969(normal) max_bytes_used: 20.3 %
*** unexpected stat test failure for T1969(normal)
}}}
One of these patches is the culprit, but I can't tell from the build logs
because the build was broken between these two points:
{{{
commit 6a4dc891fa7a8024d8f9f03b98ad675ff5fcbd91
Author: Ömer Sinan Ağacan

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonmar): @osa1: this is still failing, any chance you could take a look plesae? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): Yes, I'll take a look. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): I build 714bebf ("Implement unboxed sums") and it's parent commit. Here's the difference: {{{ - Parser allocates the same amount - Renamer/typechecker allocates +0.281 mb - Desugar allocates -0.006 mb - Simplifier allocates +0.093 mb - CoreTidy allocates +0.010 mb - CorePrep allocates +0.001 mb - CodeGen allocates -0.647 mb }}} overall it should allocate less, and we can see it in the RTS output. This is the output from the parent: ("bytes allocated", "786881504") This is from "implement unboxed sums": ("bytes allocated", "786256984") This is 624,520 less. But max_bytes_used is increased: ("max_bytes_used", "16536648") to ("max_bytes_used", "17697744") Difference: +1,161,096 So it seems like allocation-wise this is better but maybe GC is running at different times, and causing residence to increase? I'm not sure how to interpret this. Allocation is reduced so maybe this is a good thing? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): I also compared "Implement unboxed sums" with a13fda7 (current HEAD, "Clarify comment on makeCorePair"). `bytes_allocated` is even lower now: ("bytes allocated", "786255456") to ("bytes allocated", "786244136") Difference: -11,320 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonmar): See Note [residency] for how to measure max_bytes_used more accurately: https://phabricator.haskell.org/diffusion/GHC/browse/master/testsuite/tests/... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonmar): Ping! Validate has been broken for 2 weeks due to this. That's really ungood :( If you're sure that the regression is not due to your patch (after checking the instructions in Note [residency]) then please update the thresholds for the test. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): Regression is due to my patch, but I'm not sure what the solution is here. Do you want me to bump the threshold, because with the patch allocation is actually reduced? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonmar): I suggest: bump the threshold now to unbreak validate, and keep this ticket open to fix the regression before 8.2. Performance is a big focus for this release, so we'd like to keep on top of regressions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): I'm experimenting with some changes to fix this without bumping any numbers, so I may leave this unfixed for a little bit more if that's OK? Otherwise let me know and I'll bump the number. (Unfortunately even if I fix this, in a few commits it'll be broken again, this time because of `peak_megabytes_allocated`. Apparently it has been increasing for a long time and now we have 1MB left before it needs bumping again.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969
-------------------------------------+-------------------------------------
Reporter: simonmar | Owner: osa1
Type: bug | Status: new
Priority: highest | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ömer Sinan Ağacan

#12437: 20% regression in max_bytes_used for T1969
-------------------------------------+-------------------------------------
Reporter: simonmar | Owner: osa1
Type: bug | Status: new
Priority: highest | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ömer Sinan Ağacan

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): osa1, what do you think should happen to this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.1 => 8.4.1 Comment: Looks like we won't be looking into this for 8.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: osa1 Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): I tried adding `-i0.01` to the `extra_hc_opts` for T1969. It didn't seem to change much. However, when I removed the `-G1` from that line, the unboxed sum commit seemed to stop affecting anything. Interesting! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: dfeuer Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: osa1 => dfeuer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: dfeuer Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * Attachment "hp-after.hp.gz" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: dfeuer Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * Attachment "hp-before.hp.gz" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: dfeuer Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): I've attached before and after heap profiles. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: dfeuer Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonmar): It really does look like the peak is higher in the after profile, but to find out what's causing that you'd need to compile GHC with profiling and do a real heap profile. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: bgamari Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: dfeuer => bgamari Comment: David is going to continue work on this, in part as a proxy for #7258 and #13426. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: highest => high * owner: bgamari => (none) * milestone: 8.4.1 => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12437: 20% regression in max_bytes_used for T1969 -------------------------------------+------------------------------------- Reporter: simonmar | Owner: (none) Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.6.1 => Comment: Removing milestone as no one is actively working on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12437#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC