<?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[RAPIDS AI - Medium]]></title>
        <description><![CDATA[RAPIDS is a suite of software libraries for executing end-to-end data science &amp; analytics pipelines entirely on GPUs. - Medium]]></description>
        <link>https://medium.com/rapids-ai?source=rss----2d7ba3077a44---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>RAPIDS AI - Medium</title>
            <link>https://medium.com/rapids-ai?source=rss----2d7ba3077a44---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 22:23:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/rapids-ai" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[RAPIDS 24.08: Better scalability, performance, and CPU/GPU interoperability]]></title>
            <link>https://medium.com/rapids-ai/rapids-24-08-better-scalability-performance-and-cpu-gpu-interoperability-f88086386da6?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/f88086386da6</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-processing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[gpu]]></category>
            <dc:creator><![CDATA[Manas Singh]]></dc:creator>
            <pubDate>Tue, 27 Aug 2024 20:19:38 GMT</pubDate>
            <atom:updated>2024-08-27T20:19:38.444Z</atom:updated>
            <content:encoded><![CDATA[<p>RAPIDS 24.08 is now available with significant updates geared towards processing larger workloads and seamless CPU/GPU interoperability.</p><ul><li>cuDF pandas accelerator mode now allows you to process larger-than-GPU memory workloads, as well as supports columns with two billion rows of strings.</li><li>RAPIDS cuVS achieves better search accuracy by ensuring connected graphs, and maintains the accuracy as you add additional vectors. cuVS CPU/GPU interoperability has also been improved by providing a C++ API within cuVS for graph conversion.</li><li>cuML now accelerates dimensionality reduction of much larger datasets with UMAP by up to 300x.</li></ul><p>Read on for more details!</p><h3>Process workloads larger than GPU memory with cuDF pandas accelerator mode</h3><p><a href="https://rapids.ai/cudf-pandas/">cuDF’s pandas accelerator mode</a> — the zero-code-change accelerator for pandas workflows — can now speed up processing of much larger datasets and workloads that exceed available GPU memory. To achieve this, cudf.pandas now uses <a href="https://developer.nvidia.com/blog/unified-memory-cuda-beginners/">CUDA Unified Memory (<em>managed memory</em>)</a> by default. Unified Memory enables CUDA programs to oversubscribe GPU memory by automatically migrating memory pages between CPU and GPU memory. To ensure high performance, cuDF now also automatically prefetches managed memory to the GPU before accessing it.</p><p>In Figure 1, the benchmark for accelerated pandas, running data processing workloads with a 10 GB dataset using cuDF achieved up to 30x speedups compared to CPU-only pandas for data joins on an NVIDIA T4 GPU with 16 GB memory. It is important to note that queries shown in Figure 1 require allocating more memory than available on the GPU. Before cuDF 24.08, this would have caused fallback to CPU-only pandas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jiZQEj8vARvrg0Ag" /><figcaption><em>Figure 1. DuckDB Data Benchmark (with a 10 GB dataset) performance comparison between cuDF pandas and traditional pandas v2.2 ; HW: NVIDIA T4, CPU: Intel Xeon Gold 6130 CPU; SW: pandas v2.2.2, RAPIDS cuDF 24.08</em></figcaption></figure><p>For more information about these benchmark results and how to reproduce them, see the <a href="https://docs.rapids.ai/api/cudf/stable/cudf_pandas/benchmarks/">cuDF benchmarks guide</a><a href="https://github.com/rapidsai/db-benchmark/">.</a></p><p>The second big improvement introduced in cuDF 24.08 is support for large string columns. Previously, dataframes could only contain 2.1 billion characters per column because indexes were based on 32-bit integers. Now cuDF dynamically switches between 32-bit and 64-bit indices when a string column’s data exceeds 2.1B characters. This allows cuDF to keep a lower memory footprint and higher processing speed and still support efficient processing for large string columns. Together, these two new features enable you to process much larger datasets with much more textual data.</p><h3>Accelerating UMAP in cuML with faster knn graph building</h3><p>You can now speed up dimensionality reduction and visualization of massive datasets using UMAP with the addition of a faster algorithm for building the initial knn graph. This feature adds a new `<em>build_algo`</em> argument to the UMAP estimator in cuML, and by default this is set to `<em>auto`</em> so most users don’t need to do anything to take advantage of this new capability. To force the faster graph building,<em> `build_algo`</em> can be set to use <em>`nn_descent`</em> ANN algorithm. Of course <em>`brute_force`</em> can still be used for great performance on the GPU when the original exact knn graph build algorithm is preferred. To start using this algorithm, you just need to set the `<em>build_algo`</em> parameter to <em>`nn_descent`</em> like below.</p><pre>from cuml.manifold.umap import UMAP<br>data = generate_data()<br>umap_nnd = UMAP(build_algo = &quot;nn_descent&quot;) # defaults to &quot;auto&quot;<br>Embedding = umap_nnd.fit_transform(data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*LUjl7Qbz-upA8zdS" /><figcaption>Figure 2: Time to build knn graph for different dataset sizes with `NN Descent` and `Brute Force` graph building algorithms</figcaption></figure><p>As shown in the above graph, the speed up can be up to 300x for a 30GB dataset on an H100 GPU (GPU Memory: 80GB) with no material impact to the embedding quality as seen by the trustworthiness score. In the upcoming release, UMAP will also be capable of processing datasets larger than GPU memory through a novel batching process. Stay tuned for that!</p><h3>Seamless CPU / GPU index interoperability and improved vector search with cuVS</h3><p>cuVS, the RAPIDS vector search library, has now further improved seamless execution between CPU and GPU, both for vector index building and search tasks. While CAGRA, the GPU-native graph-based approximate nearest neighbors (ANN) index, tends to have lower latency than the CPU overall, this interoperability between GPU and CPU offers a significant cost reduction by offloading the most compute-intensive parts to the GPU. For your library development work, CuVS now has a C++ API that allows converting CAGRA indexes which were built on the GPU to HNSW (loaded via HNSW API wrapper in cuVS) on CPU. You will also be able to use the C and Python-based APIs to perform the above index conversion in the future releases. The code snippet below shows a sample C++ code that you can use to convert the indexes.</p><pre>#include &lt;raft/core/device_resources.hpp&gt;<br>#include &lt;cuvs/neighbors/cagra.hpp&gt;<br>using namespace cuvs::neighbors;<br>raft::device_resources res;<br>cagra::index_params index_params;<br>auto index_vectors = raft::make_device_matrix&lt;float, int64_t&gt;(res, n_vecs, dim);<br>// … populate index vectors<br>auto cagra_index = cagra::build(res, index_params, index_vectors);<br>auto hnsw_index = hnsw::from_cagra(res, cagra_index);</pre><p>You can now also add vectors to an existing CAGRA index, another highly requested feature. Adding vectors to the CAGRA graph while maintaining search accuracy has been a challenge. Now, you can add 20% additional vectors without seeing a significant degradation in search accuracy.<strong> </strong>See the below example demonstrating how the C++ based API can be used to add vectors to an existing CAGRA index.</p><pre>#include &lt;raft/core/device_resources.hpp&gt;<br>#include &lt;cuvs/neighbors/cagra.hpp&gt;<br>using namespace cuvs::neighbors;<br>raft::device_resources res;<br>cagra::index_params index_params;<br>auto index_vectors = raft::make_device_matrix&lt;float, int64_t&gt;(res, n_vecs, dim);<br>// … populate index vectors<br>auto index = cagra::build(res, index_params, index_vectors);<br>auto new_vectors = raft::make_host_matrix&lt;float, int64_t&gt;(res, n_new_vecs, dim);<br>// … populate new vectors<br>cagra::extend_params extend_params;<br>cagra::extend(res, extend_params, raft::make_const_mdspan(new_vectors.view()), index);</pre><p>Lastly, you can improve the accuracy of the vector search by ensuring that the CAGRA graph is connected. Now, you can enable the build parameter option to guarantee that the graph is connected, ensuring comprehensive traversal across nodes and improving the search performance. See the below example of how you can set the `guarantee_connectivity` parameter in the CAGRA API as true to ensure connected graphs.</p><pre>#include &lt;raft/core/device_resources.hpp&gt;<br>#include &lt;cuvs/neighbors/cagra.hpp&gt;<br>using namespace cuvs::neighbors;<br>raft::device_resources res;<br>cagra::index_params index_params;<br>index_params.guarantee_connectivity = true;<br>auto index_vectors = raft::make_device_matrix&lt;float, int64_t&gt;(res, n_vecs, dim);<br>// … populate index vectors<br>auto index = cagra::build(res, index_params, index_vectors);</pre><h3>Enhanced CUDA 12.5 support and adjustments to dependency versions</h3><p>RAPIDS has a few dependency support changes that users should be aware of. For more, please see our <a href="https://docs.rapids.ai/notices">RAPIDS Notices page</a>.</p><ol><li>RAPIDS added CUDA 12.5 support in the 24.08 release. So RAPIDS 24.08 CUDA 12 packages are now installable and usable with CUDA 12.0–12.5. Docker containers for CUDA 12.5 are also included.</li><li>RAPIDS deprecated support for CUDA 12.2 in its Docker containers in the 24.08 release; RAPIDS 24.08 will be the last version to release CUDA 12.2 Docker containers. More details can be found in the <a href="https://docs.rapids.ai/notices/rsn0039/">RAPIDS Support Notice (RSN) here</a>.</li><li>RAPIDS is dropping support for Python 3.9 in its upcoming 24.10 release. RAPIDS will simultaneously add support for Python 3.12. More details can be found in the <a href="https://docs.rapids.ai/notices/rsn0040/">RAPIDS Support Notice (RSN) here</a>.</li></ol><h3>Conclusion</h3><p>The RAPIDS 24.08 release takes another step forward in our mission to make accelerated computing more accessible to data scientists and engineers. We can’t wait to see what people do with these new capabilities.</p><p>To get started using RAPIDS, visit the <a href="https://rapids.ai/#quick-start">Quick Start Guide</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f88086386da6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/rapids-24-08-better-scalability-performance-and-cpu-gpu-interoperability-f88086386da6">RAPIDS 24.08: Better scalability, performance, and CPU/GPU interoperability</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAPIDS 24.04 Release]]></title>
            <link>https://medium.com/rapids-ai/rapids-24-04-release-c11cf44c3e23?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/c11cf44c3e23</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rapids-ai]]></category>
            <dc:creator><![CDATA[Nick Becker]]></dc:creator>
            <pubDate>Wed, 24 Apr 2024 19:12:31 GMT</pubDate>
            <atom:updated>2024-04-24T19:16:40.334Z</atom:updated>
            <content:encoded><![CDATA[<p>The RAPIDS 24.04 release is now available, and it includes a new accelerated vector search library, expanded zero-code change experiences for pandas and NetworkX workflows, optional query optimization for Dask workflows, support for Python 3.11 and pandas 2, and more.</p><h3>Table of Contents</h3><ul><li><a href="https://medium.com/rapids-ai/rapids-24-04-release-c11cf44c3e23#7f6d">Bringing accelerated vector search to everyone with cuVS</a></li><li><a href="https://medium.com/rapids-ai/rapids-24-04-release-c11cf44c3e23#f263">Expanded zero code change acceleration for pandas and NetworkX code</a></li><li><a href="https://medium.com/rapids-ai/rapids-24-04-release-c11cf44c3e23#4ec7">Dask Expressions / Query planning now supports cuDF (experimental)</a></li><li><a href="https://medium.com/rapids-ai/rapids-24-04-release-c11cf44c3e23#07b5">RAPIDS-wide support for Python 3.11 and pandas 2</a></li><li><a href="https://medium.com/rapids-ai/rapids-24-04-release-c11cf44c3e23#a8d0">Free on-demand video deep dives into Data Science from GTC</a></li></ul><h3>Bringing accelerated vector search to everyone with cuVS</h3><p>To better serve the needs of the vector search and database community, we’ve released <a href="https://rapids.ai/cuvs/">cuVS</a>, a new library dedicated to vector search.</p><p>cuVS contains state-of-the-art implementations of several algorithms for running approximate nearest neighbors and clustering on the GPU. It’s derived from the core algorithms in RAPIDS RAFT and purpose built to be easily embeddable in the world’s vector databases or used as a standalone tool.</p><p>As part of our work to simplify tapping into accelerated vector search, cuVS now includes both C and Rust APIs in addition to the existing C++ and Python APIs.</p><p>The example below shows how to build a vector search index with cuVS’ new C API and <a href="https://github.com/dmlc/dlpack">DLPack</a>:</p><pre>#include &lt;cuvs/neighbors/cagra.h&gt;<br><br>cuvsResources_t res;<br>cuvsCagraIndexParams_t index_params;<br>cuvsCagraIndex_t index;<br><br>DLManagedTensor *dataset;<br>load_dataset(dataset);<br><br>cuvsResourcesCreate(&amp;res);<br>cuvsCagraIndexParamsCreate(&amp;index_params);<br>cuvsCagraIndexCreate(&amp;index);<br><br>cuvsCagraBuild(res, index_params, dataset, index);<br><br>cuvsCagraIndexDestroy(index);<br>cuvsCagraIndexParamsDestroy(index_params);<br>cuvsResourcesDestroy(res);</pre><p>For those who prefer Rust, use the following example of building a vector search index with cuVS’ new Rust API:</p><pre>use cuvs::cagra::{Index, IndexParams, SearchParams};<br>use cuvs::{ManagedTensor, Resources, Result};<br><br>use ndarray::s;<br>use ndarray_rand::rand_distr::Uniform;<br>use ndarray_rand::RandomExt;<br><br>/// Example showing how to index and search data with CAGRA<br>fn cagra_example() -&gt; Result&lt;()&gt; {<br>    let res = Resources::new()?;<br><br>    // Create a new random dataset to index<br>    let n_datapoints = 65536;<br>    let n_features = 512;<br>    let dataset =<br>        ndarray::Array::&lt;f32, _&gt;::random((n_datapoints, n_features), Uniform::new(0., 1.0));<br><br>    // build the CAGRA index<br>    let build_params = IndexParams::new()?;<br>    let index = Index::build(&amp;res, &amp;build_params, &amp;dataset)?;<br>    println!(<br>        &quot;Indexed {}x{} datapoints into cagra index&quot;,<br>        n_datapoints, n_features<br>    );<br><br>    Ok(())<br>}</pre><p>With these new C and Rust bindings, you can now integrate CAGRA and all of its goodness into nearly any codebase.</p><p>For example, the team at SearchScale have been working on <a href="https://github.com/SearchScale/lucene-cuvs">bringing cuVS into Apache Lucene</a> via the new C API to help power an ecosystem built on Java. We’re excited to see this work progress and are excited to help bring accelerated vector search to every platform.</p><p>Stay tuned for more information about cuVS in an upcoming blog.</p><h3>Expanding Zero Code Change Acceleration for pandas and NetworkX code</h3><p>We’re continuing to invest in making accelerated computing more accessible to data scientists and engineers who may be working with their favorite CPU-based tools and frameworks day-to-day.</p><p><strong>cudf.pandas is now GA<br></strong>cuDF’s pandas accelerator mode, the zero-code change accelerator for pandas workflows, has graduated from Beta and is now Generally Available (GA). Over the past six months, we’ve fixed dozens of bugs, improved the profiler, and expanded our comprehensive unit and integration tests suite.</p><p>Now that cudf.pandas is GA it’s fully supported by <a href="https://www.nvidia.com/en-us/data-center/products/ai-enterprise/">NVIDIA AI Enterprise</a> — enabling every organization to go to production confidently. You can learn more in the <a href="https://docs.rapids.ai/api/cudf/stable/cudf_pandas/">cudf.pandas section</a> of the cuDF documentation.</p><p><strong>cuGraph Backend for NetworkX<br></strong>With the 24.04 release, the cuGraph backend for NetworkX (nx-cugraph) now supports more than 60 algorithms. We continue to collaborate with the NetworkX community to both solidify the backend dispatching infrastructure for all backends and ensure that the user experience for GPU-accelerated NetworkX is smooth.</p><p>In line with that goal, NetworkX 3.3 includes support for graph caching to backends. In prior versions, each time NetworkX dispatched to cuGraph (or any other backend) the underlying graph data structure needed to be converted into something the backend could operate on (e.g., a GPU object).</p><p>Now, this graph conversion only occurs <strong>once</strong> — bringing significant performance gains to workflows that involve running multiple graph algorithms on the same underlying data.</p><p>If you’re curious about whether your favorite algorithm is supported by the cuGraph backend, the <a href="https://networkx.org/documentation/latest/reference/algorithms/index.html">latest NetworkX documentation</a> indicates whether an algorithm is supported by alternative backends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Sto9A1NKabEGGxuE" /></figure><p>To learn more about NetworkX backend dispatching in general, visit the <a href="https://networkx.org/documentation/latest/reference/backends.html#module-networkx.utils.backends">NetworkX Backends documentation</a>.</p><h3>Dask-cuDF Now Supports Query Planning [Experimental]</h3><p>We’ve been working with the Dask community to bring automatic query planning and optimization to Dask DataFrames through the <a href="https://github.com/dask/dask-expr">dask-expr</a> project. Beginning with the 24.04 release, Dask cuDF now supports automatic query optimization as an experimental, optional configuration.</p><p>Query optimization can improve performance and reduce peak memory requirements for a given workflow by avoiding unnecessary computation and choosing the most efficient execution path.</p><p>With query planning enabled in the example query below, both the equality filter and column selection will be pushed down into the read_parquet call, avoiding significant unnecessary IO and computation. Without query planning, you’d need to manually optimize your code to achieve the same behavior (which can get quite complex in larger workflows).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_lQlacgFL6fiSIS7" /></figure><p>We see this play out in practice when running various analytics workflows on a 100GB dataset. Query optimization provides benefits for both single and multi-GPU workflows, resulting in both faster performance and the ability to complete larger workflows on a single-GPU system without running out of memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*15Oms_HU3mFrEzIG" /><figcaption>Various analytics workflows on a 100GB dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xFXLNS_bzK1JItd7" /><figcaption>Various analytics workflows on a 100GB dataset</figcaption></figure><p>In the RAPIDS v24.06 release, we anticipate Dask cuDF will support query optimization by default rather than as an experimental, opt-in configuration.</p><h3>RAPIDS-wide support for Python 3.11 and pandas 2</h3><p><strong>Python 3.11<br></strong>The 24.04 release brings Python 3.11 support to RAPIDS with packages and containers now available. The <a href="https://rapids.ai/#quick-start">RAPIDS Quick Start</a> guide now uses Python 3.11 by default, but you can always use the <a href="https://docs.rapids.ai/install#selector">Release Selector</a> to choose your specific combination of platform dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ygTR-IHU0aC0kZ46" /></figure><p><strong>Pandas 2<br></strong>Version 2 was a major milestone for <a href="https://pandas.pydata.org/">pandas</a>, bringing significant updates like expanded PyArrow support, copy-on-write enhancements, nullable data types, and more.</p><p>Beginning with the 24.04 release, cuDF and all RAPIDS libraries now support (and require) pandas 2. As part of this upgrade, cuDF now contains numerous feature improvements, API optimizations and long-standing deprecation enforcements that simplify data analysis workflows. In addition to providing a better experience for cuDF and cudf.pandas users, these enhancements propagate to downstream libraries like cuML and cuGraph that are designed to accept both cuDF and pandas inputs.</p><p>For those interested in a full list of breaking changes compared to prior versions of cuDF tied to pandas 1.x, you can learn more in the breaking changes section of the <a href="https://docs.rapids.ai/api/cudf/stable/user_guide/pandas-2.0-breaking-changes/">cuDF user guide</a>.</p><h3>Free on demand video deep dives into Data Science from GTC</h3><p>NVIDIA GTC took place last month and highlighted some of the incredible work going on in the world of accelerated data science and data processing. In case you missed it, you can still register for free and watch sessions about:</p><ul><li><a href="https://www.nvidia.com/en-us/on-demand/session/gtc24-s62599/">Accelerated vector search and databases</a></li><li><a href="https://www.nvidia.com/en-us/on-demand/session/gtc24-s61197/">Scaling graph neural networks to trillion-edge sized graphs</a></li><li><a href="https://www.nvidia.com/en-us/on-demand/session/gtc24-s62506/">Reducing Apache Spark cloud costs with Spark RAPIDS</a></li><li><a href="https://www.nvidia.com/en-us/on-demand/session/gtc24-s62550/">Best practices for GPU memory management in Python and C++</a></li><li>And so much more</li></ul><p>You can search all of the data science and data processing sessions <a href="https://www.nvidia.com/gtc/sessions/data-science/">here</a>.</p><h3>Conclusion</h3><p>The RAPIDS 24.04 release takes another step forward in our mission to make accelerated computing more accessible to data scientists and engineers. We can’t wait to see what people do with these new capabilities.</p><p>To get started using RAPIDS, visit the <a href="https://rapids.ai/#quick-start">Quick Start Guide</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c11cf44c3e23" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/rapids-24-04-release-c11cf44c3e23">RAPIDS 24.04 Release</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAPIDS 24.02 release]]></title>
            <link>https://medium.com/rapids-ai/rapids-24-02-release-43ad88db0627?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/43ad88db0627</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rapids-ai]]></category>
            <dc:creator><![CDATA[Alex Ravenel]]></dc:creator>
            <pubDate>Thu, 22 Feb 2024 22:28:39 GMT</pubDate>
            <atom:updated>2024-02-22T22:28:39.560Z</atom:updated>
            <content:encoded><![CDATA[<p>Zero code-change NetworkX, RAPIDS on Databricks with Dask, and more!</p><p>RAPIDS just released its 24.02 version, which brings with it a major expansion to the new zero-code-change experience for NetworkX users, improvements to XGBoost 2.0, and improvements to cuDF’s parquet and JSON readers. Additionally, RAFT now supports more flexible vector search deployments on CPU, RMM now supports pinned host memory, and RAPIDS now works on Databricks with Dask.</p><p>24.02 also brought with it a number of changes to platform and support dependencies (including the end of Pascal architecture support) — make sure to understand if any of these impact you!</p><p>Finally, we’d be remiss not to mention the return of NVIDIA’s GTC conference in-person this year! Data science has many talks and events–take a look at the <a href="https://www.nvidia.com/gtc/sessions/data-science/">data science talks here</a>, and we hope to see you there!</p><h3>Table of Contents</h3><ul><li><a href="#f3a6">Zero code change NetworkX</a></li><li><a href="#fa23">cuML + XGBoost 2.0</a></li><li><a href="#87c6">cuDF Improvements</a></li><li><a href="#4580">RAFT + Vector Search</a></li><li><a href="#b4ec">RMM Memory Manager</a></li><li><a href="#f361">RAPIDS on Databricks with Dask</a></li><li><a href="#b45b">Infrastructure and Support Updates</a></li><li><a href="#69e9">NVIDIA GTC</a></li><li><a href="#a629">Conclusion</a></li></ul><h3>Zero code change NetworkX</h3><p><a href="https://github.com/rapidsai/cugraph/blob/branch-24.02/python/nx-cugraph/README.md">nx-cugraph</a> is a backend for NetworkX that uses cugraph to GPU accelerate NetworkX workflows, and for release 24.02, nx-cugraph expanded the number of algorithms, bringing the total to 37, with an additional 41 functions for creating test graphs. NetworkX users can install nx-cugraph to experience GPU acceleration for algorithms such as ancestors, descendants, BFS, reciprocity, triangle counting, weakly connected components, and others, all without changing their code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/0*rds7bAWoWF5XUIVA" /><figcaption><em>Runtime for NetworkX bfs_tree algo for NetworkX (blue) vs. Accelerated NetworkX (purple). Total speedup varies based on the use case and if the graph is converted for use on GPUs prior to the call</em></figcaption></figure><h3>cuML + XGBoost 2.0</h3><p>XGBoost 2.0 is now available in our conda channel! This brings all the improvements of XGBoost 2.0 including: a simpler and consistent API for CUDA execution, multi-target trees with vector-leaf outputs, GPU acceleration of the approximate tree method, rewritten learning to rank implementation, quantile regression among many other features. This release also includes RMM integration which enables using XGBoost 2.0 with memory pools that are shared with other RMM enabled libraries (including RAPIDS, PyTorch, CuPy and others), speeding up applications and allowing better use of GPU memory across complex workflows. Alongside FIL and Triton, we continue working to improve and accelerate both training and inference of gradient boosted models with GPUs.</p><p>cuML also now fully supports multi node-multi gpu Logistic Regression with dask as well as Spark. Using cuml.dask on a single node with 4 H100, this allows processing a 60GB dataset 3.5x faster than a single H100, and also allows processing of much larger datasets without needing to spill to system memory. For example, a single T4 (with 16GB of GPU memory) can process datasets of up to 12 GB, but 4 T4s elevate that to 46GBs. Not only does this allow scaling up for bigger datasets, it enables flexibility for users doing training of Logistic Regression models even with GPUs that have lower memory footprints or very diverse configurations. Sparse data processing will be available within the next few releases.</p><h3>cuDF improvements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G8dT5UP7Q7IvqHfI" /></figure><p>RAPIDS 24.02 includes improvements to libcudf’s chunked parquet reader, making it possible to reduce the memory footprint of parquet reads. For 536 MB tables, the chunked reader drops memory footprint from ~2.2 to ~1.4x peak memory footprint with a 200MB chunk size. Using results from the libcudf microbenchmarks, the chunked parquet reader uses 40% less peak memory while maintaining &gt;85% of the data throughput. Chunked parquet reading is available in the C++ API, and we’re planning to add support to cuDF-python in the future (see more in <a href="https://github.com/rapidsai/cudf/issues/14966">this issue</a>).</p><p>libcudf’s JSON reader also added new options for reading mixed data types in the same key and supporting single-quoted JSON variants. Previously cuDF-python would raise an exception if a JSON key had values of varying data types:</p><pre>&gt;&gt;&gt; j = &#39;{&quot;product&quot;:{&quot;id&quot;:12}}\n{&quot;product&quot;:[6,9]}&#39;<br>&gt;&gt;&gt; b = BytesIO(j.encode(&#39;utf-8&#39;))<br>&gt;&gt;&gt; pd.read_json(b, lines=True)<br>product<br>0 {&#39;id&#39;: 12}<br>1 [6, 9]<br># pandas returns python objects<br>&gt;&gt;&gt; cudf.read_json(b, lines=True)<br>RuntimeError: CUDF failure at: /nfs/repo/cudf24.02pqchunk/cpp/src/io/json/json_column.cu:629: A mix of lists and structs within the same column is not supported<br># cudf raises an exception<br>&gt;&gt;&gt; cudf.read_json(b, lines=True, mixed_types_as_string=True)<br>product<br>0 {&quot;id&quot;:12}<br>1 [6,9]<br># cudf returns unparsed strings, instead of crashing or losing data</pre><h3>RAFT + Vector Search</h3><p>The graph-based approximate nearest neighbors (ANN) index CAGRA can now be trained on the GPU and moved over to host (RAM) memory to be searched on the CPU with the popular HNSW algorithm. While the CAGRA index tends to have lower latency than the CPU overall, this interoperability between GPU and CPU offers a significant cost reduction by offloading the most compute-intensive parts to the GPU.</p><p>Below is a code example using RAFT’s Python API to build a CAGRA index on the GPU and load it into an HNSW index for searching.</p><pre>import cupy as cp<br>from pylibraft.common import DeviceResources<br>from pylibraft.neighbors import cagra, hnsw<br>n_samples = 50000<br>n_features = 50<br>dataset = cp.random.random_sample((n_samples, n_features), dtype=cp.float32)<br>handle = DeviceResources()<br>index = cagra.build(cagra.IndexParams(), dataset, handle=handle)<br>hnsw_index = hnsw.from_cagra(index, handle=handle)</pre><p>Benchmarking index build times for RAFT’s graph-based CAGRA algorithm against the industry-standard HNSW algorithm on the CPU. Benchmarking was done using all available cores of an Intel Sapphire Rapids CPU and an Nivida H100 GPU.</p><p>HNSW has become an industry standard for vector search because it is simple to use, works out of the box without minimal parameter tuning, and its low-latency search is often fast enough for many use-cases like retrieval augmented generation (RAG) and recommender systems. Unfortunately, while building the index can often be done in parallel, the resulting performance leaves something to be desired.</p><p>The chart below shows the average build times for indexes that performed at various levels of recall. It takes significantly less time to build the CAGRA algorithm on the GPU than building the <a href="https://github.com/nmslib/hnswlib">HNSWlib</a> algorithm on the CPU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*LrTN2XhPiolAaphN" /></figure><h3>RMM Memory Manager Library</h3><p>When copying data between GPU (device) and CPU (host), using pinned host memory results in much higher bandwidth and reduced synchronization. While <a href="https://github.com/rapidsai/rmm">RMM</a> supported a host_memory_resource for allocating pinned memory in the past, this could not be used as the upstream memory resource (MR) for an RMM memory pool. RMM 24.02 includes a new host_pinned_memory_resource that allocates pinned host memory and can be used as the upstream MR for a pool_memory_resource. Pinned host pools are available in the RMM 24.02 C++ API and will be used in the near future to improve performance of Parquet reading and dataframe spilling in cuDF.</p><p>In this release RMM also moved further into a significant refactoring to use the new <a href="https://nvidia.github.io/cccl/libcudacxx/extended_api/memory_resource.html">cuda::memory_resource concepts now included in libcu++</a>. cuda::memory_resource and related features provides a C++ interface for heterogeneous, stream-ordered memory allocation tailored to the needs of CUDA C++ developers. The design builds on the success of RMM and evolves the design based on lessons learned. &lt;cuda/memory_resource&gt; is not intended to replace RMM, but instead moves the definition of the memory allocation interface to a more centralized home in the CUDA Core C++ Libraries (CCCL). RMM will remain as a collection of implementations of the cuda::mr interfaces. This refactoring will continue over the next few releases and include changes to other RAPIDS libraries.</p><p>With the new memory_resource concepts, instead of implementing a memory resource as a class that derives from rmm::mr::device_memory_resource and implements the pure virtual methods of the base class, now memory resource implementations only need to implement the cuda::mr::memory_resource and/or cuda::mr::async_memory_resource concepts. This simply means that the class must implement the appropriate allocate/deallocate and/or allocate_async/deallocate_async functions and comparison operators, as in the following (trivial) example. Please <a href="https://nvidia.github.io/cccl/libcudacxx/extended_api/memory_resource/resource.html">see the docs for more examples</a>.</p><pre>struct example_memory_resource {<br>  void* allocate(std::size_t, std::size_t) { return nullptr; }<br>  void deallocate(void*, std::size_t, std::size_t) {}<br>  void* allocate_async(std::size_t, std::size_t, cuda::stream_ref) { return nullptr; }<br>  void deallocate_async(void*, std::size_t, std::size_t, cuda::stream_ref) {}<br>  bool operator==(const valid_resource&amp;) const { return true; }<br>  bool operator!=(const valid_resource&amp;) const { return false; }<br>};<br>static_assert(cuda::mr::async_resource&lt;valid_resource&gt;, &quot;&quot;);</pre><p>A library can easily decide whether the memory resource supports the async (stream-ordered) interface:</p><pre>template&lt;class MemoryResource&gt;<br>  requires cuda::mr::resource&lt;MemoryResource&gt;<br>void* maybe_allocate_async(MemoryResource&amp; resource, std::size_t size, std::size_t align, cuda::stream_ref stream) {<br>  if constexpr(cuda::mr::async_resource&lt;MemoryResource&gt;) {<br>    return resource.allocate_async(size, align, stream);<br>} else {<br>  return resource.allocate(size, align);<br>  }<br>}</pre><p>Note the function above uses the requires constraint from <a href="https://en.cppreference.com/w/cpp/language/constraints">C++20 concepts</a>, but it can be converted to work with earlier versions of C++ by using <a href="https://en.cppreference.com/w/cpp/language/sfinae">SFINAE</a> instead of concepts.</p><h3>RAPIDS on Databricks with Dask</h3><p>RAPIDS has a long history of accelerating workloads on Databricks and with 23.12 that integration expanded to include leveraging multi-node GPU clusters with Dask.</p><p>If you’re running Spark workloads on Databricks you can use the <a href="https://docs.nvidia.com/spark-rapids/user-guide/latest/getting-started/databricks.html">RAPIDS Accelerator for Spark</a> to speed up your existing workloads. But now with the new <a href="https://github.com/dask-contrib/dask-databricks">dask-databricks package</a> you can also launch a Dask cluster alongside Spark on the same Databricks infrastructure. This is extremely useful if you want to try out packages like <a href="https://developer.nvidia.com/blog/accelerating-xgboost-on-gpu-clusters-with-dask/">xgboost.dask on GPUs</a> but use infrastructure you are already familiar with.</p><p>Adding Dask to your cluster is as quick as adding an init script that starts the Dask components with the RAPIDS <a href="https://github.com/rapidsai/dask-cuda">dask-cuda</a> package.</p><pre># Start the Dask cluster with dask-cuda workers<br>dask databricks run - cuda<br>Then you can get a Dask client from your Databricks notebook.<br>import dask_databricks<br>client = dask_databricks.get_client()</pre><p>Check out the <a href="https://docs.rapids.ai/deployment/stable/platforms/databricks/#multi-node-dask-cluster">RAPIDS Deployment documentation</a> to learn more.</p><h3>Infrastructure and support updates</h3><p>RAPIDS 24.02 brought with it a number of changes to platforms and dependencies that RAPIDS supports. Specifically:</p><ul><li>RAPIDS 24.02 brought an end to support for Pascal GPUs (<a href="https://docs.rapids.ai/notices/rsn0034/">see more here</a>). Effective this release, use of a Pascal GPU will either fail or return invalid results.</li><li>RAPIDS also no longer publishes containers supporting CUDA 11.2 (<a href="https://docs.rapids.ai/notices/rsn0035/">see more here</a>). We continue to publish containers for CUDA 11.8 and 12.0. Users who wish to continue using CUDA 11.2 can do so via conda installation.</li><li>Starting with the RAPIDS 24.04 release, we are going to deprecate our containers for CentOS 7. These containers will no longer be published starting RAPIDS 24.06. <a href="https://docs.rapids.ai/notices/rsn0037/">See more here</a>.</li><li>Finally, RAPIDS will stop supporting Pandas 1.x effective with the 24.04 release (<a href="https://docs.rapids.ai/notices/rsn0036/">see more here</a>). Effective RAPIDS 24.04, only Pandas 2.x series will be supported.</li></ul><h3>NVIDIA GTC</h3><p>The in-person GTC experience is back this year! Come connect with a dream team of industry luminaries, developers, researchers, and business strategists helping shape what’s next in AI and accelerated computing.</p><p>Data science topics, including RAPIDS, will be heavily represented. Data science talks will include:</p><ul><li>RAPIDS in 2024: Accelerated Data Science Everywhere</li><li>XGBoost is All You Need</li><li>Accelerating Pandas with Zero Code Change using RAPIDS cuDF</li><li>Large-Scale Graph GNN Training Accelerated With cuGraph</li><li>And more!</li></ul><p>See the full list of <a href="https://www.nvidia.com/gtc/sessions/data-science/">data science topics here</a>. We hope to see you there!</p><h3>Conclusion</h3><p>We’re excited to get RAPIDS 24.02 out into the wild and to see what people build with it. We hope to see you at GTC!</p><p>To get started using RAPIDS, visit the <a href="https://rapids.ai/#quick-start">Quick Start Guide</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43ad88db0627" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/rapids-24-02-release-43ad88db0627">RAPIDS 24.02 release</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAPIDS 23.10 Release]]></title>
            <link>https://medium.com/rapids-ai/rapids-23-10-release-075aa5a50570?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/075aa5a50570</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[rapids-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Nick Becker]]></dc:creator>
            <pubDate>Thu, 16 Nov 2023 19:01:57 GMT</pubDate>
            <atom:updated>2023-11-17T02:14:03.774Z</atom:updated>
            <content:encoded><![CDATA[<h4>RAPIDS Goes CPU/GPU (zero code change!), XGBoost 2.0, Improved Vector Search, and more</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*THSB8EVHn5ri_QYm6Q_80A.png" /><figcaption><a href="https://www.youtube.com/watch?v=kmj1QOY71Ps">You can now GPU-accelerate pandas with zero code change using RAPIDS cuDF</a></figcaption></figure><p>The RAPIDS 23.10 release takes a huge step forward in breaking down barriers to bringing accelerated computing to the data science community. RAPIDS now enables a zero code change CPU/GPU user experience for dataframes, graph analytics, and machine learning. This release also introduces XGBoost 2.0 and makes substantial improvements to accelerated vector search and text processing for LLMs.</p><p><strong>Table of Contents</strong></p><ul><li><a href="#d02a">RAPIDS Goes CPU/GPU</a></li><li><a href="#0ebc">XGBoost 2.0</a></li><li><a href="#2166">Accelerated Vector Search and Text Processing</a></li></ul><h3>RAPIDS Goes CPU/GPU</h3><p>On November 8th, NVIDIA hosted the <a href="https://www.nvidia.com/en-us/events/ai-data-science-virtual-summit/">AI and Data Science Virtual Summit</a>, bringing together experts from across the community to discuss how accelerated computing is advancing data science.</p><p>At the Summit, we announced major enhancements to RAPIDS cuDF, cuGraph, and cuML that bring a unified, zero code change CPU/GPU experience to dataframe, graph analytics, and machine learning workflows. Below, we summarize these key enhancements. For those interested in learning more, we encourage you to register for free for the Summit to <a href="https://www.nvidia.com/en-us/events/ai-data-science-virtual-summit/">watch the session replays</a> and stay tuned for in-depth blogs in the future.</p><h4>cudf.pandas</h4><p>Pandas is the quintessential tool for data scientists today. With 9.5 million users, it’s the most popular library in Python for working with tabular data. But, it becomes slow as dataset sizes grow into the gigabytes.</p><p>At the Summit, we announced that cuDF’s new pandas accelerator mode (cudf.pandas) solves this problem, bringing the speed of cuDF to every pandas workflow with zero code change required. It works with most third-party libraries that operate on pandas objects and will accelerate pandas operations <strong>within</strong> these libraries, too. Just load cudf.pandas to accelerate your workflow on the GPU, with automatic CPU fallback if needed.</p><p>This new mode is available in the standard cuDF package. To accelerate IPython or Jupyter Notebooks, use the magic:</p><pre>%load_ext cudf.pandas<br>import pandas as pd<br>…</pre><p>To accelerate a Python script, use the Python module flag on the command line:</p><pre>python -m cudf.pandas script.py</pre><p>cudf.pandas is designed to accelerate workflows where pandas struggles with performance, so the 5 GB scale DuckDB/H2O.ai Database-like Ops Benchmark perfectly illustrates the impact of GPU-accelerating your pandas code. The benchmark requires executing a variety of common merge and groupby operations.</p><p>By just “flipping the switch”, we can turn minutes of processing into just one or two seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p05n6opi5IufBL6y" /><figcaption>Figure 1. Performance comparison between Traditional pandas v1.5 on Intel Xeon Platinum 8480CL CPU and pandas v1.5 with RAPIDS cuDF on NVIDIA Grace Hopper</figcaption></figure><p>You can learn more about this benchmark in the <a href="https://docs.rapids.ai/api/cudf/stable/cudf_pandas/benchmarks/">cuDF documentation</a>. And you can learn more about how cudf.pandas works at <a href="https://rapids.ai/cudf-pandas">rapids.ai/cudf-pandas</a> and <a href="https://nvda.ws/rapids-cudf">test-drive the introductory notebook</a> in a free GPU-enabled notebook environment on Google Colab.</p><h4>nx-cuGraph</h4><p>With more than 27 million downloads per month, NetworkX is the go-to library for graph analytics in Python thanks to its ease of use, wide selection of algorithms, and fantastic community.</p><p>But as datasets and graphs problem sizes grow, performance of NetworkX’s pure Python implementation becomes a significant hurdle, forcing users to stop using their favorite library or wait potentially hours for results. Over the past year, we’ve been collaborating with the NetworkX community to develop backend dispatching capabilities that can address these challenges.</p><p>We’re excited to share that cuGraph can now be used as a backend for NetworkX through our nx-cugraph package, enabling NetworkX users to GPU-accelerate their workflows with zero code change.</p><p>Just set an environment variable and your workflow will use cuGraph if it’s available and the algorithm is supported, falling back to standard CPU-based NetworkX otherwise.</p><pre>export NETWORKX_AUTOMATIC_BACKENDS=cugraph<br>python my_nx_app.py</pre><p>That’s it! Your NetworkX code will now use the GPU for all supported algorithms, enabling you to access up to 600x speedups when processing graphs like the US patent citation network dataset with 3.7 million nodes and 16.5 million edges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nW8rE7KJJ2WiWa88" /><figcaption>Figure 1. nx-cugraph on NVIDIA H100 vs. NetworkX on Intel Xeon Platinum 8480CL CPU.<br>Dataset: US Patent citation network 1975–1999 hosted by Stanford SNAP</figcaption></figure><p>nx-cugraph currently includes support for three algorithms and we aim to support 12 algorithms in the 23.12 release.</p><p>You can install nx-cugraph using either conda or pip:</p><pre>pip install nx-cugraph-cu11 — extra-index-url https://pypi.nvidia.com<br>conda install -c rapidsai -c conda-forge -c nvidia nx-cugraph</pre><p>To learn more about nx-cugraph and this benchmark, please visit this <a href="https://developer.nvidia.com/blog/accelerating-networkx-on-nvidia-gpus-for-high-performance-graph-analytics/">in-depth blog</a>.</p><h4>cuML CPU/GPU</h4><p>In this release, we’ve significantly expanded cuML’s CPU/GPU capabilities. The majority of cuML estimators now support both GPU-based and CPU-based execution capabilities with zero code change required to switch between them. A subset of estimators even support exporting models across hardware, enabling you to train and run inference on different hardware.</p><p>Now, you can prototype using cuML in your workflows even on systems without access to a GPU. When you’re ready, take the same code and run it on a GPU-enabled system to tap into the power of accelerated computing:</p><pre>import cuml # no change is needed even for the import!<br>from cuml.manifold.umap import UMAP<br><br>X, y = …<br><br># define the cuml UMAP model and use fit_transform function to obtain the<br># low dimensional representation of the input dataset<br>embeddings = UMAP(<br>  n_neighbors=10, min_dist=0.01, init=”random”<br>)<br><br>transformed_embeddings = embeddings.fit_transform(X)</pre><p>To get started prototyping with cuML on CPU-only machines, you can install via conda:</p><pre>conda install -c rapidsai -c nvidia -c conda-forge cuml-cpu=23.10</pre><p>To learn more about these capabilities, please visit the <a href="https://docs.rapids.ai/api/cuml/nightly/execution_device_interoperability/">cuML on GPU and CPU documentation</a>.</p><h3>XGBoost 2.0</h3><p>In partnership with the XGBoost community, we released XGBoost 2.0 in September! This is a huge milestone for the project and a testament to the incredible group of contributors and users driving the project forward over the past few years. Today, XGBoost is downloaded more than <a href="https://pypistats.org/packages/xgboost">2.5 million times per week</a> and is used across nearly every industry.</p><p>XGBoost 2.0 is <a href="https://github.com/dmlc/xgboost/releases/tag/v2.0.0">chock full of huge improvements</a> to both performance and user experience, but we’ll spotlight several below.</p><h4>Unified GPU interface with a single device parameter</h4><p>Using a GPU for different tasks within XGBoost tasks historically required setting a variety of different parameters like gpu_hist, tree_method, gpu_predictor, gpu_id, and more. Now, all of these capabilities are configurable with a single, simple device parameter that controls CPU or GPU execution.</p><h4>Quantile Regression</h4><p>XGBoost now supports quantile regression, a popular technique used for probabilistic forecasting scenarios in which you care about parts of the distribution beyond just the conditional mean. This may be particularly valuable for use cases in which outcomes in the tails of the distribution are particularly impactful or important, such as in supply chain forecasting.</p><p>The quantile loss (also known as pinball loss) is supported on both CPUs and GPUs.</p><h4>PySpark Interface</h4><p>The official XGBoost PySpark interface is now much more mature and ready for wider use! With support for GPU-based training and predictions, improved logging, performance optimizations, computing SHAP-based feature contributions, and more, we’re excited to see what the Apache Spark community creates!</p><p>To learn more, visit the <a href="https://xgboost.readthedocs.io/en/stable/python/index.html">XGBoost Python documentation</a>.</p><h3>Accelerated Vector Search and Text Processing</h3><h4>Accelerated Vector Search with RAFT</h4><p>23.10 brings substantial performance and functional enhancements to CAGRA, the GPU-accelerated graph-based approximate nearest neighbors technique with world class performance for large batch queries, single queries, and graph construction time.</p><h4>Pre-Filtering</h4><p>Pre-filtering allows removing irrelevant records before querying our vector database index to ensure we return high quality results. As <a href="https://www.pinecone.io/learn/vector-search-filtering/">the team at Pinecone noted</a>, “Pre-filtering is excellent for returning relevant results, but significantly slows-down our search…”</p><p>With support for pre-filtering now available, CAGRA can address these CPU-based performance challenges and enable returning high quality results.</p><h4>Nearest Neighbor Descent</h4><p>Building vector indexes is a computationally challenging problem well suited for GPUs and nearest neighbor descent is a state-of-the-art technique for iteratively constructing a k-nearest neighbors graph. Our graph-based CAGRA algorithm can also use nn-descent to improve the initial graph-construction performance over 10x compared to using IVF-PQ to construct the graph.</p><h4>Faster JSON parsing with cuDF and Dask</h4><p>Training large language models can require processing terabytes of text data, often representing essentially the entire internet! cuDF and Dask has emerged as a great combination to efficiently process the documents in these training pipelines.</p><p>In the 23.10 release, we’ve made algorithmic enhancements to the cuDF JSON reader that improve performance for reading the types of files common in large-language model training pipelines. In our benchmarks, we now observe end-to-end read throughput up to 70% of the theoretical limit with H100 GPUs reading from local NVME drives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/0*rBLukcoPSq0ncBEW" /></figure><p>If you’re using cuDF as part of your LLM training pipeline, you can expect to immediately see performance gains.</p><h3>Summary</h3><p>At the AI and Data Science Summit, we put forward a commitment to meeting data scientists where they are today. The RAPIDS 23.10 release is a major milestone in bringing accelerated computing into the day-to-day workflows of data scientists and engineers.</p><p>Pandas and NetworkX users can now GPU-accelerate their code with zero code change. cuML now provides a large suite of CPU/GPU capabilities. XGBoost 2.0 dramatically simplifies using GPUs. And we’re continuing to improve vector search and text processing to empower emerging technologies like LLMs.</p><p>To get started using RAPIDS, visit the <a href="https://rapids.ai/#quick-start">Quick Start Guide</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=075aa5a50570" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/rapids-23-10-release-075aa5a50570">RAPIDS 23.10 Release</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to Graph Analysis using cuGraph: Similarity Algorithms]]></title>
            <link>https://medium.com/rapids-ai/intro-to-graph-analysis-using-cugraph-similarity-algorithms-64fa923791ac?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/64fa923791ac</guid>
            <category><![CDATA[similarity]]></category>
            <category><![CDATA[rapids-ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[gpu-computing]]></category>
            <category><![CDATA[graph-analytics]]></category>
            <dc:creator><![CDATA[Don Acosta]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 23:20:14 GMT</pubDate>
            <atom:updated>2023-10-24T23:20:14.485Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="visualization of a graph with cuGraph name" src="https://cdn-images-1.medium.com/max/1024/1*6qrqa1NgAUF5XkjR85OizA.png" /><figcaption>RAPIDS cuGraph Logo</figcaption></figure><p>This is the second chapter in our blog series on GPU-accelerated <a href="https://medium.com/rapids-ai/tagged/graph-analytics">graph analysis</a> using RAPIDS cuGraph. In the first chapter, we introduced the basics of graphs and analyzed them using a few of the many algorithms in cuGraph. That blog answered some practical questions using a simple dataset and visually verified those results. In this blog, we look at a category of graph algorithms broadly called similarity. If you have not read the first blog, we encourage you to start with the <a href="https://medium.com/rapids-ai/introduction-to-graph-analysis-using-cugraph-a9dc2fbc3c5e">introduction chapter.</a></p><h3>Application</h3><p>Let’s start by answering the question of why and how similarity is important and dive into what type of application could use similarity. It needs to be noted that we are focused on <em>vertex</em> similarity and not graph similarity. Vertex similarity is a metric of how equivalent one vertex is to another vertex. The score is typically a percentage where 0.00 (0%) means no similarity and 1.0 (100%) means an exact match.</p><p>Graph similarity on the other hand is a measure of how close one graph (vertices and edges) matches another graph. This is also known as graph edit distance.</p><p><em>Note: Graph similarity is a topic for a future blog once we have graph similarity algorithms in cuGraph.</em></p><h4>Similarity algorithms give insight into:</h4><p><strong>Missing relationships</strong> — these algorithms are often called “link prediction”. Incomplete datasets lead to incorrect conclusions. Running similarity algorithms on a graph can reveal likely links that can be either corroborated through other means or used in follow-up calculations to test hypotheses.</p><p><strong>Predictions in dynamic data</strong> — adding or removing nodes or edges will change how a community behaves. By finding similar nodes, we can identify actors who might emerge or decline as the graph changes.</p><p><strong>Making recommendations</strong> — while <a href="https://www.nvidia.com/en-us/glossary/data-science/recommendation-system/">recommender systems</a> can become hugely complex, a simplified model could be to find users (vertices) with “similar” behavior and then recommend to User A those items that User B has that are different. Consider the bipartite graph in figure 1, where we are comparing User 1 (U1) to User 2 (U2). The system would then recommend product P3 to User 1.</p><figure><img alt="Depiction of a bi-partite graph showing users and products" src="https://cdn-images-1.medium.com/max/245/1*olev4b6tPrQhZR0zvjVJKw.png" /><figcaption>Figure 1: Bipartite graph in recommendation example</figcaption></figure><h3>Similarity Algorithms</h3><p>RAPIDS cuGraph implements several algorithms that have their origin in set comparisons from mathematics. When used for node similarity in a graph, these algorithms compare the sets of nodes, which generally comprise the neighbors where Set A = Neighbors(A).</p><p>cuGraph currently supports 3 similarity algorithms: <a href="https://github.com/rapidsai/cugraph/blob/main/docs/cugraph/source/graph_support/algorithms/jaccard_similarity.md">Jaccard</a>, <a href="https://github.com/rapidsai/cugraph/blob/main/docs/cugraph/source/graph_support/algorithms/overlap_similarity.md">Overlap</a>, and <a href="https://github.com/rapidsai/cugraph/blob/main/docs/cugraph/source/graph_support/algorithms/sorensen_coefficient.md">Sorensen </a>which we briefly compare in table 1 below. All three algorithms are normalized to values between zero and one. However, since they normalize on different terms, the exact values don’t equate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JSmWKEpLtLlIjUqY1UWDdA.png" /><figcaption>Table 1: Similarity algorithm summaries and complexities.</figcaption></figure><p><strong>Notes:</strong> |A| and |B| are the sizes of each set, see Figure 2 below for how this pertains to graph comparisons in a one hop example. Jaccard is marginally slower than the other two algorithms.</p><p>Consider this simple graph to illustrate the three similarity algorithms implemented in cuGraph. The calculations are all based on this graph:</p><figure><img alt="Simple graph highlighting the first hop neighborhood of two connected nodes." src="https://cdn-images-1.medium.com/max/795/1*8ysI3bltmGC2BRMbYCmJKw.png" /><figcaption>Figure 2: Simple graph to demonstrate similarity calculations.</figcaption></figure><h4>Jaccard Similarity</h4><p>The Jaccard similarity measure was developed by botanist Paul Jaccard who used the measure to compare plant species. His work popularized the measure’s use in in other fields as well. It sees great use in recommender systems particularly in collaborative filters which identify users with similar preferences.</p><figure><img alt="Jaccard formula size of the intersection of two node neighborhoods divided by the size of the union of them" src="https://cdn-images-1.medium.com/max/464/1*woFpAVQIFx5XX5m667o95Q.png" /><figcaption>Figure 3: Jaccard Similarity formula</figcaption></figure><p>Jaccard similarity always results in a value of zero to one. This set comparison algorithm is used in a variety of fields including:</p><ul><li>Plagiarism analysis</li><li>Social network analysis</li><li>Machine learning</li><li>Recommendation systems</li></ul><p>Using the graph in figure 2 above, the similarity between nodes 1 and 2 would be.</p><p>Size of |A ꓵ B| = 5</p><p>Size of |A ∪ B| = 8</p><p>Jaccard Similarity of (A, B) = 5/8 = 0.625</p><h4>Overlap Similarity</h4><p>This measure is also known as the Szymkiewicz-Simpson coefficient.</p><figure><img alt="Overlap coefficient formula, size of the intersection of the two neighborhoods divided by the size of the smaller one." src="https://cdn-images-1.medium.com/max/422/1*UvjKGTxWc0n7x6QRc1G-VQ.png" /><figcaption>Figure 4: Overlap Coefficient Formula</figcaption></figure><p>The main difference from Jaccard is that Overlap considers only the size of the smaller of the two compared sets.<br> Overlap finds frequent use in:</p><ul><li>Graphs with a larger degree distribution</li><li>Topic Modeling</li><li>Binary classification applications</li></ul><p>Again, calculating based on figure 2.</p><p>|A ꓵ B| = 5</p><p>min(|A|, |B|) = 6</p><p>Overlap Coefficient of (A, B) = 5/6 = 0.83</p><p>Figure 5 illustrates that as the size of set B (node 2’s community) grows, the Jaccard coefficient stays the same while the overlap coefficient changes. Therefore, Jaccard can miss community changes in dynamic datasets. This example comes from an excellent blog discussing the differences and advantages of <a href="https://developer.nvidia.com/blog/similarity-in-graphs-jaccard-versus-the-overlap-coefficient/">Jaccard versus Overlap</a>.</p><figure><img alt="Depiction of how Jaccard and overlap change as the neighborhood sizes vary" src="https://cdn-images-1.medium.com/max/598/1*63rakODgj6vB7rtwgdOAgQ.png" /><figcaption>Figure 5: Comparing Jaccard to Overlap as set sizes change.</figcaption></figure><h4>Sørensen-Dice Coefficient</h4><p>Like Jaccard, Sørensen considers both set sizes, however it doubles the intersection size and does not use the size of the union. While Sørensen results in a zero to one score like the other two algorithms, even small intersections skew to higher values.</p><p>While Sørensen is easily applied to graphs and neighbors, it is better known for use in semantic comparisons like:</p><ul><li>N-grams</li><li>Fingerprint segments</li><li>Genome distances</li></ul><figure><img alt="Sorensen formula two times the size of the neighborhood intersection divided by the sum of the sizes of the neighborhoods." src="https://cdn-images-1.medium.com/max/491/1*W57yZZxnpH0dJ1UfkKtIGg.png" /><figcaption>Figure 6: Sorenson-Dice Coefficient formula</figcaption></figure><p>Again, going through the calculation based on figure 2:</p><p>Size of |A ꓵ B| = 5</p><p>Sum of (|A|+ |B|) = 13</p><p>Sørensen Coefficient of (A, B) = 10/13 = 0.77</p><p>Unlike Overlap, the Sørensen value will be reduced by growth of either node’s neighborhood instead of just the smaller one.</p><h3>Calculating the similarities using RAPIDS cuGraph</h3><p>The following code sample shows how easy it is in cuGraph to compute the similarity scores.</p><pre>import cugraph<br>from cugraph.datasets import dining_prefs<br>gdf = dining_prefs.get_edgelist(download=True)<br>G = cugraph.from_cudf_edgelist(gdf, source=&#39;src&#39;,destination=&#39;dst&#39;)<br>jdf = cugraph.jaccard(G)<br>odf = cugraph.overlap(G)<br>sdf = cugraph.sorensen(G)<br>print(jdf.sort_values(by=&#39;jaccard_coeff&#39;, ascending=False).head())<br>print(odf.sort_values(by=&#39;overlap_coeff&#39;, ascending=False).head())<br>print(sdf.sort_values(by=&#39;sorensen_coeff&#39;, ascending=False).head())</pre><p>By default, running these algorithms uses every connected pair of nodes, which is referred to as 1-hop neighbors. While this gives a representative answer, it can produce more results than needed.</p><p>Doing the calculation on all adjacent pairs might be impossible due to the memory requirements of processing extremely large graphs. Additionally, considering adjacent nodes only, leaves out a valuable source of candidates, namely two-hop connections. In figure 2, nodes one and two are adjacent. However, their shared neighbors would be missed had the two not been directly connected as seen in figure 8. The highlighted two-hop relationships are often a great source of similarity between nodes not directly connected. Consider a communication graph where a person has two phones, they could share contacts, but the two numbers logically wouldn’t call each other. This is a common use of similarity to find an alias in a graph.</p><figure><img alt="Simple graph with overlapping neighborhoods but the nodes themselves are not connected." src="https://cdn-images-1.medium.com/max/588/1*l7iJRRL_0RodgyOw48YmoQ.png" /><figcaption>Figure 8: Importance of 2-hops</figcaption></figure><p>The cuGraph implementations of these algorithms allow for comparing 2-hop connections or any customized set of node pairs, by providing the second optional argument specifying the node pairs to examine. This is especially useful in graphs with two unconnected node types called bipartite graphs. A classic bipartite example is a sales graph containing customers and products with edges describing purchases. Code examples in figures 9 and 10 below, extract all node pairs within two hops of each other and look for similarities among those only.</p><figure><img alt="Jupyter notebook function from cuGraph that calls similarity algorithms with the node pair parameter supplied." src="https://cdn-images-1.medium.com/max/659/1*aw60owgEVu5kd85P_200Qg.png" /><figcaption>Figure 9: sample method to run similarity methods with a pair list using RAPIDS cuGraph.</figcaption></figure><p>The cuGraph get_two_hop_neighbors function returns all pairs within two hops of each other. An example of calling this on the dormitory data used later is shown in figure 10.</p><figure><img alt="Sample results from calling the cuGraph get_two_hop_neighbors method." src="https://cdn-images-1.medium.com/max/597/1*mcvblm0ogQBl7SpPrXG8ZQ.png" /><figcaption>Figure 10: Sample of two hop neighbors from the dormitory data set</figcaption></figure><figure><img alt="Jupyter notebook code in cuGraph that prints the results of calling similarity methods on the set of two-hop neighbors." src="https://cdn-images-1.medium.com/max/894/1*jIGvdOg0cPDJskhW27iY2g.png" /><figcaption>Figure 11: Extracting two-hop pairs from a cugraph and passing that into the caller function using RAPIDS cuGraph.</figcaption></figure><p>We will now use the familiar New York Dormitory dining preference data (from the <a href="https://medium.com/rapids-ai/introduction-to-graph-analysis-using-cugraph-a9dc2fbc3c5e">intro BLOG</a>) and will use similarity algorithms to answer several questions beyond their two favorite dining partners. Figure 12 highlights some of the similarity calculations from table 2 as they appear in the visualization graph visualization.</p><figure><img alt="NY Dormitory data visualized with similar residents highlighted" src="https://cdn-images-1.medium.com/max/1024/1*uQly-84pp7FaJX2sVbGthw.png" /><figcaption>Figure 12: Dormitory data highlighting similar groups</figcaption></figure><p>Using the RAPIDS cuGraph similarity notebook, we calculate the similarity of each pair with the highest values shown in the table below.</p><figure><img alt="Table showing the most similar pairs in the NY Dormitory data set with all three similarity scores" src="https://cdn-images-1.medium.com/max/675/1*Kd_GC_NaJ7_KBUfcYe0NMQ.png" /><figcaption>Table 2: Similarity calculations from NY Dormitory data set</figcaption></figure><p>In this small dataset, the rankings from all three algorithms are nearly identical as shown in table 2. This will not normally be the case, but it does allow a general demonstration of what similarity reveals here.</p><p>How do the results reflect what we can infer from the diagram above?</p><p><strong>Missing relationships </strong>— There are five residents in the graph who have transitive similarities (Louise -&gt; Lena -&gt; Marion -&gt; Frances -&gt; Adele) This cluster is revealed by similarity scores. It not as obvious in the graph since each resident is connection-limited by the sampling technique. The similarity series points to a possible hierarchy or clique. In a larger graph, a set of similar nodes often points to a cohesive community within the graph.</p><p><strong>Predictions in dynamic data </strong>— What happens if someone leaves the dorm? In this case, if Lena or Louise left the dorm, it is logical the other would inherit their preferences. In a larger graph, we could run the algorithms after manipulating the data to see if new similarities reveal changes in the groupings.</p><p><strong>Making recommendations</strong> — Frances and Lena are similar to Marion but are not connected to each other. If Marion were to leave the dorm, either could be recommended as a partner in her place. A larger graph with higher edge density would provide abundant alternatives to recommend.</p><h3>Wrap-up</h3><p>Similarity algorithms are simple to understand but immensely useful in fields as disparate as community detection, recommender systems, and Natural Language Processing (NLP). As shown, RAPIDS cuGraph enables running these in just a few lines of python code and yet leverages the parallelism of GPU-computing to scale over multiple GPU’s or even multiple nodes with multiple GPU’s.</p><p>The next blog in this series will focus on centrality functionality in cuGraph. It will explore various measures of node and edge importance focusing on why they are central to graph analytics. There will be more code examples to quickly run any of those measures on even the largest datasets.</p><h3>How to get started with cuGraph</h3><ul><li>Setup and installation instructions. <a href="https://docs.rapids.ai/install">https://docs.rapids.ai/install</a></li><li>Latest stable version of cuGraph docs — <a href="https://docs.rapids.ai/api/cugraph/stable/">https://docs.rapids.ai/api/cugraph/stable/</a></li><li>Using containers and Google Colab are the easiest paths to get started with cuGraph. <a href="https://hub.docker.com/r/rapidsai/notebooks">https://hub.docker.com/r/rapidsai/notebooks</a> — the available container to run cuGraph notebooks.</li></ul><h3>References:</h3><ul><li>The first blog in this graph analytics series: <a href="https://medium.com/rapids-ai/introduction-to-graph-analysis-using-cugraph-a9dc2fbc3c5e">https://medium.com/rapids-ai/introduction-to-graph-analysis-using-cugraph-a9dc2fbc3c5e</a></li><li>Calculations in this blog were done using this notebook: <a href="https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/similarity_combined.ipynb">https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/similarity_combined.ipynb</a></li><li>Earlier NVIDIA blog comparing Jaccard and Overlap: <a href="https://medium.com/p/610e083b877d">https://medium.com/p/610e083b877d</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64fa923791ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/intro-to-graph-analysis-using-cugraph-similarity-algorithms-64fa923791ac">Intro to Graph Analysis using cuGraph: Similarity Algorithms</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to Graph Neural Networks with cuGraph-DGL]]></title>
            <link>https://medium.com/rapids-ai/introduction-to-graph-neural-networks-with-cugraph-dgl-64c632e9cc52?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/64c632e9cc52</guid>
            <category><![CDATA[graph-data-structure]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[graph-neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alex Ravenel]]></dc:creator>
            <pubDate>Tue, 12 Sep 2023 15:30:51 GMT</pubDate>
            <atom:updated>2023-09-12T15:30:51.802Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using cuGraph-DGL to accelerate GNNs with GPUs</h4><p>Author: <a href="https://medium.com/u/93f37a34c189">Vibhu Jawa</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*33k0rFOAiI-coWAv" /></figure><p><a href="https://blogs.nvidia.com/blog/2022/10/24/what-are-graph-neural-networks/">Graph neural networks</a> (GNNs) have emerged as a powerful tool for a variety of <a href="https://www.nvidia.com/en-us/glossary/data-science/machine-learning/">machine learning</a> tasks on graph-structured data. These tasks range from node classification and link prediction to graph classification. They also cover a wide range of applications such as social network analysis, drug discovery in healthcare, fraud detection in financial services, and molecular chemistry.</p><p>In this post, I introduce how to use cuGraph-DGL, a GPU-accelerated library for graph computations. It extends Deep Graph Library (DGL), a popular framework for GNNs that enables large-scale applications.</p><h3>Basics of graph neural networks</h3><p>Before I dive into cuGraph-DGL, I want to establish some basics. GNNs are a special kind of neural network designed to work with data structured as graphs. Unlike traditional neural networks that assume independence between samples, which doesn’t fit well with graph data, GNNs effectively exploit the rich and complex interconnections within graph data.</p><p>In a nutshell, GNNs work by propagating and transforming node features across the graph structure in multiple steps, often referred to as layers (Figure 1). Each layer updates the features of each node based on its own features and the features of its neighbors.</p><figure><img alt="Diagram showing the initial graph on the left and the update graph on the right and illustrates how node features are respected by using information from its neighbors and graph structure" src="https://cdn-images-1.medium.com/max/1024/0*ssESEyBMIYtoSos6" /><figcaption>Figure 1. Schematic for the message passing layer (source: <a href="https://distill.pub/2021/gnn-intro/">Distill</a>)</figcaption></figure><p>In Figure 1, the first step “prepares” a message composed of information from an edge and its connected nodes and then “passes” the message to the node. This process enables the model to learn high-level representations of nodes, edges, and the graph as a whole, which can be used for various downstream tasks like node classification, link prediction, and graph classification.</p><p>Figure 2 shows how a 2-layer GNN is supposed to compute the output of node 5.</p><figure><img alt="GIF illustrates a two-layer GNN updating the seed node’s embeddings. First, immediate neighbors’ embeddings are refreshed using data from neighbors two hops away. Then, these updated embeddings are used to update the seed node’s representation" src="https://cdn-images-1.medium.com/max/1024/0*mqdytyrZEowxr_iC.gif" /><figcaption>Update of embeddings on a single node in a 2-Layer GNN (Image Source: <a href="https://docs.dgl.ai/tutorials/large/L0_neighbor_sampling_overview.html#sphx-glr-tutorials-large-l0-neighbor-sampling-overview-py">DGL Documentation</a>)</figcaption></figure><h3>Bottlenecks when handling large-scale graphs</h3><p>The bottleneck in GNN sampling and training is the lack of an existing implementation that can scale to handle billions or even trillions of edges, a scale often seen in real-world graph problems. For example, if you’re handling a graph with trillions of edges, you must be able to run DGL-based GNN workflows quickly.</p><p>One solution is to use RAPIDS, which already possesses the foundational elements capable of scaling to trillions of edges using GPUs.</p><h3>What is RAPIDS cuGraph?</h3><p><a href="https://docs.rapids.ai/api/cugraph/stable/">cuGraph</a> is a part of the RAPIDS AI ecosystem, an open-source suite of software libraries for executing end-to-end data science and analytics pipelines entirely on GPUs. The cuGraph library provides a simple, flexible, and powerful API for graph analytics, enabling you to perform computations on graph data at scale and speed.</p><h3>What is DGL?</h3><p><a href="https://www.dgl.ai/">Deep Graph Library (DGL)</a> is a Python library designed to simplify the implementation of graph neural networks (GNNs) by providing intuitive interfaces and high-performance computation.</p><p>DGL supports a broad array of graph operations and structures, enhancing the modeling of complex systems and relationships. It also integrates with popular deep learning frameworks like PyTorch and TensorFlow, fostering seamless development and deployment of GNNs.</p><h3>What is cuGraph-DGL?</h3><p>cuGraph-DGL is an extension of cuGraph that integrates with the Deep Graph Library (DGL) to leverage the power of GPUs to run DGL-based GNN workflows at unprecedented speed. This library is a collaborative effort between DGL developers and cuGraph developers.</p><p>In addition to cuGraph-DGL, cuGraph also provides the cugraph-ops library, which enables DGL users to get performance boosts using <a href="https://docs.dgl.ai/generated/dgl.nn.pytorch.conv.CuGraphSAGEConv.html#dgl.nn.pytorch.conv.CuGraphSAGEConv">CuGraphSAGEConv</a>, <a href="https://docs.dgl.ai/generated/dgl.nn.pytorch.conv.CuGraphGATConv.html#dgl.nn.pytorch.conv.CuGraphGATConv">CuGraphGATConv</a>, and <a href="https://docs.dgl.ai/generated/dgl.nn.pytorch.conv.CuGraphRelGraphConv.html#dgl.nn.pytorch.conv.CuGraphRelGraphConv">CuGraphRelGraphConv</a> in place of the default <a href="https://docs.dgl.ai/en/0.9.x/generated/dgl.nn.pytorch.conv.SAGEConv.html">SAGEConv</a>, <a href="https://docs.dgl.ai/generated/dgl.nn.pytorch.conv.GATConv.html">GATConv</a>, and <a href="https://docs.dgl.ai/generated/dgl.nn.pytorch.conv.RelGraphConv.html#dgl.nn.pytorch.conv.RelGraphConv">RelGraphConv</a> models. You can also import the SAGEConv, GATConv, and RelGraphConv models directly from the cugraph_dgl library.</p><p>In GNN sampling and training, the major challenge is the absence of an implementation that can manage real-world graph problems with billions or trillions of edges. To address this, use cuGraph-DGL, with its inherent capability to scale to trillions of edges using GPUs.</p><h3>Setting up cuGraph-DGL</h3><p>Before you dive into the code, make sure that you have cuGraph and DGL installed in your Python environment. To install the cuGraph-DGL-enabled environment, run the following command:</p><pre>conda install mamba -c conda-forge<br><br>mamba create -n cugraph_dgl_23_06 -c pytorch -c dglteam/label/cu118 -c rapidsai-nightly -c nvidia -c conda-forge dgl cugraph-dgl=23.10 pylibcugraphops=23.10 cudatoolkit=11.8 torchmetrics ogb</pre><h3>Implementing a GNN with cuGraph-DGL</h3><p>With your environment set up, put cuGraph-DGL into action and construct a simple GNN for node classification. Converting an existing DGL workflow to a cuGraph-DGL workflow has the following steps:</p><ol><li>Use cuGraph-ops models such as CuGraphSAGECon, in place of the native DGL model (SAGEConv).</li><li>Create a CuGraphGraph object from a DGL graph.</li><li>Use the cuGraph data loader in place of the native DGL Dataloader.</li></ol><p>Using cugraph-dgl on a 3.2 billion-edge graph, we observed a 3x speedup when using eight GPUs for sampling and training, compared to a single GPU UVA DGL setup. Additionally, we saw a 2x speedup when using eight GPUs for sampling and one GPU for training.</p><h3>Create a cuGraph-DGL graph</h3><p>To create a cugraph_dgl graph directly from a DGL graph, run the following code example.</p><pre>import dgl<br>import cugraph_dgl<br><br>dataset = dgl.data.CoraGraphDataset()<br>dgl_g = dataset[0]<br># Add self loops as cugraph<br># does not support isolated vertices yet<br>dgl_g = dgl.add_self_loop(dgl_g)<br>cugraph_g = cugraph_dgl.convert.cugraph_storage_from_heterograph(dgl_g, single_gpu=True)</pre><p>For more information about creating a cuGraph storage object, see <a href="https://docs.rapids.ai/api/cugraph/stable/api_docs/api/cugraph-dgl/cugraph_dgl.cugraph_storage.cugraphstorage/#cugraph_dgl.cugraph_storage.CuGraphStorage">CuGraphStorage</a>.</p><h3>Create a cuGraph-Ops-based model</h3><p>In this step, the only modification to make is the importation of cugraph_ops-based models. These models are drop-in replacements for upstream models like dgl.nn.SAGECon.</p><pre># Drop in replacement for dgl.nn.SAGEConv<br>from dgl.nn import CuGraphSAGEConv as SAGEConv<br><br>import torch.nn as nn<br>import torch.nn.functional as F<br><br>class SAGE(nn.Module):<br>    def __init__(self, in_size, hid_size, out_size):<br>        super().__init__()<br>        self.layers = nn.ModuleList()<br>        # three-layer GraphSAGE-mean<br>        self.layers.append(SAGEConv(in_size, hid_size, &quot;mean&quot;))<br>        self.layers.append(SAGEConv(hid_size, hid_size, &quot;mean&quot;))<br>        self.layers.append(SAGEConv(hid_size, out_size, &quot;mean&quot;))<br>        self.dropout = nn.Dropout(0.5)<br>        self.hid_size = hid_size<br>        self.out_size = out_size<br><br>    def forward(self, blocks, x):<br>        h = x<br>        for l_id, (layer, block) in enumerate(zip(self.layers, blocks)):<br>            h = layer(block, h)<br>            if l_id != len(self.layers) - 1:<br>                h = F.relu(h)<br>                h = self.dropout(h)<br>        return h<br><br><br># Create the model with given dimensions<br>feat_size = cugraph_g.ndata[&quot;feat&quot;][&quot;_N&quot;].shape[1]<br>model = SAGE(feat_size, 256, dataset.num_classes).to(&quot;cuda&quot;)</pre><h3>Train the model</h3><p>In this step, you opt to use cugraph_dgl.dataloading.NeighborSampler and cugraph_dgl.dataloading.DataLoader, replacing the conventional data loaders of upstream DGL.</p><pre># Drop in replacement for dgl.nn.SAGEConv<br>from dgl.nn import CuGraphSAGEConv as SAGEConv<br><br>import torch.nn as nn<br>import torch.nn.functional as F<br><br>class SAGE(nn.Module):<br>    def __init__(self, in_size, hid_size, out_size):<br>        super().__init__()<br>        self.layers = nn.ModuleList()<br>        # three-layer GraphSAGE-mean<br>        self.layers.append(SAGEConv(in_size, hid_size, &quot;mean&quot;))<br>        self.layers.append(SAGEConv(hid_size, hid_size, &quot;mean&quot;))<br>        self.layers.append(SAGEConv(hid_size, out_size, &quot;mean&quot;))<br>        self.dropout = nn.Dropout(0.5)<br>        self.hid_size = hid_size<br>        self.out_size = out_size<br><br>    def forward(self, blocks, x):<br>        h = x<br>        for l_id, (layer, block) in enumerate(zip(self.layers, blocks)):<br>            h = layer(block, h)<br>            if l_id != len(self.layers) - 1:<br>                h = F.relu(h)<br>                h = self.dropout(h)<br>        return h<br><br><br># Create the model with given dimensions<br>feat_size = cugraph_g.ndata[&quot;feat&quot;][&quot;_N&quot;].shape[1]<br>model = SAGE(feat_size, 256, dataset.num_classes).to(&quot;cuda&quot;)<br>                        num_workers=0,<br>                        sampling_output_dir=temp_dir_name)<br><br><br>      acc = evaluate(model, features, labels, dataloader)<br>      print(&quot;Epoch {:05d} | Acc {:.4f} | Loss {:.4f} &quot;.format(epoch, acc, total_loss))<br><br><br>def evaluate(model, features, labels, dataloader):<br>    with torch.no_grad():<br>        model.eval()<br>        ys = []<br>        y_hats = []<br>        for it, (in_nodes, out_nodes, blocks) in enumerate(dataloader):<br>            with torch.no_grad():<br>                x = features[in_nodes]<br>                ys.append(labels[out_nodes])<br>                y_hats.append(model(blocks, x))<br>        num_classes = y_hats[0].shape[1]<br>        return MF.accuracy(<br>            torch.cat(y_hats),<br>            torch.cat(ys),<br>            task=&quot;multiclass&quot;,<br>            num_classes=num_classes,<br>        )<br><br>train(cugraph_g, model)<br><br>Epoch 00000 | Acc 0.3401 | Loss 39.3890 <br>Epoch 00001 | Acc 0.7164 | Loss 27.8906 <br>Epoch 00002 | Acc 0.7888 | Loss 16.9441 <br>Epoch 00003 | Acc 0.8589 | Loss 12.5475 <br>Epoch 00004 | Acc 0.8863 | Loss 9.9894 <br>Epoch 00005 | Acc 0.8948 | Loss 9.0556 <br>Epoch 00006 | Acc 0.9029 | Loss 7.3637 <br>Epoch 00007 | Acc 0.9055 | Loss 7.2541 <br>Epoch 00008 | Acc 0.9132 | Loss 6.6912 <br>Epoch 00009 | Acc 0.9121 | Loss 7.0908</pre><h3>Conclusion</h3><p>By combining the power of GPU-accelerated graph computations with the flexibility of DGL, cuGraph-DGL emerges as an invaluable tool for anyone dealing with graph data.</p><p>This post has only scratched the surface of what you can do with cuGraph-DGL. I encourage you to explore further, experiment with different GNN architectures, and discover how cuGraph-DGL can accelerate your graph-based, machine-learning tasks.</p><p>For details on how to implement GNNs in the cuGraph-PyG ecosystem, please see our post “<a href="https://medium.com/rapids-ai/intro-to-graph-neural-networks-with-cugraph-pyg-6fe32c93a2d0">Intro to Graph Neural Networks with cuGraph-PyG</a>.”</p><p>For more graph analytics tutorials, see our <a href="https://medium.com/rapids-ai/tagged/graph-analytics">other graph analytics posts</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64c632e9cc52" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/introduction-to-graph-neural-networks-with-cugraph-dgl-64c632e9cc52">Intro to Graph Neural Networks with cuGraph-DGL</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAPIDS 23.08 Release]]></title>
            <link>https://medium.com/rapids-ai/rapids-23-08-release-23db51c255f0?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/23db51c255f0</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[spatial-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[rapids-ai]]></category>
            <dc:creator><![CDATA[Alex Ravenel]]></dc:creator>
            <pubDate>Wed, 23 Aug 2023 19:44:20 GMT</pubDate>
            <atom:updated>2023-08-23T19:58:30.595Z</atom:updated>
            <content:encoded><![CDATA[<h4>New features to GPU accelerate large-scale text processing, vector search, spatial analytics and much more!</h4><p>The RAPIDS 23.08 release was a big one, with new features to support large-scale text processing and LLMs in both cuDF and RAFT, major new functionality to cuXfilter and cuSpatial (and the new cuProj library for coordinate transforms), impressive performance numbers from cuGraph, and major changes to infrastructure and packaging (CUDA 12.0 conda packages, docker container changes). cuSignal is also being ported into CuPy (and will no longer be released as a standalone package) — we’ve seen how users frequently combine cuSignal and CuPy in workflows, and are excited to unify these tools.</p><p>Get started with the <a href="https://rapids.ai/#quick-start">quick start installation instructions for conda, pip, or docker</a> or read on to see more details on this month’s upgrades!</p><h3><strong>Table of Contents</strong></h3><ul><li><a href="#1bff">Docker Container Updates</a></li><li><a href="#29da">CUDA 12.0 and Conda packaging</a></li><li><a href="#f29d">RAPIDS XGBoost Package</a></li><li><a href="#1b49">cuDF — ETL and data processing</a></li><li><a href="#ef0f">RAFT and Vector Search</a></li><li><a href="#bb6f">cuProj: Blazing Fast Geographic Coordinate Transformations</a></li><li><a href="#9037">cuSpatial: Fast cartesian distance computation and binary predicate improvements</a></li><li><a href="#a79c">Cuxfilter — accelerated cross-filtering viz</a></li><li><a href="#206a">cuGraph — graph analytics &amp; GNNs</a></li><li><a href="#2589">KvikIO — Improved Zarr support &amp; high-speed IO</a></li><li><a href="#a3d3">cuSignal — porting to CuPy</a></li><li><a href="#34ed">Conclusion</a></li></ul><h3>Docker Container Updates</h3><p>We’ve completely revamped our Docker containers to simplify and improve the experience. A quick summary below, but please note <strong>there are some breaking changes</strong> so for a full rundown please see<a href="https://github.com/rapidsai/docker/issues/539"> this GitHub Issue describing the full impacts</a>.</p><ul><li>All containers are now multi-arch (supporting both ARM and x86–64) so there’s no need to specify architecture</li><li>To standardize installations, all containers (except for CUDA 11.2 containers) are based on Ubuntu 22.04. CUDA 11.2 is not supported in Ubuntu 22.04, and thus is still based on Ubuntu 20.04</li><li>There are now only Base and Notebooks containers</li><li>Images are now inheriting from nvidia/cuda’s base images, which contain only cuda-cudart &amp; cuda-compat (no other libraries, headers, etc.)</li><li>Everything else CUDA-related comes from Conda packages</li><li>All images start with a non-root user, which should improve general usability</li><li>Conda packages are installed in Conda’s base environment, which should simplify usage when activation is not an option</li><li><a href="https://hub.docker.com/r/rapidsai/base">The RAPIDS </a><a href="https://hub.docker.com/r/rapidsai/base">base image</a> (<a href="https://catalog.ngc.nvidia.com/orgs/nvidia/teams/rapidsai/containers/base">Alt</a>) starts in an ipython shell and includes what’s necessary to run RAPIDS</li><li><a href="https://hub.docker.com/r/rapidsai/notebooks">The RAPIDS </a><a href="https://hub.docker.com/r/rapidsai/notebooks">notebooks image</a> (<a href="https://catalog.ngc.nvidia.com/orgs/nvidia/teams/rapidsai/containers/notebooks">Alt</a>) includes RAPIDS notebooks and starts a JupyterLab server and adds our standard suite of Jupyter Notebooks to sample a taste of what RAPIDS has to offer</li></ul><h3>CUDA 12.0 and Conda packaging</h3><p>RAPIDS 23.08 adds support for CUDA 12.0 Conda packages! The team worked hard to create and merge <a href="https://github.com/conda-forge/staged-recipes/issues/21382">new CUDA packages on conda-forge</a> for CUDA 12.0 that allow for a much more flexible CUDA future. When building Conda packages using the new model, no libraries are pulled in outside of cuda-cudart unless explicitly specified in the requirements/host for CUDA 12. Also note that cuda-cudart is statically linked by default, if users want different behavior they need to add cuda-cudart-dev to requirements/host and possibly tweak the compiler flags accordingly. Currently conda-forge is in the process of <a href="https://conda-forge.org/status/#cuda120">migrating packages for CUDA 12</a> following <a href="https://github.com/conda-forge/conda-forge.github.io/issues/1963">this guidance</a>, which is generally useful. Here’s <a href="https://github.com/conda-forge/implicit-feedstock/pull/60">an example of these changes</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aDXg0PZLq5L0AbCA" /></figure><p>To enable this improvement, the cuda-version package will supersede cudatoolkit as the way to specify the CUDA version. Note that the cuda-version works for both prior CUDA versions (like 11.x) and newer ones (like CUDA 12.0). Given the restructuring of the CUDA Conda packages, the cudatoolkit will no longer exist in the new Conda packaging model (starting with CUDA 12.0). An example installation of RAPIDS, using cuda-version, is shown in the figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lW5LylbeQZVF-C30" /></figure><h3>RAPIDS XGBoost Package</h3><p>The RAPIDS 23.08 release also includes a revamped XGBoost package. This is now more in line with the conda-forge package (with many changes already upstreamed to conda-forge). The package is now maintained in <a href="https://github.com/rapidsai/xgboost-feedstock">this repo</a>.</p><h3>cuDF — ETL and data processing</h3><p>cuDF 23.08 brings new tools for accelerating LLM pipelines and processing document data at scale. The<a href="https://github.com/rapidsai/cudf/pull/13669">jaccard_index</a> function enables 6x faster runtimes and <a href="https://github.com/rapidsai/cudf/pull/13654">hash_character_ngrams</a> enables up to 5x larger batch sizes. These functions build on the &gt;40x speedups from <a href="https://github.com/rapidsai/cudf/pulls?q=12961+13333">minhash</a> (released in 23.06).</p><p>We also released <a href="https://github.com/rapidsai/cudf/pull/13348">Expression-based IO filtering</a> in libcudf for the Parquet reader. Now you can efficiently target your file reads to a subset of interest — this is critical for network-attached and cloud storage.</p><p>In this release we also implemented a number of order-of-magnitude optimizations for the existing APIs. The ORC writer now writes files with string columns up to 10x faster. The ORC reader also got a dramatic performance boost — more than 20x faster runtimes when reading list columns with high row counts. Unbounded window functions are now 10–15x faster.</p><p>Finally we are introducing the pylibcudf <a href="https://github.com/rapidsai/cudf/pull/13562">subpackage</a> and <a href="https://github.com/rapidsai/cudf/pull/13639">developer guide</a>. pylibcudf is a lightweight Cython wrapper for direct and efficient libcudf usage, designed to be the new core of cuDF-python as well as performance-critical feature engineering.</p><h3>RAFT and Vector Search</h3><figure><img alt="A diagram showing how CAGRA can map subgraphs of its index to separate thread blocks, enabling parallelism even for a single query." src="https://cdn-images-1.medium.com/max/966/0*lWQqMrCDKWYrdBuy" /><figcaption><em>CAGRA is using multiple thread blocks to visit more graph nodes in parallel. This is maximizing GPU utilization for every single-query search.</em></figcaption></figure><p>RAFT has added a new index to its vector search toolbelt, as the novel state-of-the-art graph-based approximate nearest neighbors algorithm, CAGRA, has been promoted from experimental status and is now ready to accelerate your vector similarity search applications. CAGRA demonstrates superior performance to other GPU-accelerated indexes when given large numbers of queries at a time but it has been purpose-built to increase GPU utilization even when searching for only a single vector at a time. CAGRA’s graph-based index is a low-latency and high-throughput alternative to both SCaNN and HNSW, which are the current state-of-the-art on the CPU.</p><figure><img alt="Bar chart comparing throughput performance (queries per second) for RAFT’s GPU algorithms against HNSW on the CPU." src="https://cdn-images-1.medium.com/max/1024/0*J4mR9D6fN7eQCsSz" /><figcaption><em>Vector search throughput at 95% recall on DEEP-100M dataset, batch size of 10.</em></figcaption></figure><p>In addition to faster search, CAGRA also reduces the amount of time spent building indexes. Version 23.08 of RAFT cuts index building time nearly in half compared to HNSW and this will be improved even further in upcoming releases.</p><p>CAGRA comes with both a <a href="https://docs.rapids.ai/api/raft/stable/cpp_api/neighbors_cagra/">C++ API</a> and lightweight <a href="https://docs.rapids.ai/api/raft/stable/cpp_api/neighbors_cagra/">Python API</a> and will soon be available in Milvus and Redis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WO7VXw26Bpipksvm" /></figure><h3>cuProj: Blazing Fast Geographic Coordinate Transformations</h3><p>The cuSpatial 23.08 introduces a new subproject called <a href="https://github.com/rapidsai/cuspatial/blob/branch-23.08/python/cuproj/README.md">cuProj</a>. cuProj is a library and Python package for accelerated geographic and geodetic coordinate transformations. cuProj can transform billions of geospatial coordinates per second from one coordinate reference system (CRS) to another on GPUs.</p><p>cuProj provides a Python API that closely matches the<a href="https://pyproj4.github.io/pyproj/stable/"> popular PyProj</a> API, and a header-only C++ API<a href="https://proj.org/"> designed to implement many of the same transformations provided by the widely used Proj</a>. Currently cuProj supports a subset of the Proj transformations and projections, specifically conversion of WGS84 (latitude/longitude as used by GPS) to and from the Universal Transverse Mercator (UTM) standard. Conda and Pip packages for cuProj are now available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*5IKmhYZ9LEx-sZ7g" /><figcaption><em>Comparison of throughput of cuProj to PyProj for WGS84 to UTM projection. Note the log vertical scale. The benchmarks were run on an NVIDIA DGX H100. PyProj used one Xeon Platinum 8480C CPU core (PyProj is single-threaded). cuProj used one NVIDIA H100 GPU (80GB).</em></figcaption></figure><p>The chart in Figure 1 shows performance of cuProj compared to PyProj in a benchmark similar of WGS84 to UTM projection. cuProj running on an <a href="https://www.nvidia.com/en-au/data-center/dgx-h100/">NVIDIA H100</a> GPU achieves a peak speedup of over 4100x vs. PyProj running on an Intel Xeon Platinum 8480C CPU. For perspective, cuProj can transform 1 billion points in about 30ms: interactive rates. PyProj takes nearly 2 minutes to do the same.</p><h3>cuSpatial: Fast cartesian distance computation and binary predicate improvements</h3><p>Aside from cuProj, multiple improvements went into cuSpatial 23.08. The GeoSeries.distance API has been added to compute the Cartesian distances between two GeoSeries on the GPU. Depending on the input GeoSeries type, this API supports any combinations of GeoSeries between Points, MultiPoint, Multilinestring and Multipolygon geoseries. It provides a GeoPandas-like interface (including the align argument). Given 10 million pairs of 20-segment linestrings and 38-sided polygons, cuSpatial achieves a 66x speedup compared to GeoPandas in computing the linestring-polygon distance.</p><p>Multiple bug fixes have gone into 23.08 to increase the stability and correctness of the .contains API. When a linestring shares a boundary point with a polygon, while none of its endpoints are in the polygon, it is now computed as “not contained” to match GeoPandas. In addition, multi*_range classes now have 100% test coverage of public APIs. As an abstraction to geometry objects shared across many vectorized ops, increased test coverage increases API stability. For more information about the .distance API benchmark, binary predicate improvements and test coverage, look for an upcoming cuSpatial 23.08 blog post soon.</p><h3>Cuxfilter — accelerated cross-filtering viz</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rr4z7anPqPdzsGjb" /></figure><p>Cuxfilter development didn’t take a break this summer, adding several major features and UX updates. For this release, cuxfilter now supports CUDA 12 and is available through pip! Using pip will facilitate faster and simpler installation, especially on cloud services like Colab and Studio Lab. Keen observers will also note a more polished and integrated UI, thanks in part to better holoviews and bokeh 3.0 integration. This allows for better widget tools, easier theme switching, and more robust drag-and-drop layouts.</p><p>Speed and string support improvements in cuDF resulted in us removing our long-running precomputed datatile feature. We also removed the bokeh line chart, since the datashader version is better suited for our needs. As a result, we are now able to implement string columns without mapping and our favorite new feature: ghosted linked brushing. See below for an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V4LVDCSAge6yEd6a" /></figure><p>Using d.app() will now show much better laid out dashboards inline within a notebook. Dashboard and individual chart heights can now be directly set. As such, we decided to remove the somewhat confusing d.preview() static preview functionality.</p><p>Finally, we cleaned up our documentation and are working on an advanced cuxfilter features guide notebook. And in case you missed it, we just released an extensive <a href="https://github.com/rapidsai/cuxfilter/tree/branch-23.10/notebooks/RAPIDS%20Visualization%20Guide">visualization user guide notebook</a>, spanning, hvplot, datashader, plotly dash, cuDF cuGraph, cuML, cuSpatial, AND cuxfilter. It’s a good one.</p><p>You can try all the new cuxfilter features out in <a href="https://github.com/rapidsai/cuxfilter/tree/branch-23.10#usage">Colab and Studio Lab</a> right now.</p><h3>cuGraph — graph analytics &amp; GNNs</h3><p>One of the cuGraph goals is to ensure that all our algorithms scale, we are happy to announce that the Edge Betweenness Centrality algorithm now supports scaling from a single GPU to multiple GPUs and even multiple GPUs across multiple nodes (what we call MNMG).</p><p>Supporting Graph Neural Networks continues to be a big push for cuGraph. This release we made major improvements to the bulk sampling function and added the ability to do MFG (message flow graph) creation as part of sampling. We tested on multiple graphs that are multiples of the OGB paper100M dataset:</p><p>3 billion edges (ogb_paper100M x 2) with a batch size of 512:</p><ul><li>Old bulk sampler + post MFG creation: 77.283 seconds</li><li>New sampler with MFG: 32.39 seconds</li></ul><p>6 billion edges (ogb_paper100M x4) and batch size of 512</p><ul><li>Old bulk sampler + post MFG creation: 151.89 seconds</li><li>New sampler with MFG: 77.33 seconds</li></ul><p>Increasing the batch size further improved performance. On 6 billion edges with a batch size of 16,384 the sampling with MFG time drops to only 11.45 seconds.</p><p>Release 23.08 also has cuGraph support for CUDA 12, except the cugraph-dgl and cugraph-pyg packages which will be CUDA 12 in release 23.10 due to a dependency on PyTorch which will have CUDA 12 in September. The WholeGraph package has also been refactored and is now available via conda and pip.</p><h3>KvikIO — Improved Zarr support &amp; high-speed IO</h3><p>The focus of this release is Zarr compatibility and support of on-the-fly compression/decompression when reading or writing Zarr files. It is now possible to use nvCOMP’s batch API when accessing Zarr files, which allows multiple buffers to be compressed/decompressed together. A demo can be found in this <a href="https://github.com/rapidsai/kvikio/blob/branch-23.10/notebooks/zarr.ipynb">notebook</a>.</p><p>Additionally, Dask-CUDA has switched from using cuCIM to KvikIO for handling GDS-based spilling, and has been updated to leverage vectored IO, which hands off all reads/writes to system calls in the CPU case or KvikIO in the GPU case.</p><h3>cuSignal — porting to CuPy</h3><p>The cuSignal project is in the process of porting to CuPy and will be deprecated and archived in RAPIDS. The 23.08 release is the last formal release of cuSignal. More details can be found in <a href="https://docs.rapids.ai/notices/rsn0032/">RSN 32</a>. We’ve seen how users frequently combine cuSignal and CuPy in workflows, and we’re excited to unify these tools to improve the user experience.</p><p>The cuSignal team thanks RAPIDS users for the years of support and is looking forward to its future as a core CuPy module.</p><h3>Conclusion</h3><p>We’re proud of what we’ve been able to achieve in RAPIDS 23.08, and can’t wait to share with you what is coming for RAPIDS 23.10+! We’d like to extend our thanks to our contributors and users, and hope that you will give RAPIDS 23.08 a try:</p><ul><li><a href="https://rapids.ai/#quick-start">Quick Start Guide</a></li><li><a href="https://docs.rapids.ai/install">Full Install Guide</a></li><li><a href="https://docs.rapids.ai/api">Documentation</a>, including complete release changelogs</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23db51c255f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/rapids-23-08-release-23db51c255f0">RAPIDS 23.08 Release</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Graph Analysis using cuGraph]]></title>
            <link>https://medium.com/rapids-ai/introduction-to-graph-analysis-using-cugraph-a9dc2fbc3c5e?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/a9dc2fbc3c5e</guid>
            <category><![CDATA[graph-analytics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[rapids-ai]]></category>
            <dc:creator><![CDATA[Don Acosta]]></dc:creator>
            <pubDate>Tue, 11 Jul 2023 18:22:11 GMT</pubDate>
            <atom:updated>2023-07-11T18:22:10.984Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="cuGraph Logo" src="https://cdn-images-1.medium.com/max/1024/1*6qrqa1NgAUF5XkjR85OizA.png" /></figure><h3><strong>What is Graph Analysis?</strong></h3><p>When analyzing data, sometimes the relationships between the data elements are important along with the scope of the question being asked. In those cases, it is better to represent the data as a graph and apply graph analytics.</p><p>An example coming out of the COVID pandemic is that everyone became aware of the concept of contact tracing. That process involves collecting information about who someone was in contact with and who those folks were in contact with. Basically, building a social network where the nodes represent people and edges represent contact. This is a case where the relationship, who contacts whom, is the focus of the analysis more than the characteristics of the person in question. Graph analysis is the application of graph techniques and algorithms to answer questions related to the relationship between data objects.</p><p>This blog represents a brief introduction to graph analysis and is the kickoff to a series of blogs covering graph analysis using <a href="https://docs.rapids.ai/api/cugraph/stable/">cuGraph</a>. Later blogs will cover cuGraph in depth, with code, scale, and performance details.</p><p>The series will cover topics such as:</p><ul><li>Node Similarity</li><li>Node and Edge Centrality</li><li>Path Finding</li><li>Community detection</li><li>Sampling</li><li>Graphs and types of graphs</li><li>… and many more</li></ul><h4><strong>Why should I care, and what questions can graphs answer?</strong></h4><p>A full discussion of graph analytics can easily morph into a complete book, see the great work by Stanley Wasserman and Katherine Faust for example, or a PhD level paper on a graph algorithm or performance. However, it is enlightening to first look at the questions graph analytics can solve and ignore the details of how algorithms work.</p><p>Graph algorithms help answer questions as diverse as:</p><ul><li>How are diseases spread in a community?</li><li>How do international trade routes develop?</li><li>What are the most important papers in a citation list?</li><li>Which members are redundant or indispensable in an organization?</li><li>Based on information flow, how might a department function if specific people(s) leave?</li><li>How to get from point A to point B with the least cost — the classic traveling salesman problem</li></ul><h4><strong>Basics of a graph</strong></h4><p>The next blog will dive into this in greater detail, but for now here are a few key graph parts:</p><ul><li>Nodes are actors in the data, also called vertices in graph theory.</li><li>Edges indicate the interactions between nodes, also called links.</li><li>Attributes are characteristics of nodes and edges, sometimes called features or properties.</li></ul><p>Let us consider the following very simple graph that consists of two nodes, A and B, and a single edge that has a weight attribute of 3.</p><figure><img alt="Simple Graph Example of two nodes with a relationship between them containing a weight of 3" src="https://cdn-images-1.medium.com/max/153/1*fIirBOGxNi9PShg6zb8Hsw.png" /><figcaption>Figure 1: simple graph example</figcaption></figure><h4><strong>Introduction to RAPIDS cuGraph in 3 simple steps</strong></h4><p>RAPIDS cuGraph is part of NVIDIA’s suite of accelerated data science libraries that aims to accelerate most aspects of Data Science via GPU’s. RAPIDS cuGraph focuses on providing acceleration to graph algorithms and workflows. You do not need to be a Data Scientist or a GPU expert to benefit quickly from cuGraph. The easiest platform to use cuGraph is a Linux computer with an NVIDIA GPU (Pascal or later generation). RAPIDS cuGraph provides an intuitive and easy to use Python interface as well as a collection of Jupyter notebook examples.</p><p>Only three steps are needed to use cuGraph: (1) Load the graph data; (2) Create a Graph; and (3) Call an algorithm.</p><figure><img alt="Jupyter notebook example of running PageRank algorithm with cuGraph" src="https://cdn-images-1.medium.com/max/958/1*2fpsZq4z-kTBb52Dqw6amA.png" /><figcaption>Figure 2: Jupyter notebook based example of using cuGraph</figcaption></figure><p>Okay, really four steps since the packages must be imported.</p><h3><strong>Let’s dive into a problem</strong></h3><p>Given a social dataset, the question we want to ask, and understand, is: <em>who is the most popular and least popular person?</em></p><p>Consider a simple dataset which comes from work by JL Moreno in the 1940s looking at the dining-table partners in a dormitory at a New York State Training School. He collected data by asking all twenty-six girls in a dormitory their first and second choice of dining partners. The raw data structure is very simple. Each resident’s answer is a row in a comma-separated file. The ‘source’ is the actor answering the question, the ‘target’ is the actor they would like to dine with, and the weight is either a 1 for first choice or a 2 for second choice. From the sample data shown below, you can see that Ada would prefer to sit with Cora as her 1st choice and with Louise as her 2nd option. In the top left corner of figure 1 below , we can see edges from Ada to Cora and Louise with the corresponding edge attributes.</p><figure><img alt="Example of rows in dorm preference data set" src="https://cdn-images-1.medium.com/max/201/1*s7HtrLPrr18717zAhDqhuQ.png" /><figcaption>Figure 3: Sample data rows</figcaption></figure><figure><img alt="Visualization of complete dining partner preference dataset" src="https://cdn-images-1.medium.com/max/965/1*ufvZxOsPWTVTZnc7Ewxhkg.png" /><figcaption>Figure 4: New York State Training School dormitory</figcaption></figure><p>For determining who is the most important, we are going to look at five different centrality measurements:</p><figure><img alt="Table of centrality measures with their definitions and uses" src="https://cdn-images-1.medium.com/max/947/1*2_Z3WdsmX1M8nOAvz14DAw.png" /><figcaption>Centrality Measures and Uses</figcaption></figure><p>In figure 4 above it is visually apparent that Eva, Marion, and Edna are the most popular dining partners. We can discern this by counting the number of edges pointing to them. It is not a surprise that the graph calculations in figure 5 below, validate our observations. In a larger dataset, visualization is more difficult or impossible.</p><figure><img alt="Results of highest centrality calculations for dining preference data set" src="https://cdn-images-1.medium.com/max/712/1*aCxgbuAnXyaJk2vExUVvcA.png" /><figcaption>Figure 5: Sorted Results calculated by running cuGraph’s centrality notebook</figcaption></figure><p>As expected, both Eva and Marion topped all the measures here. The next question to ask is: <em>How do their roles differ?</em></p><p>Betweenness and PageRank scores suggest that Eva is most important to lines of communication and social structure of the dormitory. Eigenvector and Katz scores indicate Marion wields the most influence over both the popular students and the entire population.</p><p>Conversely, the lowest scorers in these measures are also of interest.</p><p>Many residents have low connectedness as shown by the in-degree distribution chart, Figure 6 below. A total of 10 out of the 26 students were only chosen as a preferred partner once or not at all. The pool of potentially isolated residents is over one third of the population.</p><figure><img alt="Histogram illustrating the distribution of residents chosen as preferred dining partners" src="https://cdn-images-1.medium.com/max/469/1*aEnfajMdm4egYFdvBRdF5w.png" /><figcaption>Figure 6: In-Degree Histogram</figcaption></figure><p>Let us sort the graph algorithm results, Figure 7 below, in ascending order (smallest at top) so that we can evaluate least popular actors.</p><figure><img alt="Results of actors with the lowest centrality calculations in the dining preference data set" src="https://cdn-images-1.medium.com/max/711/1*0lHlMlMjEWIcrhZR_CUIww.png" /><figcaption>Figure 7: Results calculated by running cuGraph’s centrality notebook and sorting by lowest popularity</figcaption></figure><p>Note: due to the small dataset size, degree centrality does not completely correlate to lowest degree.</p><p>We can ask a range of additional question beyond just popularity, like:</p><ul><li><strong>Who in the dorm is the most isolated?</strong><br>- From the data, many students share the lowest degree centrality identifying Alice, Laura, Ella, and Cora as being among the most isolated,</li><li><strong>Who is vulnerable to bullying?</strong><br>- Those like Betty and Ruth who had the lowest PageRank and Eigenvector centrality scores lack influence and connections to approach others if they are bullied.</li><li><strong>Who would be at risk if the population changes?</strong><br>- Those with low degree to others with low degree like Ada and Cora could suddenly become very isolated if either one left the dorm.</li><li><strong>Whose voices are underrepresented in the group?<br></strong>- Laura has minimum links to only highly connected students. She seems to have no peer group and could be a bystander to the mutually connected groups. Her degree centrality is minimum but scores in the middle of connectedness measures.</li></ul><p>While the questions above are answered by observing these measures, further analysis of this dataset could address answer questions like:</p><ul><li>Whose removal would most disrupt the social structure in the dorm?</li><li>Who brokers social status within the dorm?</li><li>Who would ascend in prominence if a particular person left the dorm?</li></ul><h3><strong>What happens when the data set gets larger?</strong></h3><p>Let us look at a larger dataset, one that contains over 40 thousand edges, and is illustrated in figure 6 below. At that scale it starts becoming nearly impossible to visually discern the characteristics of individual nodes. Imagine what a graph with over a million edges would look like.</p><p>The figure depicts an email communication network from the 1990’s infamous Enron corporate scandal. For our analysis, we will duplicate the same measurements from the above simple set. However, we must rely on some additional external enrichment data to see if the answers make sense.</p><figure><img alt="visualization of Enron email communication graph" src="https://cdn-images-1.medium.com/max/473/1*xMv3sswJiAMbok8aBWQcVw.png" /><figcaption>Figure 6: Visualization of Enron email contacts<br> Image: Peter Prevos, Lucid Manager, May 3, 2023, lucidmanager.org/data-science/analyse-enron-corpus</figcaption></figure><p>This dataset contains email metadata publicized during the Enron scandal trial.</p><p>Analysis of email traffic (a type of graph analysis) helped convict many of the conspirators by establishing hidden relationships, determining key actors, and isolating small groups within the full email corpus.</p><ul><li>The scandal was widely impactful:<br>- led to the bankruptcy of Enron in 2001<br>- Resulted in billions of dollars in lawsuits including a $40 billion suit from shareholders.<br>- Arthur Anderson, a top five accounting firm, was dissolved.<br>- The Sarbanes-Oxley Act, among other reforms, was passed to regulate financial record keeping.<br>- Several Enron officers were sentenced to prison terms</li><li>The data contains 40777 unique email connections (the edges) between 6187 different email addresses (the nodes).</li><li>Weights containing the number of emails between addresses are included in each connection data but are not used in this analysis. (Later blogs will use the weights)</li></ul><figure><img alt="Table of Nodes (vertices) with highest centrality measures in the Enron email data" src="https://cdn-images-1.medium.com/max/624/1*Kp_x0O1Um5RnlPUWm22flQ.png" /><figcaption>Figure 6: Sorted Results of Centrality Algorithms for Enron data calculated by running cuGraph’s centrality notebook</figcaption></figure><p>Note: Katz Centrality has been omitted from these calculations since it does not properly converge. More on that in a later blog.</p><figure><img alt="Highest centrality addresses in Enron email data with owner roles" src="https://cdn-images-1.medium.com/max/936/1*6tPWU7oJNTm309b4s0_y7g.png" /><figcaption>Figure 7: Important Enron vertices with addresses and roles</figcaption></figure><p>Within a matter of seconds (depending on your GPUs), cuGraph can identify important actors in this graph and give clues to their role in the community it represents. In this example…</p><ul><li>Tana.jones@enron.com is connected to the most actors in the graph.</li><li>Jeff.dasovich@enron.com has the highest Betweenness and PageRank. That email is the most influential in the core network and the most important to the graph’s structure. It facilitates the shortest paths between other nodes in the graph.</li><li>Pete.davis@enron.com has the highest eigenvector centrality. That node had the most influence over the entirety of the graph rather than just the other important nodes.</li></ul><h3><strong>What makes cuGraph special?</strong></h3><p>There are many platforms and tools to do graph analytics but cuGraph has a variety of significant benefits:</p><ul><li>There are no licensing fees needed to use cuGraph.</li><li>RAPIDS cuGraph integrates with widely used open-source packages like DASK, PyTorch and scikit-learn with more on the way.</li><li>It is part of the RAPIDS open-source GPU accelerated ecosystem allowing start to finish GPU acceleration.</li><li>Abundant Support in the RAPIDS community and from NVIDIA via GitHub.</li><li>It is easy to set up. This article is not focused on setup/installation, but links below contain instructions for running in several environments.</li><li>Scalability and performance are peerless.<br>- A single 32GB GPU can process graphs of up to 250 million edges.<br>- <em>NVIDIA</em> engineers have scale tested cuGraph on multi-node, multi-GPU systems on graphs of over one trillion edges.</li><li>User-friendly interface: There is a Python API similar to NetworkX, and for integrators there are both C and C++ APIs.</li><li>RAPIDS cuGraph is available in Amazon AWS, Google CoLab, and Paperspace.</li></ul><h4><strong>How to get started with cuGraph.</strong></h4><ul><li>Setup and installation instructions. <a href="https://docs.rapids.ai/install">https://docs.rapids.ai/install</a></li><li>Latest stable version of cuGraph docs — <a href="https://docs.rapids.ai/api/cugraph/stable/">https://docs.rapids.ai/api/cugraph/stable/</a></li><li>The base notebook used to do these calculations <a href="https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb">https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb</a></li><li>Using containers and Google Colab are the easiest paths to get started with cuGraph.<br><a href="https://hub.docker.com/r/rapidsai/rapidsai/">https://hub.docker.com/r/rapidsai/rapidsai/</a> contains the available containers to run cugraph <br><a href="https://colab.research.google.com/drive/1cb40U3gdXZ7ASQsWZypzBFrrFOKpvnbB?usp=drive_open">https://colab.research.google.com/drive/1cb40U3gdXZ7ASQsWZypzBFrrFOKpvnbB?usp=drive_open</a> presents a tutorial for using cuGraph in in Google Colab</li></ul><h4><strong>Where to find more cuGraph information.</strong></h4><p>RAPIDS cuGraph provides a full suite of documentation and examples including:</p><ul><li>Past blogs, presentations and white papers related to cuGraph here:<a href="https://docs.rapids.ai/api/cugraph/nightly/tutorials/cugraph_blogs/">https://docs.rapids.ai/api/cugraph/nightly/tutorials/cugraph_blogs/</a></li><li>The full RAPIDS documentation collection: <a href="https://docs.rapids.ai/">https://docs.rapids.ai/</a></li><li>Thoroughly tested and maintained cuGraph Jupyter notebooks: <a href="https://github.com/rapidsai/cugraph/tree/main/notebooks">https://github.com/rapidsai/cugraph/tree/main/notebooks</a><br>- The centrality notebook used for the calculations presented here: <a href="https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb">https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb</a><br>- Notebooks containing examples of each supported algorithm.<br>- Some include DASK integration scaling to multiple GPUs.<br>- All are updated with the latest cuGraph additions and fixes.<br>- Demonstrate cuGraph algorithm visualization, integration, and benchmarking.</li></ul><h4><strong>In conclusion</strong></h4><p>As mentioned in the introduction, this is the first in a series of blogs covering graph analysis using cuGraph. The next blog will explore the concept of similarity, followed by blogs on centrality, transversal and other classes of graph algorithms. The series will also dive into the notion of graph ETL, and the steps needed to process the data before creating a graph. Lastly, the series will include new relevant topics and requests accepted into the cuGraph GitHub issues list at <a href="https://github.com/rapidsai/cugraph/issues">https://github.com/rapidsai/cugraph/issues</a>.</p><h4><strong>Additional References:</strong></h4><p>For additional read on the New York State Training S study by JL Moreno, his book “Who Shall Survive” is online at: <a href="https://archive.org/details/whoshallsurviven00jlmo/mode/2up">https://archive.org/details/whoshallsurviven00jlmo/mode/2up</a></p><p>“<em>Social Network Analysis: Methods and Applications</em>” by Stanley Wasserman and Katherine Faust is a wonderful book.</p><p>Lastly, “<em>Disrupting Dark Networks</em>” by Sean Everton is an informative read on the application of network analysis.</p><h4><strong>Licensed Material:</strong></h4><p>The Enron image is from <a href="https://lucidmanager.org/data-science/analyse-enron-corpus">https://lucidmanager.org/data-science/analyse-enron-corpus</a>, and is under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International</a> License.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9dc2fbc3c5e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/introduction-to-graph-analysis-using-cugraph-a9dc2fbc3c5e">Introduction to Graph Analysis using cuGraph</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAPIDS 23.06 Release — Accelerating Data Science]]></title>
            <link>https://medium.com/rapids-ai/rapids-23-06-release-accelerating-data-science-6b09018c0527?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/6b09018c0527</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[rapids-ai]]></category>
            <category><![CDATA[spatial-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alex Ravenel]]></dc:creator>
            <pubDate>Wed, 21 Jun 2023 15:53:26 GMT</pubDate>
            <atom:updated>2023-06-22T14:42:00.904Z</atom:updated>
            <content:encoded><![CDATA[<h3>RAPIDS 23.06 Release — Accelerating Data Science</h3><p>RAPIDS’ 23.06 release is now available! This release adds a number of features and improvements we are excited about, including:</p><ul><li>Major improvements to cuSpatial, including DE-9IM support, pip packages, performance improvements, and improved example notebooks</li><li>RAFT integrations with <a href="https://github.com/benfred/implicit">Implicit</a> (collaborative filtering) and Meta’s <a href="https://engineering.fb.com/2017/03/29/data-infrastructure/faiss-a-library-for-efficient-similarity-search/">FAISS</a> (similarity search), as well as improvements to pylibraft</li><li>Performance and memory usage improvements in cuGraph</li><li>Timezone support and numerous performance increases in cuDF</li><li>CUDA 12 support in pip wheels</li></ul><p>Get started with the <a href="https://rapids.ai/#quick-start">quick start installation instructions for conda, pip, or docker</a> or read on to see more details on this months’ upgrades!</p><h3><strong>Table of Contents</strong></h3><ul><li><a href="#625b">Expanded spatial relationship and distance queries in cuSpatial</a></li><li><a href="#0411">Nearest neighbors and more in RAFT</a></li><li><a href="#4316">Better memory utilization and performance in cuGraph</a></li><li><a href="#da06">Timezone support and performance boosts in cuDF</a></li><li><a href="#def0">CUDA 12 pip packages now available!</a></li><li><a href="#4f2d">Conclusion</a></li></ul><h3>Expanded spatial relationship and distance queries in cuSpatial</h3><p>23.06 is one of our biggest releases yet with the focus being on increasing our reach, making it easier than ever before to use cuSpatial and to keep the data and compute on the GPU so further processing and analysis is faster than ever. Major changes include:</p><ul><li>cuSpatial can now be installed with pip</li><li>Cartesian distance between GeoSeries of any geometry type.</li><li>Spatial Predicates for any two non-multigeometry columns</li><li>Notebook Improvements including using cuML with cuSpatial and a cuDF accelerated WKT parser</li></ul><p>Starting with 23.06, you can now install cuSpatial using pip alongside the other main RAPIDS libraries, hosted on the NVIDIA index. We support both CUDA 11.2–11.8 and 12.0 with pip.</p><pre># If using driver 525+, with support for CUDA Toolkit 12.0+<br><br>pip install --extra-index-url=https://pypi.nvidia.com cuspatial-cu12<br><br># If using driver 450.80+, with support for CUDA Toolkit 11.2+<br><br>pip install --extra-index-url=https://pypi.nvidia.com cuspatial-cu11</pre><p>This release also includes fully parallelized Cartesian distance between any two pairs of geometry. It’s easier and faster than ever to find the distance between objects in large datasets of (multi)points, (multi)polygons, and (multi)linestrings.</p><p>23.06 now supports the complete set of spatial binary predicates, also known as DE-9IM. Nine predicates are supported in this release: contains, geom_equals, intersects, covers, crosses, disjoint, overlaps, touches, and within. These predicates give you the ability to leverage GPU parallelization to determine spatial relationships between two GeoSeries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/0*elWDBGT8I_tBTZiy" /><figcaption>LineString intersects LineString</figcaption></figure><pre>import cuspatial<br>import geopandas<br>import numpy as np<br>from shapely import LineString, GeometryCollection<br>left = geopandas.GeoSeries([<br>    LineString([(-4, 1), (-2, 1), (0, 1), (2, 1), (4, 1)]),<br>    LineString([(-4, 2), (-1, 2), (-1, -2), (1, -2), (1, 2), (4, 2)]),<br>    LineString([(0, 4), (0, -4)])<br>])<br>right = geopandas.GeoSeries([<br>    LineString([(-4, 0), (-2, 0), (0, 0), (2, 0), (4, 0)]),<br>    LineString([(-4, 0), (-2, 0), (0, 0), (2, 0), (4, 0)]),<br>    LineString([(-4, 0), (-2, 0), (0, 0), (2, 0), (4, 0)]),<br>])<br><br>sample1 = np.random.randint(0, 3, 10_000_000)<br>sample2 = np.random.randint(0, 3, 10_000_000)<br>gpd_left_lines = left[sample1].reset_index(drop=True)<br>gpd_right_lines = right[sample2].reset_index(drop=True)<br>left_lines = cuspatial.from_geopandas(left)[sample1].reset_index(drop=True)<br>right_lines = cuspatial.from_geopandas(<br>    right<br>)[sample2].reset_index(drop=True)</pre><p>This example demonstrates a 96x speedup using cuSpatial for LineString-LineString intersection tasks on an AMD EPYC 7642 (48 core) CPU and an NVIDIA A100 GPU.</p><pre>In [2]: %time gpu_result = left_lines.intersects(right_lines)<br>   ...: <br>CPU times: user 422 ms, sys: 59.4 ms, total: 482 ms<br>Wall time: 481 ms<br><br>In [3]: %time host_result = gpd_left_lines.intersects(gpd_rig<br>   ...: ht_lines)<br>CPU times: user 46.4 s, sys: 90.2 ms, total: 46.5 s<br>Wall time: 46.5 s</pre><p>To get your wheels turning on ways to use cuSpatial and leverage the power of RAPIDS alongside it, we’ve updated the Hausdorff Clustering Notebook to use cuML, and the zip code stop sign comparison notebook now uses a cuDF-accelerated WKT parser that improves IO performance by up to 40x.</p><p>Just like with the <a href="https://medium.com/rapids-ai/cuspatial-23-04-7d8014570d8d">23.04 cuSpatial release</a>, there’s too much to cover in this article, so we are planning another standalone cuSpatial 23.06 blog — stay tuned for more!</p><h3>Nearest neighbors and more in RAFT</h3><p>RAFT continues to provide important building blocks for building machine learning and data analytics applications and release 23.06 is no exception! pylibraft continues to expand, with 23.06 bringing RAFT’s powerful k-selection APIs to Python libraries.</p><p><a href="https://github.com/benfred/implicit">Implicit</a>, the popular library for collaborative filtering in Python, is officially using RAFT’s C++ k-selection primitives and found an instant 25% speedup over its prior implementation. Stay tuned while Implicit continues to integrate RAFT primitives, such as brute-force nearest neighbors, in coming releases. Meta’s <a href="https://engineering.fb.com/2017/03/29/data-infrastructure/faiss-a-library-for-efficient-similarity-search/">FAISS</a> library, which has long been known as the standard for approximate nearest neighbors (ANN) algorithms on the GPU, has also been integrating RAFT’s C++ brute-force nearest neighbors (aka Flat index) and will soon be integrating RAFT’s C++ <a href="https://docs.rapids.ai/api/raft/nightly/cpp_api/neighbors_ivf_flat/">IVF-Flat</a>, <a href="https://docs.rapids.ai/api/raft/nightly/cpp_api/neighbors_ivf_pq/">IVF-PQ</a>, and <a href="https://docs.rapids.ai/api/raft/nightly/cpp_api/neighbors_cagra/">CAGRA</a> implementations.</p><p>Nearest neighbors aside, all of RAFT’s public APIs now accept the new raft::resources object, which provides API-level environment and dependency agnosticism. As an example, CUDA math libraries are no longer required dependencies for users who aren’t invoking APIs that need them.</p><h3>Better memory utilization and performance in cuGraph</h3><p>Release 23.06 saw cuGraph addressing performance and expanding the list of algorithms that scale to Multi-Node Multi-GPU (MNMG). In 23.06 the team focused on reducing the memory overhead in creating a graph in MNMG environments. The memory overhead (what cuGraph uses versus the size of the input data) was reduced from:</p><ul><li>Directed Graph: overhead dropped from 5.9x to 3.07x</li><li>Undirected Graph: overhead dropped from 12x to 6.14x for undirected graph</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*QyJ4N0lDkGmB56pV" /></figure><p>An Undirected graph requires that the data be symmetrized hence memory is 2x of directed.</p><p>By reducing unneeded data copies, the performance of graph creation improved between 1.7x and 4.2x depending on the size of the graph.</p><p>For release 23.06, cuGraph is pleased to announce the release of MNMG Leiden for community detection / clustering on large graphs. We also enhanced Node2Vec to support MNMG for GNN sampling on large graphs. Speaking of GNNs, we spent a lot of time optimizing and improving our sampling algorithms. The cugraph-pyg code was refactored so that the node loader now matches upstream PyG. Additionally, we r<a href="https://medium.com/rapids-ai/intro-to-graph-neural-networks-with-cugraph-pyg-6fe32c93a2d">eleased a blog discussing cugraph-pyg</a>. And lastly, the RMAT generator was updated to support the creation of Bipartite graphs.</p><h3>Timezone support and performance boosts in cuDF</h3><p>cuDF 23.06 introduces support for timezone-aware datetime types. You can use the tz_localize method to create timezone-aware data:</p><pre>&gt;&gt;&gt; dti = cudf.date_range(&quot;2001-01-01&quot;, freq=&quot;3h&quot;, periods=10)<br>&gt;&gt;&gt; dti<br>DatetimeIndex([&#39;2001-01-01 00:00:00&#39;, &#39;2001-01-01 03:00:00&#39;,<br>            &#39;2001-01-01 06:00:00&#39;, &#39;2001-01-01 09:00:00&#39;,<br>            &#39;2001-01-01 12:00:00&#39;, &#39;2001-01-01 15:00:00&#39;,<br>            &#39;2001-01-01 18:00:00&#39;, &#39;2001-01-01 21:00:00&#39;,<br>            &#39;2001-01-02 00:00:00&#39;, &#39;2001-01-02 03:00:00&#39;],<br>           dtype=&#39;datetime64[ns]&#39;)<br><br>&gt;&gt;&gt; dti_tz = dti.tz_localize(&quot;America/New_York&quot;)<br>&gt;&gt;&gt; dti_tz<br>DatetimeIndex([&#39;2001-01-01 00:00:00-05:00&#39;, &#39;2001-01-01 03:00:00-05:00&#39;,<br>            &#39;2001-01-01 06:00:00-05:00&#39;, &#39;2001-01-01 09:00:00-05:00&#39;,<br>            &#39;2001-01-01 12:00:00-05:00&#39;, &#39;2001-01-01 15:00:00-05:00&#39;,<br>            &#39;2001-01-01 18:00:00-05:00&#39;, &#39;2001-01-01 21:00:00-05:00&#39;,<br>            &#39;2001-01-02 00:00:00-05:00&#39;, &#39;2001-01-02 03:00:00-05:00&#39;],<br>           dtype=&#39;datetime64[ns, America/New_York]&#39;)</pre><p>To convert between timezones, use tz_convert:</p><pre>&gt;&gt;&gt; dti_tz.tz_convert(&quot;America/Chicago&quot;)<br>DatetimeIndex([&#39;2000-12-31 23:00:00-06:00&#39;, &#39;2001-01-01 02:00:00-06:00&#39;,<br>            &#39;2001-01-01 05:00:00-06:00&#39;, &#39;2001-01-01 08:00:00-06:00&#39;,<br>            &#39;2001-01-01 11:00:00-06:00&#39;, &#39;2001-01-01 14:00:00-06:00&#39;,<br>            &#39;2001-01-01 17:00:00-06:00&#39;, &#39;2001-01-01 20:00:00-06:00&#39;,<br>            &#39;2001-01-01 23:00:00-06:00&#39;, &#39;2001-01-02 02:00:00-06:00&#39;],<br>           dtype=&#39;datetime64[ns, America/Chicago]&#39;)</pre><p>These functions are similar to their Pandas counterparts, but are much faster:</p><pre>psr = pd.Series(pd.date_range(&quot;1970-01-01&quot;, &quot;1980-01-01&quot;, freq=&quot;1T&quot;))<br>sr = cudf.from_pandas(psr)<br><br>In [6]: %timeit psr.dt.tz_localize(&quot;America/New_York&quot;, ambiguous=&quot;NaT&quot;, nonexistent=&quot;NaT&quot;)<br>1.55 s ± 9.91 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)<br><br>In [7]: %timeit sr.dt.tz_localize(&quot;America/New_York&quot;, ambiguous=&quot;NaT&quot;, nonexistent=&quot;NaT&quot;)<br>9.98 ms ± 246 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)</pre><p><a href="https://docs.rapids.ai/api/libcudf/stable/">libcudf</a> — the C++ library that powers cuDF — implemented several important performance improvements and new features in 23.06:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*moRo1PZhxrgahOHd" /></figure><ul><li>Released the first libcudf algorithm powered by <a href="https://github.com/NVIDIA/cuCollections/pull/278">cuco::static_set</a>, delivering an additional <a href="https://github.com/rapidsai/cudf/pull/13343">3–4x speedup to </a><a href="https://github.com/rapidsai/cudf/pull/13343">distinct_count</a> (see left).</li><li>Introduced the <a href="https://github.com/rapidsai/cudf/pulls?q=12961+13333">minhash function</a>, designed for de-duplication in large-language model training</li><li>Completed the removal of <a href="https://github.com/rapidsai/cudf/pulls?q=13372+13355+13345+13341+13331+13330+13311+13292+13258+13227+13221+13205+13149+13148+13134+13124+13121+13111+13107+13104+13102+13081+">lazily-computed null counts</a>, the last major blocker for <a href="https://github.com/rapidsai/cudf/milestone/19">custom stream support</a></li><li><a href="https://github.com/rapidsai/cudf/pull/11656">Implement Python drop_duplicates with </a><a href="https://github.com/rapidsai/cudf/pull/11656">cudf::stable_distinct</a>, delivering 20–55% speedups</li><li><a href="https://github.com/rapidsai/cudf/pull/13334">Add row-wise filtering step to read parquet</a></li></ul><h3>CUDA 12 pip packages now available!</h3><p>Last but not least, we are proud to announce that RAPIDS pip packages supporting CUDA 12 are now available via the NVIDIA pip package index. Give them a try via the <a href="https://docs.rapids.ai/install#install-rapids">install picker</a> or try the instructions below:</p><pre># Will install cudf, cuml, cugraph, cuspatial–adjust packages as needed<br>pip install --extra-index-url=https://pypi.nvidia.com cudf-cu12 cuml-cu12 cugraph-cu12 cuspatial-cu12</pre><h3>Conclusion</h3><p>We are proud of the updates that 23.06 brings, and hope that you will give it a try! For more information, you can check out:</p><ul><li><a href="https://rapids.ai/#quick-start">Quick Start Guide</a></li><li><a href="https://docs.rapids.ai/install">Full Install Guide</a></li><li><a href="https://docs.rapids.ai/api">Documentation</a>, including complete release changelogs</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b09018c0527" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/rapids-23-06-release-accelerating-data-science-6b09018c0527">RAPIDS 23.06 Release — Accelerating Data Science</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[cuSpatial 23.04]]></title>
            <link>https://medium.com/rapids-ai/cuspatial-23-04-7d8014570d8d?source=rss----2d7ba3077a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/7d8014570d8d</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[spatial-computing]]></category>
            <category><![CDATA[spatial-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[rapids-ai]]></category>
            <dc:creator><![CDATA[Alex Ravenel]]></dc:creator>
            <pubDate>Tue, 23 May 2023 15:02:01 GMT</pubDate>
            <atom:updated>2023-05-23T15:02:01.081Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>GeoSeries, Intersection, Spatial Predicates, and more!</strong></h4><p>Authors: <a href="https://medium.com/u/f68431a3f25a">Thomson Comer</a>, <a href="https://medium.com/u/e87badfef277">Mark Harris</a>, <a href="https://medium.com/u/2e252d9f68e6">Ben Jarmak</a>, <a href="https://medium.com/u/5c4e08a62e3b">Michael Wang</a></p><p>cuSpatial continues barreling towards complete spatial relationship predicate (DE-9IM) support and Cartesian distance between any two geometries. In support of these goals cuSpatial 23.04 includes multiple new features, as well as a new notebook that shows off the capabilities of cuSpatial. There are also some breaking changes in this release to ensure all features in the library meet our high standards.</p><h3>New Features</h3><ul><li>GeoSeries Standardization</li><li>Linestring-linestring Intersection</li><li>Point-Polygon Distance Computation</li><li>Binary Predicates: Equals and Intersects</li><li>Stop Sign Counting Notebook</li></ul><h3>GeoSeries Standardization</h3><p>Past cuSpatial releases greatly enhanced the capabilities of cuSpatial’s geometry series object: <a href="https://docs.rapids.ai/api/cuspatial/stable/api_docs/geopandas_compatibility/#cuspatial.GeoSeries">GeoSeries</a>. In this release, cuSpatial standardizes all API inputs with GeoSeries. Instead of passing custom offset and coordinate arrays like before, all cuSpatial APIs now accept GeoSeries as input. Constructing a cuSpatial GeoSeries from GeoPandas is as simple as:</p><pre>import geopandas as gpd<br>gpds1 = gpd.GeoSeries([Point(0, 0), Point(1, 1)])<br>cus1 = cuspatial.GeoSeries(gpds)</pre><p>You can also directly construct a GeoSeries from a list of shapely objects:</p><pre>cus2 = cuspatial.GeoSeries([Point(2, 2), Point(3, 3)])</pre><p>Using GeoSeries everywhere significantly simplifies cuSpatial API calls.</p><pre># cuspatial 23.02<br>old = cuspatial.haversine_distance(p1_lon, p1_lat, p2_lon, p2_lat)<br># cuspatial 23.04<br>new = cuspatial.haversine_distance(p1, p2)</pre><h3>Interleaved x-y coordinates v.s. separate x-y coordinate column</h3><p>GeoSeries assumes that its underlying coordinates are stored in a single interleaved x-y column. For data stored in separate x-y columns, cuSpatial provides the following new factory methods to construct a GeoSeries.</p><pre>GeoSeries.from_points_xy<br>GeoSeries.from_multipoints_xy<br>GeoSeries.from_linestrings_xy<br>GeoSeries.from_polygons_xy</pre><p>To construct a GeoSeries from separate coordinate columns, first call interleave_columns() from cuDF to construct an interleaved coordinate column, then construct the geoseries with from_points_xy.</p><pre>coords = cudf.DataFrame({“x”: xcol, “y”: ycol}).interleave_columns()<br>points = GeoSeries.from_points_xy(coords)</pre><p>Updating the API to accept GeoSeries input is a major breaking change. It’s a necessary change since there are many GIS data formats out there, while libcuspatial computation kernels have strong assumptions on inputs. By separating the data structure construction and computation, this design makes cuSpatial computation more efficient and robust.</p><h3>Linestring-Linestring Intersection</h3><p><a href="https://shapely.readthedocs.io/en/stable/set_operations.html">Set operations</a> allow users to identify and analyze overlapping spatial features, which is critical for tasks like route optimization, resource allocation, and conflict resolution in infrastructure planning. cuSpatial 23.04 introduces an API that computes the intersecting geometries between two columns of linestrings. The API can be called via cuspatial.pairwise_linestring_intersection. The following example shows how to use it.</p><figure><img alt="Image 1: Example of two linestring intersects on a point and a segment." src="https://cdn-images-1.medium.com/max/659/1*-0-cUzsxXTz8FfVmJJsZuA.png" /><figcaption>Image 1: Example of two linestring intersects on a point and a segment.</figcaption></figure><p>Given two linestrings (<strong>ABCDE</strong>, <strong>FGHI</strong>), compute the intersections between them:</p><pre>&gt;&gt;&gt; from shapely.geometry import *<br>&gt;&gt;&gt; from cuspatial.core.binops.intersection import pairwise_linestring_intersection<br>&gt;&gt;&gt; l1 = cuspatial.GeoSeries([<br>… LineString([(0, 0), (2, 1), (4, 3), (2, 5), (0, 3)])])<br>&gt;&gt;&gt; l2 = cuspatial.GeoSeries([<br>… LineString([(-1, 6), (2, 3), (3, 4), (1, 6)])])<br>&gt;&gt;&gt; offsets, geoms, lookbacks = pairwise_linestring_intersection(l1, l2)<br>&gt;&gt;&gt; offsets<br>&lt;cudf.core.column.numerical.NumericalColumn object at 0x7f097c987bc0&gt;<br>[<br> 0,<br> 2<br>]<br>dtype: int32<br>&gt;&gt;&gt; geoms<br>0 POINT (1.00000 4.00000)<br>1 LINESTRING (2.00000 5.00000, 3.00000 4.00000)<br>dtype: geometry<br>&gt;&gt;&gt; lookbacks<br> lhs_linestring_id lhs_segment_id rhs_linestring_id rhs_segment_id<br>0 [0, 0] [3, 2] [0, 0] [0, 2]</pre><p>The API returns a 3-tuple:</p><ul><li>offsets, a cuDF integer series, which includes the offsets to the first result geometries for each pair;</li><li>geoms, a GeoSeries that contains the intersection results (points and linestrings);</li><li>lookbacks, a 4-column dataframe that contains the source geometry IDs from which to search the result.</li></ul><p>In this example, the offsets result of [0, 2] indicates that the intersection for the 0th pair starts at index 0 of the geoseries, and it has two results.</p><p>The geoseries (geoms), shows the result contains two values:</p><ol><li>A point with coordinates (1, 4).</li><li>This is the point of intersection between the linestrings (<strong>D, E</strong>) and (<strong>F, G</strong>) in the image above.</li><li>A linestring with coordinates (2, 5)-&gt;(3, 4).</li><li>This is the intersecting segment (D, H) in the image above.</li></ol><p>The 0th element in the 0th row of the lookback ids (lookbacks) indicates the position of the first result geometry in the first pair. From the example above, the first value — which corresponds with the first geometry in geoms — for each element in lookbacks is (0, 3, 0, 0).</p><p>(0, 3, 0, 0) means that POINT (1, 4) (the first (0) geometry returned in geoms) comes from the first (0) linestring (<strong>ABCDE</strong>), fourth (3) segment (2, 5) -&gt; (0, 3) on the left hand side and first (0) linestring (<strong>FGHI</strong>), first (0) segment (-1, 6)-&gt;(2, 3) on the right hand side.</p><p>There is no multilinestring in the input, therefore all linestring lookback ids are 0.</p><p>We recognize that this adds complexity, but it’s because intersection is a powerful primitive. In a sequential API that takes a single pair of geometries for each intersection test, the calling code knows immediately which input geometries intersect. A parallel API that operates on arrays of data must provide details of which geometries intersect so that the caller can act on the results. We can’t wait to see what you create with pairwise_linestring_intersection!</p><h3>Point-Polygon Distance Computation</h3><p>Great strides were made to cuSpatial’s suite of Cartesian Distance computations (known as ST_Distance in PostGIS/MySQL/SpatiaLite parlance) in this release with the addition of point-polygon distance computation. To use this new feature, call the <a href="https://docs.rapids.ai/api/cuspatial/stable/user_guide/cuspatial_api_examples/#cuspatial.pairwise_point_polygon_distance">cuspatial.pairwise_point_polygon_distance API</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*VYtQ6ELYWmtjapoEG7CnMw.png" /></figure><p>This example shows two pairs of inputs: Point E and Polygon ABC, and MultiPoint G, F and Polygon BCD. Use the API to compute the distances as in the following code.</p><pre>&gt;&gt;&gt; import cuspatial<br>&gt;&gt;&gt; from shapely.geometry import *<br>&gt;&gt;&gt; lhs = cuspatial.GeoSeries([MultiPoint([(0, 2)]), MultiPoint([(2 ,1), (2, 3)])])<br>&gt;&gt;&gt; rhs = cuspatial.GeoSeries([Polygon([(0, 0), (2, 0), (1, 2), (0, 0)]),<br>… Polygon([(2, 0), (3, 2), (1, 2), (2, 0)])])<br>&gt;&gt;&gt; cuspatial.pairwise_point_polygon_distance(lhs, rhs)<br>0 0.894427<br>1 0.000000<br>dtype: float64</pre><p>Note that the second pair in the series contains a multipoint, where one of the points intersects with the polygon in the corresponding pair, leading to a distance of 0.</p><h3>Binary Predicates: Equals and Intersects</h3><p>cuSpatial 23.04 expands support for topological <a href="https://shapely.readthedocs.io/en/stable/manual.html#binary-predicates">binary predicates</a> by adding those that depend on point-to-point <a href="https://docs.rapids.ai/api/cuspatial/stable/api_docs/geopandas_compatibility/#cuspatial.GeoSeries.geom_equals">equality</a> and/or <a href="https://docs.rapids.ai/api/cuspatial/stable/api_docs/geopandas_compatibility/#cuspatial.GeoSeries.intersects">intersection</a>. This capability enables a large set of predicates for various geometry combinations.</p><pre>points.geom_equals(points)<br>linestrings.geom_equals(linestrings)<br>polygons.geom_equals(linestrings)<br>multipoints.geom_equals(multipoints)<br><br>points.contains(points)<br>points.covers(points)<br>points.intersects(points)<br>points.within(points)<br>points.crosses(points)<br>points.overlaps(points)<br>points.intersects(points)<br><br>linestrings.intersects(points)<br>linestrings.intersects(multipoints)<br>linestrings.intersects(linestrings)<br><br>points.disjoint(linestring)<br>linestrings.disjoint(points)<br>linestrings.disjoint(linestrings)<br><br>linestrings.contains(points)<br>linestrings.covers(points<br>linestrings.crosses(points)<br>linestrings.crosses(linestrings)<br>linestrings.crosses(polygons)<br>linestrings.overlaps(points)<br>linestrings.overlaps(linestrings)<br>linestrings.overlaps(polygons)</pre><p>The next release of cuSpatial aims for complete spatial predicate support.</p><h3>Stop Sign Counting Notebook</h3><p>cuSpatial <a href="https://github.com/rapidsai/cuspatial/blob/main/notebooks/ZipCodes_Stops_PiP_cuSpatial.ipynb">adds a new notebook</a> demonstrating spatial join capability with the point-in-polygon function. This notebook includes a custom QuadTree data structure to allow fast spatial joins on the GPU in just a few lines of code, for example:</p><pre># Build a quadtree with all stop signs in the US<br>stop_quadtree = QuadTree(d_stops, x_column=’x’, y_column=’y’)<br><br># Pass CA zip code boundary polygons<br>stop_quadtree.set_polygon(CA_zipcode, poly_column=”WKT”)<br><br># Join the stop signs and the zip code dataframe<br>stop_by_zipcode = stop_quadtree.point_left_join_polygon([“x”, “y”], [“ZCTA5CE10”])</pre><p>This filters all stop signs that exist in every zip code in California. Finally, the notebook visualizes the count of the zipcodes on a map. Check out the notebook to see and interact with the map!</p><h3>Other Improvements and Bug Fixes</h3><p>In addition to the major features above, cuSpatial 23.04 includes a number of other improvements and bug fixes. The refactoring of cuSpatial’s C++ implementation is complete after about a year of effort, with a followup in 23.06 to improve header and source reorganization. Libcuspatial now comprises two layers: the generic header-only API where algorithms are implemented, and the cuDF column-based API which enables interoperability with libcudf.</p><p>The GDAL dependency has been removed, making the installation lighter weight, and paving the way to PIP installation support.</p><p>Documentation continues to improve, with updates and corrections to multiple sections of the User Guide.</p><h3>Breaking Changes</h3><p>In addition to changes to APIs to support GeoSeries, there are two significant API removals. The cubic spline interpolation function was not widely used and uncovered bugs in dependencies, limiting usability. This API also did not mesh well with the cuSpatial feature set, so it has been removed. The very limited shapefile reader has also been removed because of its heavy dependency on GDAL, limited parallelism, and limited feature set (only polygons and no other geometry types could be loaded). We plan to begin adding more capable and higher performance geospatial data I/O in a near future release.</p><h3>Try cuSpatial 23.04 Today</h3><p>Experience the new features and high performance of cuSpatial 23.04 and take your spatial analysis to new places. With the latest release, we have introduced several exciting features and enhancements that will revolutionize your spatial relationship computations. <a href="https://github.com/rapidsai/cuspatial#using-cuspatial">Try out the new features</a> and <a href="https://github.com/rapidsai/cuspatial/tree/branch-23.06/notebooks">new notebooks</a>. <a href="https://github.com/rapidsai/cuspatial/discussions">Join our growing community</a> of developers and researchers leveraging cuSpatial’s capabilities for efficient and robust spatial analytics.</p><p><a href="https://docs.rapids.ai/api/cuspatial/stable/user_guide/cuspatial_api_examples/">cuSpatial User Guide</a></p><p><a href="https://github.com/rapidsai/cuspatial/discussions">cuSpatial Discussions Forum</a></p><p><a href="https://github.com/rapidsai/cuspatial">cuSpatial Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d8014570d8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/cuspatial-23-04-7d8014570d8d">cuSpatial 23.04</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>