<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-one-billion-row-challenge-in-cuda-from-17m-to-17s-tjmovzqle" -->

---
title: The One Billion Row Challenge in CUDA: from 17m to 17s
description: A developer shares their solution for the One Billion Row Challenge in CUDA, achieving a runtime of 16.8 seconds on a V100 GPU. The solution involves work...
canonical: https://daily.dev/posts/the-one-billion-row-challenge-in-cuda-from-17m-to-17s-tjmovzqle
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The One Billion Row Challenge in CUDA: from 17m to 17s | daily.dev
og:description: A developer shares their solution for the One Billion Row Challenge in CUDA, achieving a runtime of 16.8 seconds on a V100 GPU. The solution involves work...
og:url: https://daily.dev/posts/the-one-billion-row-challenge-in-cuda-from-17m-to-17s-tjmovzqle
og:image: https://api.daily.dev/og/posts/TJMOVzqlE.png
og:image:alt: The One Billion Row Challenge in CUDA: from 17m to 17s
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The One Billion Row Challenge in CUDA: from 17m to 17s

**[Hacker News](https://daily.dev/sources/hn)** · 9 min read · 1 upvotes · 0 comments

## Summary

A developer shares their solution for the One Billion Row Challenge in CUDA, achieving a runtime of 16.8 seconds on a V100 GPU. The solution involves work partitioning and using byte offsets instead of line buffers. The CUDA kernel handles parsing and updating statistics. The post discusses challenges such as adapting atomic operations for floats, working with C strings, and creating a city string to index lookup table. The solution is a significant improvement over the pure C++ baseline.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tspeterkim.github.io/posts/cuda-1brc>

---

Tags: [#performance](https://daily.dev/tags/performance), [#c](https://daily.dev/tags/c), [#cuda](https://daily.dev/tags/cuda)

[View this post on daily.dev](https://daily.dev/posts/the-one-billion-row-challenge-in-cuda-from-17m-to-17s-tjmovzqle)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The One Billion Row Challenge in CUDA: from 17m to 17s","url":"https://daily.dev/posts/the-one-billion-row-challenge-in-cuda-from-17m-to-17s-tjmovzqle","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-one-billion-row-challenge-in-cuda-from-17m-to-17s-tjmovzqle"},"datePublished":"2024-04-14T11:15:03.825Z","dateModified":"2024-05-09T08:43:33.910Z","description":"A developer shares their solution for the One Billion Row Challenge in CUDA, achieving a runtime of 16.8 seconds on a V100 GPU. The solution involves work...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/71ff793454ca360cf56f2ebc72b706ef?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/71ff793454ca360cf56f2ebc72b706ef?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-one-billion-row-challenge-in-cuda-from-17m-to-17s-tjmovzqle","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,c,cuda","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"The One Billion Row Challenge in CUDA: from 17m to 17s"}]}
```

