[GHC] #15488: GHC takes up huge amount of memory when compiling accelerate 1.2.0

GHC ghc-devs at haskell.org
Sun Sep 16 14:24:45 UTC 2018


#15488: GHC takes up huge amount of memory when compiling accelerate 1.2.0
-------------------------------------+-------------------------------------
        Reporter:  noah              |                Owner:  tdammers
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
                                     |  accelerate,memory,compile
Operating System:  Linux             |         Architecture:  x86_64
                                     |  (amd64)
 Type of failure:  Compile-time      |            Test Case:  accelerate
  performance bug                    |  1.2.0
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by tdammers):

 Looks like the simplifier blows up core size (compiling
 `Data.Array.Accelerate.Analysis.Hash`):

 {{{
 Result size of Desugar (after optimization)
   = {terms: 3,048, ...
 }}}
 This is what we get before the simplifier kicks in - perfectly normal.

 And then the first round of simplification happens:

 {{{
 Result size of Specialise
   = {terms: 6,666, types: 10,365, coercions: 1,218, joins: 0/5}
 --
                               OverSatApps = False})
   = {terms: 10,863, types: 14,960, coercions: 1,218, joins: 0/5}
 --
 Result size of Simplifier iteration=1
   = {terms: 137,878,
 --
 Result size of Simplifier iteration=2
   = {terms: 66,407, types: 72,375, coercions: 25,148, joins: 0/991}
 Result size of Simplifier
   = {terms: 66,295, types: 72,319, coercions: 25,148, joins: 0/991}
 }}}

 ...increasing core size by a factor of 20 (peaking at 40). And the next
 round is even worse:

 {{{
 Result size of Simplifier iteration=1
   = {terms: 465,354,
 --
 Result size of Simplifier iteration=2
   = {terms: 259,229,
 --
 Result size of Simplifier iteration=3
   = {terms: 469,826,
 --
 Result size of Simplifier iteration=4
   = {terms: 345,027,
 --
 Result size of Simplifier
   = {terms: 345,027,
 }}}
 Our perfectly reasonable 3000-something terms now blow up to over 300k.

 Now on to figuring out *why* it blows up.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15488#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list