Practice meeting, Feb. 4th

11 views
Skip to first unread message

Lyle Kopnicky

unread,
Jan 30, 2019, 1:15:46 PM1/30/19
to pdxfunc
When: Feb. 4th, 6:30-8:30pm
Where: Collective Agency Downtown, Suite 1108, 511 SW 10th Ave, Portland, OR (opposite side of the floor from the elevators)

We'll begin discussing Chapter 6, "GPU Programming with Accelerate", of Parallel and Concurrent Programming in Haskell. At the meeting anyone will be able to present and contribute to the discussion.

Meetup link to RSVP:

Hope to see you then!

Lyle Kopnicky

unread,
Feb 4, 2019, 1:48:33 AM2/4/19
to pdxfunc
I've read the chapter, and now I'm trying to build the example programs on my Windows machine at home, that has an Nvidia GPU.

Since the code in parconc-examples is kind of old, I had to modify the stack.yaml in a similar way that I did for the REPA chapter: https://gist.github.com/lylek/b34b7c22b3cf14c96fa0adf9c8753b4d.

Then I had to install the CUDA toolkit from Nvidia, which is about 2GB. Still working on that.

It turns out that there's a nice web site for Accelerate. The library has been updated since the book was written. It now includes support for Complex numbers. It has a new CUDA backend, and now has an LLVM backend that runs parallel threads on a CPU, which should be a lot faster than the interpreter backend. There's a tutorial for the Mandlebrot set example. We should give it a try in the meeting.

--
You received this message because you are subscribed to the Google Groups "pdxfunc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdxfunc+u...@googlegroups.com.
To post to this group, send email to pdx...@googlegroups.com.
Visit this group at https://groups.google.com/group/pdxfunc.
For more options, visit https://groups.google.com/d/optout.

Lyle Kopnicky

unread,
Feb 4, 2019, 2:10:28 AM2/4/19
to pdxfunc
I got the CUDA toolkit installed, but couldn't build the accelerate-cuda library due to some type mismatches. I'm guessing the issue is that I'm using a very new release of Nvidia's CUDA toolkit, and the old accelerate-cuda was built to work with some old version, that doesn't have the same types, e.g., CULLong vs. CULong.

So it's probably best to just try the example from the Accelerate website, that's up-to-date.

jim rothstein

unread,
Feb 5, 2019, 8:04:51 PM2/5/19
to pdxfunc
Good to meet Lyle & TJ at 4FEB practice session.

Hope I might be useful in the theory/math  session,   Ch 21 Real Numbers?  ( https://leanprover.github.io/logic_and_proof/the_real_numbers.html)

I mentioned  this book: Structure & Interpretation of Computer Programs ( https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-4.html#%_toc_start).
Though it introduces & uses LISP,  I think the text is really designed to an entry-level intro to abstractions and ideas that might also be useful functional programming.   (exercise to reader:   replace LISP code with Haskell)

Am I barking up the wrong tree?  

jim

Lyle Kopnicky

unread,
Feb 5, 2019, 10:14:45 PM2/5/19
to pdxfunc
Hi Jim, good to meet you, too!  You clearly have a broad range of interests. Hope to see you at the math session.

Yeah, that book is so famous, people just refer to it as SICP. I admit to not having read it, but I'm pretty sure I was exposed to the main ideas through my undergrad studies at Rice. They've always had a strong Scheme bent. It definitely would be the kind of book we could cover in PDX Func. It contains many insights into programming language semantics and implementation.

If you don't know much Haskell, you will have a hard time converting the Scheme code to Haskell, especially when it gets to the impure stuff. It can certainly be done, but you might be better off starting off with a Haskell book first, such as Get Programming in Haskell.

Functional programming (FP) and programming language theory (PLT) are broad areas, so we've had to develop some focus by zeroing in on certain books and topics. We also tend toward Haskell and other statically-typed programming languages. When I was applying to grad school to study PLT for functional languages, I found that each department either had a Scheme bent, an ML bent or a Haskell bent. At the time I already knew Scheme and ML, but was newly fascinated with Haskell, so that's what I ended up going for. But the others are certainly fascinating and each has its adherents. It's not that Haskell is the one true way and Scheme is the wrong way.

So, whether you're "barking up the wrong tree" depends on what you want to learn. I think if you want to learn SICP then it's probably best to do it in Scheme, and only try to do it in Haskell once you know Haskell better. There are some really fantastic Scheme compilers out there, like Chez Scheme - which, I'll admit, is what we used way back when I was in undergrad, but has been maintained and updated and is very high quality. Written by the genius R. Kent Dybvig, of Indiana University.

Interesting to note is that Edwin Brady, who wrote Idris, a dependently-typed language based on Haskell (but without the laziness), has been working on Idris 2, also called Blodwen, and it currently compiles to Scheme and then down to machine code by Chez Scheme. And he reports that some code he wrote ran faster that way than it did in Haskell, or even C++. So... Chez Scheme is pretty impressive.

--

jim rothstein

unread,
Feb 6, 2019, 7:39:58 PM2/6/19
to pdx...@googlegroups.com
Thanks Lyle for detailed explanation.    I think I should keep my aims modest.   Only liked the SICP book because seemed to introduce ideas first without plunging straight in code,  such as LearnYouHaskell, which I have been slowly working through and perhaps focus here.

I'll look at Get Programming in Haskell, too.  
jim

Reply all
Reply to author
Forward
0 new messages