Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ray tracer example #108

Merged
merged 1 commit into from
Jan 25, 2020
Merged

Add ray tracer example #108

merged 1 commit into from
Jan 25, 2020

Conversation

athas
Copy link
Contributor

@athas athas commented Jan 25, 2020

I don't know if you're interested in more examples, but if so, here's one.

Ray tracing is interesting both because of the BVH construction (which is a delightful divide-and-conquer problem), but also because the big parallel loop over all the pixels presents interesting load balancing issues.

Also, I'm really impressed with how fast MPL runs this thing.

@shwestrick shwestrick merged commit ac9d952 into MPLLang:master Jan 25, 2020
@shwestrick
Copy link
Collaborator

Nice! Is this a benchmark from the Futhark project?

And yes, we are looking for more examples. I've been slowly migrating what we have already into this repo so you'll see more things here soon. If you have other things you'd like to add, please submit more PRs :)

@athas
Copy link
Contributor Author

athas commented Jan 25, 2020

No, this is a port of a parallel Haskell program I wrote for a course in parallel functional programming. I was disappointed at the poor performance I got (it did not scale beyond 4 cores, and none of my students managed to do better), and wanted to see if MPL could handle it better. And it does: I get almost linear speedup up to 8 cores (which is what I have on this machine).

@shwestrick
Copy link
Collaborator

Great. I'm glad to hear it's working well on your machine.

I just ran some tests on our 72-core and was able to get decent speedup (25x) on larger image sizes. By the way, I made some tweaks (7cd68af) like lowering the grain size, since each ray cast seems to be a pretty beefy amount of work on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants