Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2545 closed bug (invalid)

Data Parallel Haskell on Kubuntu 8.04 uses too much memory

Reported by: jjanssen Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.8.3
Keywords: Memory Leak Cc:
Operating System: Linux Architecture: x86
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:



I tried to perform some tests on the performance of data parallel haskell today using the program from the DPH-wiki:

{-# OPTIONS -fparr -fglasgow-exts #-}
module Main
import GHC.PArr

dotp :: Num a => [:a:] -> [:a:] -> a
dotp xs ys = sumP [:x*y | x <- xs | y <- ys:]

main = putStrLn $ show $ dotp [:1..500000:] [:5..4999995:]

After compiling this with -threaded and running it, the memory usage starts to increase up until the point that the machine starts swapping. On a machine with 2GiB of memory, this hardly seems to be normal behaviour, especially since a program like this should presumably take up maximally 3*the size of the vectors used, which would translate to 3*500.000*32 bit = 6MiB. So this seems like a bug.

I tried it with the GHC 6.8.2 that is in the kubuntu repositories and with the GHC 6.8.3 binaries distributed on the GHC website. Both showed the same behaviour. Also, the behaviour does not seem to depend on the usage of +RTS -N2, as both with and without these flags the memory gets filled.

Additionally, I remember having similar problems when trying out parMap_ on an example, but I can't seem to find the example right now.

Hopefully this gets fixed (or maybe already is), so I can start using the power of DPH to optimise some of my programs.

Change History (4)

comment:1 Changed 9 years ago by chak

Resolution: invalid
Status: newclosed

Data Parallel Haskell is not supported at all in the 6.8.x branch and the version that you have been testing is just a very, very rough prototype to play around with the surface syntax. It does not run in parallel at all and there is no optimisation whatsoever.

comment:2 Changed 9 years ago by simonpj

difficulty: Unknown

However, just to add, DPH is very much in our sights as an active project. We are working hard on getting something usable into GHC 6.10 (although it may still not be very performant). And we won't stop there... we have invested lots of effort to getting where we are, and we won't be satisfied until we have DPH running on multicores with serious speedups. It's just taking longer than we thought!


comment:3 Changed 9 years ago by jjanssen

Ok, thanks for clearing that up! It might be useful to add an additional disclaimer to about it being unstable and unsupported in GHC 6.8.3 as this page suggested (to me at least) that the example would run without any problems on GHC >=6.6.1

I'll be waiting eagerly for 6.10 then ;).

comment:4 Changed 9 years ago by chak

I put a warning on the wiki page.

Note: See TracTickets for help on using tickets.