<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pavlo Muratov on Medium]]></title>
        <description><![CDATA[Stories by Pavlo Muratov on Medium]]></description>
        <link>https://medium.com/@pavlo.muratov?source=rss-b3f9a8b444b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3vCd84wu-o6iH6oBV4J0Ag.png</url>
            <title>Stories by Pavlo Muratov on Medium</title>
            <link>https://medium.com/@pavlo.muratov?source=rss-b3f9a8b444b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:09:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pavlo.muratov/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[GPU Memory Aliasing]]></title>
            <link>https://levelup.gitconnected.com/gpu-memory-aliasing-45933681a15e?source=rss-b3f9a8b444b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/45933681a15e</guid>
            <category><![CDATA[memory-aliasing]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[compression]]></category>
            <category><![CDATA[gpu]]></category>
            <dc:creator><![CDATA[Pavlo Muratov]]></dc:creator>
            <pubDate>Fri, 10 Jul 2020 15:46:12 GMT</pubDate>
            <atom:updated>2020-07-22T12:20:05.746Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern graphic APIs such as DirectX 12 or Vulkan expose an ability to place allocated GPU resources into user-defined memory locations in manually created heaps. It allows us to create textures and buffers, memory of which overlaps partially or even completely.</p><h4>When is that useful?</h4><p>Rendering engines are often referred to as pipelines for a reason. They are usually organized as a conveyor with multiple stages of rendering work, where each stage consumes and produces GPU resources.</p><p>Take a typical frame in a game engine: rasterize some geometry, perform shading, maybe compute some volumetrics, then run a bunch of post-processing stages. Each stage here will produce its output by writing into textures and/or buffers that will be read by some other stage later in a frame.</p><p>The observation here is that resources produced by a certain stage may be only used by a handful of other stages. Post processing render passes are a good example: bloom pass can produce its output that will be consumed only by the next stage — tone mapping and not be needed anywhere else in the frame. We can see that a resource can have a small effective lifetime, but most likely is allocated beforehand and occupies its memory throughout the whole frame. A large pipeline can have a lot of produced resources that will all sit in their permanently occupied memory regions and consume a lot of VRAM. Unless we do something about it.</p><p>At first, we might think that if resource is used in a short time frame, we might allocate it on the spot when it’s used first and deallocate when it’s not needed instead of allocating beforehand, to reduce overall VRAM consumption. It will help memory-wise, sure, but performance hit associated with frequent memory reallocations will outweigh any potential benefits, so this is not a viable solution.</p><p>A common way to address this issue is to use pools of resources with compatible properties: pull out a non-used resource when needed and put it back when work is done to be potentially used by someone else and skip an allocation by doing so. This works well for post processing stages, for example, because they are usually implemented as full-screen render passes that all read and write to textures with identical properties. We can basically have only two textures allocated for the whole post-processing pipeline. In the essence this is a high level memory aliasing. But high level aliasing is not very flexible, it might fit well in post-processing, but is less useful in other parts of an engine, because we have to think about various incompatible resources that cannot be put in the same pool, which makes memory reuse not as efficient as it could be.</p><p>This is where low-level aliasing enabled through graphic APIs themselves starts to make sense. When we use API to alias memory we stop caring about resource types and worry only about their sizes and memory addresses. We can still allocate resources once, beforehand, to avoid performance hit, but we can also pack them in memory more efficiently than in pool example, by placing resources used in disjoint periods of time “on top” of each other in the same memory region disregarding resource type, because at the low level they are just a bunch of bytes in VRAM.</p><h4>Algorithm</h4><p>So we established that aliasing can be useful, but how can we actually implement it to pack memory efficiently?</p><p>Let’s not burden ourselves at the beginning too much and consider a render pipeline with work executed serially one after another and do not think about asynchronous work execution or anything like that yet.</p><p>Take a random example of serially executed render passes that read resources of various sizes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EpKvrrfKIHeVjeU5RVHBQ.png" /><figcaption>Arbitrary render pipeline</figcaption></figure><p>First thing we need to do is determine effective lifetime (EL) of each resource, because we can only alias them if they’re disjoint in time, otherwise we would encounter memory corruption. Since render passes are executed serially we can assign an execution index to each of them and use those indices for lifetime construction.</p><p>For each resource we take index of a first render pass the resource is used in and treat it as a start of a EL range, index of last pass resource is used in becomes an end of the range.</p><p>This is what we get after assigning a EL to each resource:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*blLK22XH4rHKaKZyFsrNjw.png" /><figcaption>Resource effective lifetimes</figcaption></figure><p>Now back to memory packing. We want to have as little memory footprint as possible, but how low can we possibly go? If we look at example resources we see that the largest one is D with size of 15 megabytes, so even if we’d place every resource on top of each other disregarding lifetimes we’d use 15 MB of memory, which means that in the best case scenario a total amount of memory will be at least the amount required by the largest resource.</p><p>That gives us a hint that a good way to overlap memory is to start from the largest resource and then try to pack smaller ones in that memory region like a nesting doll.</p><p>That leads us to next step of the algorithm: sort resources in descending order of their size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kB4uTQlYhncmTykuy9VTYA.png" /><figcaption>Sorted resources</figcaption></figure><p>Now let’s walk through this ordered list and actually try to tightly arrange memory of resources that do not have EL conflicts.</p><p>We take first resource in the list, which is also largest (D), and place it in a new memory bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Rh9xTnpXOgnEeoU9XIoWvQ.png" /><figcaption>Memory bucket created from the largest resource 15 MB in size</figcaption></figure><p>First resource is always accepted into a bucket because it is simply first, but subsequent resources are trickier.</p><p>Take second resource (A) and see if we can put it in the same bucket with (D) by checking for EL conflicts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_s-MsUIrvzeJaHKiQKvfmw.png" /><figcaption>Effective lifetimes of A and D do not overlap</figcaption></figure><p>Since lifetimes do not conflict with each other (i.e. do not overlap) we put (A) into the same bucket.</p><p>But wait a minute, (A) is only 10 MB in size so it can be put at many various addresses inside of 15 MB bucket. Where should we actually place it? Address 0 seems like a natural choice, so let’s just put (A) there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*i8uRPJ6OQd-sIRgbkuZAIA.png" /><figcaption>A and D aliased in the same memory bucket</figcaption></figure><p>Next resource is (J), but now we have two aliased resources in a bucket, so how should we proceed? We now must take (J) and see how its EL fits ELs of resources already in the bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHwundPR9QvU45or873gsA.png" /><figcaption>J and D lifetimes in conflict with each other</figcaption></figure><p>We see that even though (J) does not have a lifetime conflict with (A), it conflicts with (D) and unfortunately, there no place in this bucket where (J) could be placed to not overlap with (D) memory-wise, so we skip adding (J) to the bucket.</p><p>We then take (K), but it has the same problem of conflicting with (D), so it’s also skipped.</p><p>Next one is (E) and it is a bit more interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJrdObNjPQ1u6jrR7vt9EQ.png" /><figcaption>E conflicts with A</figcaption></figure><p>Now we have a different conflict between (A) and (E) and it is different because (A) does not occupy the bucket completely, only 2/3 of it, which means we have 5 MB of memory left. We should try to put (E) at 10 MB offset then (where (A) ends), but since E’s size is 8 MB there is just not enough available space left in the bucket and therefore (E) must also be skipped.</p><p>You might’ve guessed where we’re going with this, but let’s get to the end of the list.</p><p>(I), (L), (B), (H) are skipped due to conflict with (D).</p><p>Next is (F) that doesn’t conflict with (D) but conflicts with (A), but also its size is small enough (3 MB) to fit into the bucket after (A). In case of (F) the only memory region we could place it is a range between 10 and 15 MB, which is where we’ll put it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*OoYL8tsT2PIfX60ZeOFRlw.png" /><figcaption>F conflicts with A but can still fit in the bucket</figcaption></figure><p>Next is (M) conflicting with (D), so it’s skipped.</p><p>Then we have (G) and with it we can see an ambiguity. Because out of all aliased resources (G) conflicts only with (F) and has a small enough size (2 MB), it is able to fit in more than one memory region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*ICrOWfL3GY1ilEIqoNqTWA.png" /><figcaption>Multiple memory regions G can be put in</figcaption></figure><p>(G) fits in both 0–10 and 13–15 ranges, so which one is better? We should pick a smaller region because if we’d put (G) in the larger one, we could reduce potential number of resources that could’ve still been aliased in this bucket.</p><p>Last resource is (C) and it’s skipped due to conflicts with pretty much everything in the frame.</p><p>So, we ended up aliasing four resources: D, A, F and G. Not much, but definitely better than nothing. What do we do with the rest that was skipped? We create a new bucket using largest resource from what’s left and repeat the algorithm. Repeat until all resources are dispatched to memory buckets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5Okj7J7acsZUAYOMg65GQ.png" /><figcaption>All resources aliased</figcaption></figure><p>After aliasing all resources from above example we can see that total required memory is 52 MB versus 82 MB if no aliasing was done, so we have a ~37% reduction. This is of course an abstract example and each real render pipeline will achieve different amounts of compression.</p><p>So, by now we developed an intuition for placing resources into buckets. It’s time we generalize and formalize this process.</p><p>In general, when we try to add a resource to a bucket we need to find such memory regions that if we’d place new resource in any of them, it would not have effective lifetime conflicts with any of resources already present in the bucket.</p><p>We find such free regions by first gathering all regions that are in conflict with the new resource by iterating through all already aliased resources in a bucket and checking whether lifetimes intersect. If they do, a memory region becomes unaliasable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CkLA-BgIpjhoARKnZYRbzQ.png" /><figcaption>An abstract example of resources that a new resource has lifetime conflicts with, leaving only a few aliasable memory regions new resource can be placed in.</figcaption></figure><p>Let’s look at another abstract example, this time of unaliasable memory regions. We can tell where free regions are located, but what actually gives them away, what’s the pattern?</p><p>To locate free regions we should treat non-aliasable memory offsets as a sequence of points of two types: start point and end point.</p><p>Gather offsets from example above, assign start/end markers, sort in ascending order, then insert bucket start address with “end” marker at the beginning of the list and bucket end address with “start” marker at the end of the list (sorting is required because resources are not necessarily listed in order they reside in memory).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TER1ReWJCPBNblZ9U7L36A.png" /><figcaption>Ordered and marked memory region offsets</figcaption></figure><p>We can now define a free region. It is located between two neighboring End and Start points, such as 0–2 or 10–11. But, there is a catch: not all End-Start pairs represent free memory patches due to overlapping such as in 6–7 example, because 6–7 pair is overlapped by a resource in range 5–8.</p><p>So a complete definition goes as follows:</p><p><em>A free aliasable memory region is a space between two neighboring End-Start offsets that is not overlapped by any Start-End pair.</em></p><p>Now how do we detect an overlap? We introduce an <em>overlap counter</em>, that we increase when Start point is encountered and decrease when End point is encountered. That way when we’ll reach an End-Start pair that may indicate an aliasable memory region we’ll check the counter value, and if it is zero, then there is no overlap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-RDh_g9tD_ffpoW_mcp1dQ.gif" /><figcaption>Overlap counter helps detect free aliasable regions: 0–2, 10–11, 14–15, 18–20</figcaption></figure><p>Now the last step is to pick the smallest suitable free region and place new resource in it.</p><p>Let’s summarize.</p><blockquote>To alias resources, order them in descending order of their size. Take first and largest resource and place it in a new memory bucket of the same size. Iterate through the rest of the list and for each resource build an ordered list of unaliasable memory regions by checking for effective lifetime conflicts. By going through unaliasable memory list determine smallest free aliasable memory region that can fit the resource. If it doesn’t exist, skip adding resource to the bucket.</blockquote><blockquote>If all resources couldn’t be fit into a single bucket, remove aliased resources from original list and repeat the algorithm until all resources are aliased into N buckets, where N ≤ TotalResourceCount.</blockquote><h4>Complexity</h4><p>This algorithm packs memory pretty tightly, but it is greedy. We should examine its time complexity to understand its applicability to real-world render pipelines.</p><p>We have N resources that are iterated in a loop (an outer loop). In each outer loop iteration we might have a linear search through a list of already aliased resources to find unaliasable region offsets, then a sort and then another linear search to find optimal free region.</p><p>What’s the worst case of inner loop time-wise? It is actually the best case memory-wise when all resources are placed inside of single memory bucket. What’s the maximum amount of resources we can operate on in inner loop? It’s <strong><em>i </em></strong>— the current outer loop iteration index, because we cannot have more resources to process in inner loops then we already processed in the outer one.</p><p>So if we’d only consider iterating resources in outer loop and searching for unaliasable regions in inner loop we’d get a following worst case complexity:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/166/1*G1yAjPvt-uMZGtIjQ_JXjw.png" /><figcaption>Search complexity</figcaption></figure><p>because for each iterated resource <strong><em>i </em></strong>we can only have a maximum of <strong><em>i-1 </em></strong>resources already present in the bucket, so we’d have a total complexity that looks like a series: <strong>1 + 2 + 3 + 4 + 5 + … + N</strong>.</p><p>We now add offset sorting. Assume that we use some log-time sorting algorithm. Complexity formula grows a bit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*Ck6JrxdrKAKgv-_HddSzwA.png" /><figcaption>Search and sort complexity</figcaption></figure><p>Add free region search and formula becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*qXgUpCU1i0msE9gaPz5hUQ.png" /><figcaption>Constant work, search, sort and another search complexity</figcaption></figure><p>Since the amount of offsets are double the number of already aliased resources we add <strong>2i</strong>. Then we add 2 to account for bucket start and end offsets.</p><p>We should also add initial resource sort in here as well as a constant work performed on each outer loop iteration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*7UPByMuUE_8Z7s9Zcl2uiQ.png" /><figcaption>Total complexity</figcaption></figure><p>We can now estimate an asymptotic complexity by throwing out everything except the part that grows fastest with increasing N.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*FSK3uTUlfvoSr1g9Ee4uuQ.png" /><figcaption>Asymptotic complexity</figcaption></figure><p>This is a bit worse than quadratic complexity, but not too much.</p><p>So can we use it in a production renderer?</p><p>The answer is <em>yes </em>if we think about input data sizes. How many GPU resources does a modern render pipeline really allocate? Dozens, hundreds? Even if it’s a hundred or two, combining that with a fact that resource allocation (and therefore aliasing) happens rarely at initialization stage or when resource property change is requested by user and that on average it will be much quicker due to inability to place all resources in the same bucket, we can conclude that it is totally feasible.</p><h4>Parallel work execution</h4><p>There is one thing we left out for later: execution of render work on concurrent queues exposed by graphic APIs.</p><p>We can have a situation when resource can be read by more then one concurrently executed render passes. How do we correctly assign effective lifetime range for a resource considering that parallel jobs have different execution indices and we can’t know which one will finish last?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHF4gz-Z6tykkpIjH8H5aQ.png" /><figcaption>Cross-queue resource reads</figcaption></figure><p>To solve this problem we should assign lifetime ranges with lower granularity: instead of using render pass execution indices use pass dependency level indices instead. See <a href="https://medium.com/@pavlo.muratov/organizing-gpu-work-with-directed-acyclic-graphs-f3fd5f2c2af3">Organizing GPU Work with Directed Acyclic Graphs</a>.</p><h4>Code</h4><p>For full implementation see <a href="https://github.com/man-in-black382/PathFinder">PathFinder</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c96c4549eccd6b095c8d8f59563c4ba/href">https://medium.com/media/4c96c4549eccd6b095c8d8f59563c4ba/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45933681a15e" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/gpu-memory-aliasing-45933681a15e">GPU Memory Aliasing</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Organizing GPU Work with Directed Acyclic Graphs.]]></title>
            <link>https://levelup.gitconnected.com/organizing-gpu-work-with-directed-acyclic-graphs-f3fd5f2c2af3?source=rss-b3f9a8b444b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3fd5f2c2af3</guid>
            <category><![CDATA[acyclic-graph]]></category>
            <category><![CDATA[directx-12]]></category>
            <category><![CDATA[resource-barriers]]></category>
            <category><![CDATA[graphframe]]></category>
            <category><![CDATA[queue-synchronization]]></category>
            <dc:creator><![CDATA[Pavlo Muratov]]></dc:creator>
            <pubDate>Fri, 10 Jul 2020 15:39:43 GMT</pubDate>
            <atom:updated>2020-11-13T07:06:34.239Z</atom:updated>
            <content:encoded><![CDATA[<h3>Organizing GPU Work with Directed Acyclic Graphs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HURTNRaKikAaNB044H26nw.png" /></figure><h3>What is there to organize?</h3><blockquote>DirectX 11 and OpenGL style APIs require the driver to invoke complex heuristics to determine when and how to perform critical scheduling operations on the GPU. The immediate-mode nature of the interface requires complex bookkeeping and state-tracking to handle every edge case — ultimately, negatively impacting performance and hampering parallelism.</blockquote><blockquote>Modern graphics APIs, like DirectX 12, Vulkan, and Metal 2, have shifted away from this model, instead opting to shift the burden of low-level GPU management to the application itself.</blockquote><p>That gives us an opportunity to design a system that possesses high-level knowledge of the rendering work in a frame and determines optimal way to execute it beforehand. That includes optimizing GPU and memory states, memory reuse, queue synchronization. Such system can also be used to validate correctness of frame workflow and cull redundant jobs, re-optimize itself in response to user actions. And <strong>graph </strong>is a natural candidate for underlying data structure.</p><p>In this article we’ll touch several subjects: building the graph, using it to batch work and insert proper synchronization points, arranging resource barriers.</p><p><em>Design of the algorithms below was inspired by DirectX 12 API. Code examples with implementation details will be provided at the very end.</em></p><h3>Building the Graph</h3><p>Let’s start from the basics. We want to organize work, so let’s define a unit of work and call it <strong>Render Pass. </strong>Work is no good if we can’t use its results, so we need to define its <strong>outputs </strong>and <strong>inputs</strong>, which are represented by read and written GPU resources. And this is all the information required to build a graph, nodes of which represent render passes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f27851f29fc6ecf5e5f71ba6512112e9/href">https://medium.com/media/f27851f29fc6ecf5e5f71ba6512112e9/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c9c6a538980eaf81040b0ee5b8e87a83/href">https://medium.com/media/c9c6a538980eaf81040b0ee5b8e87a83/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcf91440aa7172c52ad30ff0f6dafb9d/href">https://medium.com/media/bcf91440aa7172c52ad30ff0f6dafb9d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*mzE9U-HerlrPAvsxWlTQhw.png" /><figcaption>A bunch of render passes with various dependencies and no loops</figcaption></figure><p>Now that we established basic definitions, let’s take an unordered, but dependent set of render passes and order them in a deterministic, non-contradictory manner.</p><p>Those are important properties required to make graph build fully automatic.</p><p>That’s where acyclicity comes in. It imposes a couple of restriction we must consider before building the graph.</p><p>Any cyclic dependency will bring ambiguity when the algorithm won’t be able to tell which of the cycled nodes has to come first and which has to come last. So, firstly, we have to forbid cyclic dependencies.</p><p>Another caveat is multiple write dependencies for the same resource. If two or more render passes register same resource as their output (write) dependency the algorithm will also fail to establish a single node order because there will be more than one possible solution. Hence, secondly, we forbid multiple write dependencies for the same resource and so each render pass must register its own new output. <em>Requiring single write dependency is debatable though and will be discussed additionally at the end, but for now we’ll accept it.</em></p><p>Now with these restrictions in mind we’ll order the example graph by performing a <strong>topological sort</strong> based on a modified version of <strong>depth-first search</strong> algorithm. It can order a directed acyclic graph in linear time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*Gb4vKot5KARlk1aYyqYYeA.png" /><figcaption>Adjacency lists for the graph</figcaption></figure><p>The algorithm requires nodes and edges as its inputs. We have our render pass nodes, but we don’t actually have edges yet, we only know which resources are read and written by each render pass. We can use that information to build a data structure called <strong>adjacency list</strong>, which is just an array of arrays, where N arrays is created for N nodes in a graph and each array contains references to connected nodes. We do this by checking for write-to-read dependencies between every possible pair of nodes.</p><p>Now with adjacency list constructed we can order the graph. To do that we’ll need two helper arrays of booleans, each of size N, where N is the total number of nodes in the graph. One is used to mark “visited” nodes and the other to mark nodes “on stack” to detect circular dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*vbEbVHs0KtX8siIuCIBfGg.png" /><figcaption>Helper arrays for the graph</figcaption></figure><p>We iterate through every node in the graph, and for each node we start a recursive search through descendants, marking encountered nodes as “on stack” and “visited”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*IPyLRbg_k5jJAB2dmXdnBw.gif" /><figcaption>Topological sort</figcaption></figure><p>We add node to the final array when no more descendants could be found. When stack is unrolled we remove the “on stack” flag, but leave the “visited” flag, which will help us avoid processing a node more than once. If during the search we encountered a node that is already visited and also is on the stack, then we found a circular dependency and must abort.</p><p>In example above we started from node 0, so we were able to order the whole graph with just one recursive search, but in a general case we might need more, that’s why descendant search should be issued for every node.</p><p>As a last step we reverse the resulting array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*POsJAk0w00rtjp2IAs9Y8A.png" /><figcaption>Topologically sorted nodes</figcaption></figure><p>We can now execute render passes in a determined order and dependencies will be respected.</p><p>But there is one more thing to consider before we move on. Let’s look at the graph again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*FgTSGOmH2VTab--BFmCBqg.png" /></figure><p>We can see that there exist groups of nodes that do not depend on each other. Let’s call those groups <strong>dependency levels</strong>. Render passes inside of a single dependency level can be executed in an arbitrary order which is useful for parallel work execution and certain optimizations we’ll discuss later on.</p><p>An important relation here is that passes in a dependency level share the same recursion depth, or rather <em>maximum </em>recursion depth also known as <strong>longest path in a DAG</strong> from a root node. We can use <strong>longest path search</strong> algorithm to find dependency level of each node.</p><p>To do that we define an array of distances to each node of size N, where N is the number of nodes in the graph and initialize it with zeroes. We also need a topological sorting of the graph, but that we already have. We then iterate through nodes in topological order and for every node processed, we update distances of its adjacent nodes using distance of current node. Distances determined for each node will correspond to their dependency level indices. Nodes are then dispatched to their dependency levels.</p><p>Algorithm is simple enough to be explained with just four lines of pseudo code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a08938c4b03762935d083a9ca33406c7/href">https://medium.com/media/a08938c4b03762935d083a9ca33406c7/href</a></iframe><h3>Using the Graph: Synchronization</h3><p>We just built a graph of work, but that work can be executed in parallel using command queues exposed by modern graphic APIs. That leaves us with a challenge of finding proper synchronization points to respect dependencies between render passes executed on separate queues and also minimizing the amount of synchronizations to batch more work together and minimize the number of Execute…() calls to improve performance.</p><p>In this section we’ll develop an algorithm to achieve optimal synchronization between queues by examining several scenarios and by trying to find a universal solution for all of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHF4gz-Z6tykkpIjH8H5aQ.png" /><figcaption>Synchronization scenario 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b0UP7gTl3Es7wX05VE7L_g.png" /><figcaption>Synchronization scenario 2</figcaption></figure><p>Let’s start by looking at two cases. We have two queues and three passes on each queue (we’ll focus on cross-queue work dependencies, because otherwise things are trivial). A monotonically increasing index is assigned to each pass (index could’ve started from 0 on each queue, but that doesn’t matter, only monotonic increase matters).</p><p>In first case we have a pass <strong>(3) </strong>that needs to sync with two other passes from another queue <strong>(4,5)</strong>. In the second case we have two passes <strong>(5,6)</strong> that need to sync with one common pass <strong>(1).</strong></p><p>Just by looking at the pictures we can tell that in first case synchronizing <strong>(3)</strong> with <strong>(4) </strong>is redundant because that sync is automatically covered by synchronization between <strong>(3)</strong> and <strong>(5)</strong>. So what’s the algorithm here? Take <strong>(3)</strong>, iterate through dependencies on other queue<strong> (4,5) </strong>and take only the closest one, with highest index — <strong>(5)</strong>, discard the rest.</p><p>So, is it good enough for both cases? Actually no, second picture tells us it’s not.</p><p>If we’d only look for closest dependencies in second case, we’d end up with the same picture: <strong>(5)</strong> would be synced with its closest dependency <strong>(1) </strong>and so would <strong>(6), </strong>since its closest dependency is also <strong>(1)</strong>. But we can clearly see that synchronizing <strong>(6)</strong> with <strong>(1)</strong> is redundant because of sync between <strong>(5)</strong> and <strong>(1)</strong>. A solution for second case is not immediately obvious.</p><p>So what do we do now?</p><p>We proceed by introducing a notion of <strong>sufficient synchronization index set </strong>(SSIS) first, which is a set of numbers assigned to each node in the graph containing indices of closest nodes on each queue a node needs to synchronize with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*NgWQJ14kXvh_Oe30fTLXlw.png" /><figcaption>Sufficient Synchronization Index Set</figcaption></figure><p>Now we take two previous examples and assign SSIS to each node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4OuSuy-xsRW8EVrLzY-1fQ.png" /><figcaption>Synchronization scenario 1 with assigned SSIS values</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lx0Y5wkhKLf5NH0u0pSOmA.png" /><figcaption>Synchronization scenario 2 with assigned SSIS values</figcaption></figure><p>We start from all zeros in SSIS and then go through each node and for each node iterate through its dependencies on another queues and store indices of closest dependencies into its SSIS. SSIS values for the queue a node corresponds to are set a bit differently (for nodes on queue 0 that would be SSIS[0] and for nodes on queue 1 that’d be SSIS[1] and so forth). In those cases we assign not the index of a dependency (which is a previous node on that queue), but the index of the node itself. Current and previous nodes on the same queue might not be dependent through resource reads/writes, but for the algorithm to work we need to add previous node as a dependency of current one regardless. That’s of course only if previous node exists.</p><p>Following those rules, in first example SSIS for <strong>(3)</strong> becomes (3,5), and in second example SSIS for <strong>(5)</strong> becomes (1,5) and SSIS for <strong>(6)</strong> becomes (1,6).</p><p>Now that we’ve built SSIS for each node we can look for indirect dependencies to cull redundant syncs and solve the problem we have in the second example: node <strong>(6)</strong> is synced with <strong>(1)</strong> indirectly through <strong>(5)</strong> and sync <strong>(6) -&gt;</strong> <strong>(1)</strong> is redundant.</p><p>To find indirect dependencies we introduce second pass of the algorithm.</p><p>Iterate through each node again and for each node look at its dependencies, again. But this time compare values in node’s SSIS with values in SSIS of the dependency.</p><p>By comparing current SSIS with SSIS of dependency we can <em>determine a number of queues we would synchronize with if we’d only synchronize with this dependency only</em>. We compare values for “other” queues directly and for “current” queue by first subtracting 1 from SSIS of current node, to account for different SSIS assignment rule for dependencies on the same queue that we discussed above.</p><p>So let’s take node <strong>(6)</strong> and its first dependency node <strong>(1)</strong>, and compare SSIS values for queue 0. SSIS(Node 6)[0] &lt;= SSIS(Node 1)[0] (1 &lt;= 1) is <strong>true </strong>so we know sync with queue 0 is covered by synchronization with node <strong>(1)</strong>. Now compare values for second queue. SSIS(Node 6)[1] &lt;= SSIS(Node 1)[1] ((6–1) &lt;= 0) is <strong>false</strong> and that means we would <strong>not </strong>synchronize with queue 1 by synchronizing with node <strong>(1)</strong> exclusively and so we must consider other dependencies to achieve full set of required synchronizations. Now take next dependency of node <strong>(6)</strong> which is node <strong>(5)</strong>. By comparing SSIS values we see that synchronizations with both queues are covered by synchronizing with only <strong>(5)</strong>, because both 1 &lt;= 1 and (6–1) &lt;= 5 are <strong>true</strong>. Sync <strong>(6) -&gt; (1)</strong> is now redundant and can be culled.</p><p>In a more general case with N queues we build a list of queues we need to sync with and a list of dependency nodes with number of synchronizations they cover from this queue list. Then we pick a node with maximum number of covered syncs and discard the rest.</p><p>This generalization is sufficient to minimize synchronizations for the cases we examined, but still not full enough to cover all scenarios. Let’s examine another case where this algorithm doesn’t hold up and develop an improvement for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y0bWZj8BRIMtYRHowt8xhw.png" /><figcaption>A more sophisticated synchronization scenario when one pass of search for indirect dependencies is not enough</figcaption></figure><p>Here we can see that node <strong>(6) </strong>needs to be synced with queue 0 after node <strong>(1)</strong>, but sync with <strong>(1)</strong> is redundant, because it can be achieved through synchronization with node <strong>(3)</strong>. Let’s try to cull redundant synchronizations using the algorithm we had up to this point.</p><p>Build list of queues to synchronize with: 0, 1, 2. Find dependency nodes that will synchronize us with maximum number of required queues by comparing SSIS values.</p><p>Possible synchronizations:</p><p><strong>6 -&gt; 1</strong>: 1 queue covered, because 1&lt;=1 <strong>true</strong>, 3&lt;=0 <strong>false</strong>, 5&lt;=0 <strong>false</strong></p><p><strong>6 -&gt; 3</strong>: 2 queues covered, because 1&lt;=1 <strong>true</strong>, 3&lt;=3 <strong>true</strong>, 5&lt;=0 <strong>false</strong></p><p><strong>6 -&gt; 5</strong>: 1 queue covered, because 1&lt;=0 <strong>false</strong>, 3&lt;=0 <strong>false</strong>, 5&lt;=5 <strong>true</strong></p><p>According to our algorithm we take sync with maximum queues covered (<strong>6 -&gt; 3) </strong>and discard the rest, but now we have a problem because only syncs with queues 0 and 1 are performed, queue 2 is left out.</p><p>We can fix this by extending the algorithm.</p><p>After first pass of searching for dependencies covering maximum amount of queue syncs, remove queues that were covered from the list of queues we need to synchronize with and remove such dependency nodes from the list of dependencies to consider on next iteration (if there is one). Also update SSIS values of current node with SSIS values of accepted dependencies for queues that were covered, because SSIS value of dependency can actually be larger than what is expected by current node (which is fine). Now check if we have any queues left we want to sync with. If so, repeat the search of best fit nodes in the list of nodes left from previous iteration. Repeat the cycle until no queues are left in the list. Now nodes that are left as dependencies are the nodes synchronizations with which can be safely culled.</p><p>And that’s it, final piece of an algorithm to find optimal synchronization points given an arbitrary queue/node combination.</p><p><em>Note: having nodes from the same queue as dependencies is only useful as a tool to find indirect synchronizations, they do not actually translate to API synchronizations via fences, because work on the same queue is synced implicitly.</em></p><p>Let’s recap.</p><blockquote>Perform first pass by going through each node and determine their SSIS by looking at closest dependencies on each queue.</blockquote><blockquote>Perform second pass to cull redundant synchronizations by determining a list of relevant queues to sync with and iteratively finding smallest set of nodes synchronizations with which will satisfy all required queue synchronizations, using SSIS comparisons.</blockquote><h3>Using the Graph: Resource State Transitions</h3><p>We’re done with the easier part and move on to resource state transitions which add a thick layer of complications on top of what we already have. Let’s begin by looking at simple cases. The simplest one would be a single queue of render passes or multiple independent queues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9PZYyTewRDOdKOp-jZuVw.png" /><figcaption>Single queue</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yckc1ybchG17iH_gsUKynw.png" /><figcaption>Couple of independent queues</figcaption></figure><p>Transitions are straightforward then: render, transition, repeat. Boring.</p><p>Things start to get interesting when we have a render pass on one queue that uses a resource produced on another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3XZ4xowPMI7KYlTgv5c1A.png" /><figcaption>Cross-queue resource read</figcaption></figure><p>There are two restrictions we have to deal with.</p><p>First, resource transition may contain states unsupported by receiving queue. Example could be a <strong>RenderTarget </strong>produced on graphics queue and consumed on compute queue as a <strong>NonPixelShaderAccess</strong>.</p><p>Second, a common resource can be read by multiple queues, so transitions must be put somewhere outside of work executed on those queues and synchronizations must be adjusted accordingly.</p><p>We can also have a combination of two cases, when resource is read by multiple queues, but transition to a common read state is unsupported on some or even all of the receiving queues.</p><p>An important note here is that even if queue does not support a state transition it still may be able to use resource in that state, it’s just that transition must happen somewhere else. For example, if an <strong>UnorderedAccess </strong>resource produced on graphics queue is read later on both graphics and compute queues as <strong>PixelShaderAccess </strong>on graphics and <strong>NonPixelShaderAccess </strong>on compute, we must transition <strong>UnorderedAccess </strong>into a combined read state suitable for both queues (<strong>AnyShaderAccess </strong>= <strong>PixelShaderAccess </strong>| <strong>NonPixelShaderAccess</strong>). Such transition can only be made on graphics queue, because compute doesn’t know anything about pixel shaders. But, it will happily use <strong>AnyShaderAccess </strong>state regardless, after graphics performed the transition, because it only cares for <strong>NonPixelShaderAccess </strong>being present inside a combined read state, other states, known or unknown to it, are ignored.</p><p>Now let’s look at several examples of challenges we just discussed and try to come up with a strategy (or strategies) to overcome them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jr1Mo6sLdbcvjmpJpb-2VQ.png" /><figcaption>Compatible cross-queue read</figcaption></figure><p>Here a queue reads a resource produced by another and can perform the state transition because all states are compatible. In this case sync between passes found by algorithm discussed earlier stays in the same place and transition can be performed normally before work on receiving queue.</p><p>Now consider same cross-queue dependencies, but with a non-supported state transition.</p><p>Queue 1 cannot transition a resource it reads so we must find a queue that can. Let’s abstract a bit from the graphics API and call it <strong>most competent queue</strong>. If we assume that queue 0 is a graphics queue and queue 1 is compute, then the most competent is queue 0. Now the sync and transition strategy must deviate. We must <strong>reroute </strong>transitions into a separate command list on the most competent queue and rearrange synchronizations to be “plugged” into this command list from both sides.</p><p>Now <strong>transitions </strong>must wait for queues involved in state transition rerouting, so we have additional syncs not accounted by sync optimizing algorithm. We also have to insert a sync after <strong>transitions</strong> and sync our queues with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWhuw8mVq8Zy3UsB4QRfrg.png" /><figcaption>Rerouted transitions. Syncs are “plugged” into a common transitions command list.</figcaption></figure><p>What about reading a common resource by multiple queues? As it turns out the strategy is pretty much the same: move transitions out into a separate command list on the most competent queue (even if most competent queue does not actually read this resource) and synchronize queues to those transitions. This way we handle multi-queue reads and unsupported transitions together.</p><p>Now let’s address an elephant in the room. What happens if we have cross-queue reads in separate groups of queues?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebpU04ihJqoeU8CVCVAopA.png" /><figcaption>Separate collections of mutually dependent queues</figcaption></figure><p>In a general case with N queues and M passes we could have more sophisticated dependencies with separate collections of mutually dependent queues and most competent queue would have to be determined inside each collection. We now have to ask ourselves, do we <em>really </em>need to complicate things even more by introducing such collections? And what happens if more than one collection does not contain a queue competent enough to perform a transition required? The answers are complicated and the whole thing can quickly turn into a synchronization hell, so we need to settle down on one algorithm that would be reasonably manageable and good for performance. But before we do that let’s look into render pass reordering and a necessity of moving every single transition into a common command list instead of leaving some of them close to render pass work.</p><p>An arbitrary order of render passes inside a dependency level is actually not optimal, because API provides us an ability to kickoff transitions early with split barriers. A metric that would determine this optimality is a distance between Begin and End barriers for each resource transition. It would be nice (performance-wise) to make those distances as large as possible to give GPU more time to hide transition and related stalls. So, do we figure out a heuristic to space out render passes as much as possible and celebrate a performance win? In a vacuum, yes, we do. But upon closer inspection, if we consider cases with multi-queue resource reads and synchronizations they bring, we can see that this transition “spacing” and the transition separation it brings can actually hurt more performance than it wins.</p><p>Let’s look at example of multi-queue reads by multiple passes in a dependency level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUO03utu86Uker-7dC7A4g.png" /><figcaption>Separately synced passes in a dependency level due to requirement of separating state transitions</figcaption></figure><p>Because we want to increase time distance between transitions we have to perform transitions relevant to each pass separately. That means that we can no longer have a single <strong>rerouted </strong>command list that performs all transitions, we have multiple of those and each pair of work on queue 0 and 1 must be synced separately. And that can kill parallelism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DRdED8z8qJG7fwBO1O9StQ.png" /><figcaption>Bad parallelism</figcaption></figure><p>This is how work in a dependency level may look like when we have multiple synchronization points due to cross-queue resource reads. We have nasty stalls on each queue.</p><p>Let’s see what happens if we move all transitions into a single <strong>rerouted </strong>command list as proposed earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4rsbUBU9vyerzHeroaJFvQ.png" /><figcaption>Commonly transitioned and synced passes in a dependency level</figcaption></figure><p>In this example we ditched the idea of smart pass reordering and also performing transitions not in a common dedicated command list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BSPThpH_FeMfQowKchN3Lg.png" /><figcaption>Good parallelism</figcaption></figure><p>Now with syncs only at the dependency level beginning we have a nicely paralleled work.</p><p>So, when cross-queue dependencies take place in a single dependency level, it looks like moving transitions into a single command list is a better approach than alternatives. But what about queues not involved in complex relations or dependency levels that contain work on only one queue? For those it looks like there are no obstacles for intelligent pass reordering and resource transition separation. And that’s true, so we should actually separate the two cases, which leads us to the final algorithm to manage transitions.</p><blockquote>Gather set of queues involved in multi-queue resource reads using a single condition: if resource is read by more than one queue in a dependency level, add those queues to the set. Then, additionally, detect queues to which we move state transitions due to state incompatibilities and add those queues to the same set. Now take the most competent queue in the set and <strong>reroute </strong>all transitions and synchronizations to that queue as discussed earlier. We may have queues left that’re not involved in such complex relations. We process those separately without sync and transition rerouting.</blockquote><h3>Using the Graph: API-specific nuances</h3><p>Now that the “big” part of the algorithm is behind us let’s dive into smaller, but still important topics.</p><h4>Split barriers</h4><p>They are a good optimization, but not always applicable. Split barrier is actually two barriers with same Before and After states, so when scheduling a frame we need to check whether both receiving and transmitting queues support transitions with those states. If they do, then we use split barriers, if not, use normal barrier on the receiving queue only.</p><h4>Command list batching</h4><p>We gather arrays of command lists that are surrounded by fence waits and/or signals. Each array (batch) is a separate ExecuteCommandLists call.</p><p>Going through graph’s dependency levels we first deal with passes on queues that require transition rerouting. We move the common transitions command list into its own batch and surround it with waits and signals as discussed earlier. Then we batch passes in that dependency level by adding passes on the same queue to the same batch until a fence signal requirement is detected. If signal is detected, we create a new batch to which subsequent render passes will be added.</p><p>Then we batch passes on queues that <strong>do not </strong>require state transition rerouting. Here we add passes to batches similarly, by creating new batch when signal is required, but also we create a new batch when wait is required, the only difference is that pass that requires wait will go into a new batch instead of staying in the old one.</p><h4>GPU memory load</h4><p>There is also a concern of GPU memory load. Because we have a restriction of producing (writing) the same resource only once in a frame, we might create more resources than we might have in other renderer designs. We could’ve gone a DX11-style of solving this problem by introducing pools of resources with identical properties and use some name aliasing mechanism, but that’s not actually required nowadays. In newer APIs this problem is solved by memory aliasing achieved through <strong>placed resources </strong>and an ability to overlap memory regions of resources used in disjoint periods of time. An algorithm to find optimal overlapping memory regions using resource usage timelines is a topic on its own and is discussed in a <a href="https://medium.com/p/45933681a15e">separate article</a>.</p><h3>Using the Graph: Corner cases</h3><p>A note on circular dependencies. We might have situations when circular dependency might seem necessary, like when performing temporal re-projection from previous frame and reading a texture before it’s written to re-project, then write current frame data into it, then maybe read again in the same frame for different purposes. If we accept such scenarios then we have to engineer manual mechanisms for resolving circular dependencies which is the worse alternative. A better one is to just design render pipeline to avoid circular dependencies at all times. The above example can be solved by introducing two textures instead of one and ping-ponging them between frames without scheduling texture from previous frame for writing in current one.</p><p>Also there are read-write resource accesses we might want to have, when blurring an image separably in one render pass, for example. In a graph this looks like a node that has a cycle with itself. The solution is to treat such cases as write only dependencies when building a graph, nothing is actually stopping us from writing and reading a resource inside of the same render pass afterwards.</p><p>Another thing that we left out is multiple write dependencies. Writing to the same resource in multiple passes might be desired to reduce memory bandwidth consumption, when render pass writes only to a portion of an existing target. In such case we might have to bite the bullet and engineer additional mechanism for resolving render pass order when multiple write dependencies are encountered. Take a simple example: <strong>write A</strong>, <strong>read A</strong>, <strong>write A</strong>. Where should reading render pass be put? After first write or after second? One way is to look at initial list of “unordered” render passes and use it as a hint. This of course means that we cannot initially throw render passes into the graph in a random order, the order in which we add them must resemble their final execution order. Other solution might be implementing some sort of list of rules, that graph consults when it encounters an ambiguity.</p><h3>Conclusion</h3><p>We worked through quite a few challenges to actually leverage low-level frame control provided by modern graphic APIs and by now can probably imagine what hoops drivers had previously jump through to make everything coherent with immediate-mode approach and without high-level knowledge of frame workload. I don’t claim to present best possible solutions, because each engine might require different designs, but I think approaches discussed above are a good compromise.</p><h3>Thanks</h3><p>I thank Oleksandr Novytskyi from Ubisoft Kyiv for helping me develop an intuition behind Sufficient Synchronization Index Set idea.</p><h3>Code</h3><p>For complete implementation please see my engine <a href="https://github.com/man-in-black382/PathFinder">PathFinder</a>.</p><p>Selected code references:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60ec10794cf3335fb8648c74cfb70cb8/href">https://medium.com/media/60ec10794cf3335fb8648c74cfb70cb8/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/def8816d21fda2ac5330949f97b393bd/href">https://medium.com/media/def8816d21fda2ac5330949f97b393bd/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed1cb176459a77af75581be42b7d02c2/href">https://medium.com/media/ed1cb176459a77af75581be42b7d02c2/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3fc9ebd1257b6d10da7442b32fae09e/href">https://medium.com/media/c3fc9ebd1257b6d10da7442b32fae09e/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08347bb4e92dea250a5fded3bd919c1d/href">https://medium.com/media/08347bb4e92dea250a5fded3bd919c1d/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f129c87d9bb25d223dcef3dcda9b129/href">https://medium.com/media/5f129c87d9bb25d223dcef3dcda9b129/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3eba45ace3a94294126d0f86ddf4448c/href">https://medium.com/media/3eba45ace3a94294126d0f86ddf4448c/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1308fa92276d1933d51dd5426537e40d/href">https://medium.com/media/1308fa92276d1933d51dd5426537e40d/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dfd719a53cb2f74b23931929c9e9f95/href">https://medium.com/media/9dfd719a53cb2f74b23931929c9e9f95/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3fd5f2c2af3" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/organizing-gpu-work-with-directed-acyclic-graphs-f3fd5f2c2af3">Organizing GPU Work with Directed Acyclic Graphs.</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>