Skip to content
Back to the collection

Fast GPU bounding boxes on tree-structured scenes

Raph Levien

2022 · arXiv

Read the paper
HN score
1
Mentions
9
Readers
3
Months
7
What’s in a score?

From the abstract

Computation of bounding boxes is a fundamental problem in high performance rendering, as it is an input to visibility culling and binning operations. In a scene description structured as a tree, clip nodes and blend nodes entail intersection and union of bounding boxes, respectively. These are straightforward to compute on the CPU using a sequential algorithm, but an efficient, parallel GPU algorithm is more elusive. This paper presents a fast and practical solution, with a new algorithm for the classic parentheses matching problem at its core. The core algorithm is presented abstractly (in terms of a PRAM abstraction), then with a concrete mapping to the thread, workgroup, and dispatch levels of real GPU hardware. The algorithm is implemented portably using compute shaders, and performance results show a dramatic speedup over a sequential CPU version, and indeed a reasonable fraction of maximum theoretical throughput of the GPU hardware. The immediate motivating application is 2D rendering, but the algorithms generalize to other domains, and the core parentheses matching problem has other applications including parsing.

Metadata: arXiv. Abstracts retain their original authors’ rights.

In the conversation

Original HN comments, with labels from simple text rules. A label describes the whole comment and may miss context or irony. Read the discussion to make up your own mind. About the labels

9 selected excerpts · 9 total mentions

raphlinus
Recommendation · rule
Do not nerd snipe me! There's tons of juice left on the CPU side. Again I recommend Metamath Zero (which is somewhat of an opposite direction as HoTT), as it's able to check the entire Metamath proof database in a few hundred milliseconds. This is orders of magnitude faster than most other proof systems. If you did want to manipulate trees on the GPU, then my stack monoid work[1] might be a good basis for it. Of course, a whole nother direction is to use AI to develop proofs, which is a fascinating and growing area (see Holophrasm[2] and DeepMind work[3]). That of course runs on the GPU. [1]: https://arxiv.org/abs/2205.11659 [2]: https://arxiv.org/abs/1608.02644 [3]: https://www.deepmind.com/publications/proving-theorems-using...
YorkshireSeason
Neutral mention · rule
I found myself in a somewhat similar situation. I learned to thing long-term: (1) Publish initial ideas not in top conferences, but in second rate venues. Most publications in top conferences are, clearly, refinements of ideas that were first presented in inchoate form, in less prestigious workshops. Paradoxically, prestigious conferences don't like brand new ideas, but they like polished papers. And they like concrete open problems being solved. If a paper starts "We are solving the longstanding open problem from [17]" then that dramatically increases acceptance probability: most submissions to prestigious conferences are not rejected b/c they are wrong, but because it's…
Read the full comment
unclear why they are more siginficant than all the other submissions. Solving a concrete open problem gives you social proof that the problem is significant (others worked on it) and hard (people failed). How do you create concrete open problems? By leaving them as concrete open problems in a previous paper. (2) Create your own conferences. All now famous conferences started as small, low prestige workshops 10-20 years ago, e.g. the "Oakland" security workshop (now: IEEE Symposium on Security and Privacy). I learned this from my post-doc mentor, who is now a famous scientist with a whole research tradition to his name, that he created, bootstrapping from a first workshop paper. PS, is your monoid work online, is it this https://arxiv.org/abs/2205.11659 ? I'm interested in monoids on GPUs.
singhrac
Neutral mention · rule
Another one if you enjoy this sort of thing like me is Raph Levien's work on the stack monoid; this [1] blog post and this [2] ArXiV paper are great places to look. [1]: https://raphlinus.github.io/gpu/2020/09/05/stack-monoid.html [2]: https://arxiv.org/abs/2205.11659
raphlinus
Neutral mention · rule
Also see Fast GPU bounding boxes on tree-structured scenes[1] (unpublished paper) and notes toward a blog post[2]. This is a highly tuned GPU implementation of parentheses matching. It's actually used in Vello (the classic version in which we offload basically all the work to the GPU, not the newer CPU-GPU hybrid version in which tracking the blend stack is done on the CPU). Earlier versions of the work were featured on HN [3][4], but this is much more sophisticated. (plus a few more zero-comment submissions) The basic idea (bicyclic semigroup and binary search) is the same as the submission. I think earliest attribution is to Bar-On and Vishkin[5] from 1985. Another…
Read the full comment
implementation of this idea is in pareas[6], an experimental GPU-accelerated compiler. I believe this work is publishable and would love to work with a student to resubmit it. Especially if you're a student or prof in Sydney, please reach out. [1]: https://arxiv.org/abs/2205.11659 [2]: https://github.com/raphlinus/raphlinus.github.io/issues/66 [3]: https://news.ycombinator.com/item?id=24385095 [4]: https://news.ycombinator.com/item?id=27164009 [5]: https://dl.acm.org/doi/10.1145/3318.3478 [6]: https://github.com/Snektron/pareas
raphlinus
Neutral mention · rule
There's a bit more information at [1], but I think the details are not public. The hardware is tracking a separate program counter (and call stack) for each thread. So in the CAS example, one thread wins and continues making progress, while the other threads loop. There seems to some more detail in a Bachelors thesis by Phillip Grote[2], with lots of measurements of different synchronization primitives, but it doesn't go too deep into the hardware. [1]: https://arxiv.org/abs/2205.11659 [2]: https://www.clemenslutz.com/pdfs/bsc_thesis_phillip_grote.pd...
raphlinus
Neutral mention · rule
I'm not aware of any similarly mature GPU-based JSON parser, but I believe such a thing is possible. My stack monoid work [1] contains a bunch of ideas that may be helpful for building one. I've thought about pursuing that, but have kept focus on 2D graphics as it's clearer how that will actually be useful. [1]: https://arxiv.org/abs/2205.11659
raphlinus
Neutral mention · rule
Not sure why this is popping up now, but people should know there's been quite a bit of followup work. One is a draft paper (not yet polished for publication), on arXiv[1]. I have an issue on my blog[2], and one of these days I intend to get back to it. It's also in use in Vello for the clip stack, in particular computing the intersection of bounding boxes of all clip paths in the spine of the tree from the leaf draw object to the root (clips can be nested to considerable depth). In any case, happy to talk about it. [1]: https://arxiv.org/abs/2205.11659 [2]: https://github.com/raphlinus/raphlinus.github.io/issues/66
raphlinus
Neutral mention · rule
It is possible but you have to do things very differently, for example use monoids. There are a few compilers implemented on GPU, including Aaron Hsu's co-dfns and Voetter's compiler project[1]. The parentheses matching problem itself (the core of parsing) has long known efficient parallel algorithms and those have been ported to compute shaders[2] (disclosure: blatant self-promotion). [1]: https://dl.acm.org/doi/pdf/10.1145/3528416.3530249 [2]: https://arxiv.org/pdf/2205.11659.pdf
raphlinus
Neutral mention · rule
> PS, is your monoid work online, is it this https://arxiv.org/abs/2205.11659 ? I'm interested in monoids on GPUs. Yes, that's the draft on arXiv, and I have a blog post in the pipeline[1] explaining it to a more general audience. And thanks for the other advice, I'll consider it! [1] https://github.com/raphlinus/raphlinus.github.io/issues/66

Keep following the thread.

More in Algorithms

More from the same topics.

2000arXiv

Dancing links

Donald E. Knuth

The author presents two tricks to accelerate depth-first search algorithms for a class of combinatorial puzzle problems, such as tiling a tray by a fixed set of polyominoes.

10 mentions10 months
2HN score