Re: ghc-7.8-rc2 in -O2 mode eats all stack and RAM on pandoc-, citeproc / highlighting-kate
Dear Devs, On 04/10/2014 09:09 AM, ghc-devs-requ...@haskell.org wrote: Filed the reproducer as a new ticket: https://ghc.haskell.org/trac/ghc/ticket/8980 [ Looks like highlighting-kate asks to be added to compiler performance benchmarks (are there such ones?) It tends to stress ghc all the time: http://hackage.haskell.org/trac/ghc/ticket/3664 ] Please consider adding hPDB too, if you want to stress the optimizer. It shows GHC optimizer at its best, with at least 10-20% improvement in every major version of the compiler since 6.12. Unfortunately at cost of very long compile times. Please let me know if I should submit a driver code for automatic benchmarks it (it is in hPDB-examples.) Thanks! SpecConstr is too aggressive: it sometimes blows up the program badly and we have no good solution. See Trac #7898, #7068, #7944, #5550, #8836. And #8960, where GHC runs out of memory. (Only in 7.8.) Should be easy to reproduce by just `cabal install hPDB`. I notice that the latter three are actually fixed in 7.8, so worth trying that. If it still fails, do add instructions to reproduce to one of the above open tickets, or make a new one. Meanwhile you can use -fno-spec-constr to simply switch it off for offending modules. That should get you going. -- Best regards Michal ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: ghc-7.8-rc2 in -O2 mode eats all stack and RAM on pandoc-citeproc / highlighting-kate
On Fri, 4 Apr 2014 16:19:48 + Simon Peyton Jones simo...@microsoft.com wrote: Filed the reproducer as a new ticket: https://ghc.haskell.org/trac/ghc/ticket/8980 [ Looks like highlighting-kate asks to be added to compiler performance benchmarks (are there such ones?) It tends to stress ghc all the time: http://hackage.haskell.org/trac/ghc/ticket/3664 ] Thanks! Sergei SpecConstr is too aggressive: it sometimes blows up the program badly and we have no good solution. See Trac #7898, #7068, #7944, #5550, #8836. I notice that the latter three are actually fixed in 7.8, so worth trying that. If it still fails, do add instructions to reproduce to one of the above open tickets, or make a new one. Amos Robinson (cc'd) was working on this problem, but I have not heard anything recently. It surely ought to be possible to throttle it a bit so that it stops before generating too vast a program. Meanwhile you can use -fno-spec-constr to simply switch it off for offending modules. That should get you going. Simon | -Original Message- | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of | Sergei Trofimovich | Sent: 03 April 2014 21:20 | To: ghc-devs@haskell.org | Subject: Re: ghc-7.8-rc2 in -O2 mode eats all stack and RAM on pandoc- | citeproc / highlighting-kate | | On Sat, 22 Mar 2014 22:21:42 +0300 | Sergei Trofimovich sly...@gmail.com wrote: | | Hello! | | I have noticed the problem in ghc-7.6.3 first when tried to build all | haskell userland with -O2 opt level. | | It led to amazing bugs! | | Here is one of those (highlighting-kate hackage package): | [281 of 452] Compiling Text.Highlighting.Kate.Syntax.Asp ( | highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.hs, | highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.o ) | stack overflow: use +RTS -Ksize to increase it | | How to reproduce it: | 1. Download a bundled file (6.6MB): | | http://code.haskell.org/~slyfox/selfcontained-eater-ghc-7.8- | rc2.tar.gz | 2. Unpack and run there: |./mk.sh | | The script is designed to plug any built ghc version w/o external | depends. | | Command will fail as: | $ ./mk.sh | ... | [281 of 452] Compiling Text.Highlighting.Kate.Syntax.Asp ( | highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.hs, | highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.o ) | stack overflow: use +RTS -Ksize to increase it | | On ghc-7.6.3 it will progress a bit more: down to 452 file and will | crash there similar way. | | I've 'cabal unpack'-ed all sources and configured/de-.hsc-ed them | manually/added needed -DWhatever / added {-# LANGUAGE CPP #-} around. | Nothing else. | | It's very hard to shrink such large thing manually down to 2-3 files. | Would be cool if ghc (and cabal) would be able to spit something | self-sufficient (like 'gcc -i' does) for devs to reproduce. | | Adding '-v' shows such log: | ... | *** Simplifier: | Result size of Simplifier iteration=1 |= {terms: 21,973, types: 21,838, coercions: 1,842} | Result size of Simplifier iteration=2 |= {terms: 21,952, types: 21,819, coercions: 1,842} | Result size of Simplifier |= {terms: 21,950, types: 21,817, coercions: 1,842} | *** SpecConstr: | Result size of SpecConstr***CRASH | | Nobody interested? Is it too scary? | | Such inliner blowups are hard to shrink down from real examples down to | toy ones. I could try to but I need a bit of guidance. | | Maybe you need only an intermediate core step right before an OOM, | whatever? -- Sergei signature.asc Description: PGP signature ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
RE: ghc-7.8-rc2 in -O2 mode eats all stack and RAM on pandoc-citeproc / highlighting-kate
Sergei SpecConstr is too aggressive: it sometimes blows up the program badly and we have no good solution. See Trac #7898, #7068, #7944, #5550, #8836. I notice that the latter three are actually fixed in 7.8, so worth trying that. If it still fails, do add instructions to reproduce to one of the above open tickets, or make a new one. Amos Robinson (cc'd) was working on this problem, but I have not heard anything recently. It surely ought to be possible to throttle it a bit so that it stops before generating too vast a program. Meanwhile you can use -fno-spec-constr to simply switch it off for offending modules. That should get you going. Simon | -Original Message- | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of | Sergei Trofimovich | Sent: 03 April 2014 21:20 | To: ghc-devs@haskell.org | Subject: Re: ghc-7.8-rc2 in -O2 mode eats all stack and RAM on pandoc- | citeproc / highlighting-kate | | On Sat, 22 Mar 2014 22:21:42 +0300 | Sergei Trofimovich sly...@gmail.com wrote: | | Hello! | | I have noticed the problem in ghc-7.6.3 first when tried to build all | haskell userland with -O2 opt level. | | It led to amazing bugs! | | Here is one of those (highlighting-kate hackage package): | [281 of 452] Compiling Text.Highlighting.Kate.Syntax.Asp ( | highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.hs, | highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.o ) | stack overflow: use +RTS -Ksize to increase it | | How to reproduce it: | 1. Download a bundled file (6.6MB): | | http://code.haskell.org/~slyfox/selfcontained-eater-ghc-7.8- | rc2.tar.gz | 2. Unpack and run there: |./mk.sh | | The script is designed to plug any built ghc version w/o external | depends. | | Command will fail as: | $ ./mk.sh | ... | [281 of 452] Compiling Text.Highlighting.Kate.Syntax.Asp ( | highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.hs, | highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.o ) | stack overflow: use +RTS -Ksize to increase it | | On ghc-7.6.3 it will progress a bit more: down to 452 file and will | crash there similar way. | | I've 'cabal unpack'-ed all sources and configured/de-.hsc-ed them | manually/added needed -DWhatever / added {-# LANGUAGE CPP #-} around. | Nothing else. | | It's very hard to shrink such large thing manually down to 2-3 files. | Would be cool if ghc (and cabal) would be able to spit something | self-sufficient (like 'gcc -i' does) for devs to reproduce. | | Adding '-v' shows such log: | ... | *** Simplifier: | Result size of Simplifier iteration=1 |= {terms: 21,973, types: 21,838, coercions: 1,842} | Result size of Simplifier iteration=2 |= {terms: 21,952, types: 21,819, coercions: 1,842} | Result size of Simplifier |= {terms: 21,950, types: 21,817, coercions: 1,842} | *** SpecConstr: | Result size of SpecConstr***CRASH | | Nobody interested? Is it too scary? | | Such inliner blowups are hard to shrink down from real examples down to | toy ones. I could try to but I need a bit of guidance. | | Maybe you need only an intermediate core step right before an OOM, | whatever? | | Thanks! | | -- | | Sergei ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
Re: ghc-7.8-rc2 in -O2 mode eats all stack and RAM on pandoc-citeproc / highlighting-kate
On Sat, 22 Mar 2014 22:21:42 +0300 Sergei Trofimovich sly...@gmail.com wrote: Hello! I have noticed the problem in ghc-7.6.3 first when tried to build all haskell userland with -O2 opt level. It led to amazing bugs! Here is one of those (highlighting-kate hackage package): [281 of 452] Compiling Text.Highlighting.Kate.Syntax.Asp ( highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.hs, highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.o ) stack overflow: use +RTS -Ksize to increase it How to reproduce it: 1. Download a bundled file (6.6MB): http://code.haskell.org/~slyfox/selfcontained-eater-ghc-7.8-rc2.tar.gz 2. Unpack and run there: ./mk.sh The script is designed to plug any built ghc version w/o external depends. Command will fail as: $ ./mk.sh ... [281 of 452] Compiling Text.Highlighting.Kate.Syntax.Asp ( highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.hs, highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.o ) stack overflow: use +RTS -Ksize to increase it On ghc-7.6.3 it will progress a bit more: down to 452 file and will crash there similar way. I've 'cabal unpack'-ed all sources and configured/de-.hsc-ed them manually/added needed -DWhatever / added {-# LANGUAGE CPP #-} around. Nothing else. It's very hard to shrink such large thing manually down to 2-3 files. Would be cool if ghc (and cabal) would be able to spit something self-sufficient (like 'gcc -i' does) for devs to reproduce. Adding '-v' shows such log: ... *** Simplifier: Result size of Simplifier iteration=1 = {terms: 21,973, types: 21,838, coercions: 1,842} Result size of Simplifier iteration=2 = {terms: 21,952, types: 21,819, coercions: 1,842} Result size of Simplifier = {terms: 21,950, types: 21,817, coercions: 1,842} *** SpecConstr: Result size of SpecConstr***CRASH Nobody interested? Is it too scary? Such inliner blowups are hard to shrink down from real examples down to toy ones. I could try to but I need a bit of guidance. Maybe you need only an intermediate core step right before an OOM, whatever? Thanks! -- Sergei signature.asc Description: PGP signature ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs