---
title: "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
source_url: https://tspeterkim.github.io/posts/cuda-1brc
type: article
source: "Hacker News"
published: 2024-04-14T11:15:03.825Z
updated: 2024-05-09T08:43:33.910Z
tags: ["performance", "c", "cuda"]
reading_time: 9
upvotes: 1
comments: 0
language: 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>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

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)
