0Pricing
CUDA Academy · レッスン

データ再利用の問題

単純なカーネルがグローバルメモリを再読み込みする理由を学びます。

「データ再利用の問題」はCoddyKit上の無料CUDA Academyレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはCUDA Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 CUDA Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

The Hidden Cost

A kernel can be correct yet slow because it keeps fetching the same data from slow global memory over and over. 🐢

Memory Is the Bottleneck

On the GPU, arithmetic is cheap but reaching global memory is expensive. Many kernels wait on memory far more than they compute.

Data Reuse Defined

Data reuse means one value loaded from global memory is used by many computations instead of being read again each time.

A Naive Stencil

Picture blurring an image. Each output pixel averages its neighbors, so every input pixel gets read by several different threads.

out[i] = (in[i-1] + in[i] + in[i+1]) / 3.0f;

Counting the Reads

In that blur, the value in[i] is read by threads i-1, i, and i+1. The same byte travels across the slow PCIe-fed bus three times.

Redundancy Adds Up

With a wider window or a 2D grid, each element may be re-read dozens of times. This redundant traffic dominates the runtime.

Bandwidth Is Finite

Global memory has a fixed peak bandwidth. Reading the same data repeatedly wastes that budget on bytes you already had.

Compute Sits Idle

While warps stall waiting on repeated global loads, the math units sit idle. You paid for cores you are barely using. 😴

Arithmetic Intensity

Arithmetic intensity is the ratio of math operations to bytes moved. Low intensity means memory, not compute, limits you.

The Goal: Read Once

The fix is to load each needed value once into fast on-chip storage, then let many threads reuse it from there.

Enter Shared Memory

That fast on-chip storage is shared memory. Staging data there is the foundation of every tiling optimization ahead.

Quick Check

Why is a naive stencil kernel often slow?

Recap

Naive kernels re-read shared data from global memory, wasting bandwidth and stalling compute. Tiling exists to load once and reuse. ✅

よくある質問

「データ再利用の問題」レッスンは無料ですか?

はい。「データ再利用の問題」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、CUDA Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 CUDA Academyコースには全4レッスンが含まれています。

「データ再利用の問題」で何を学びますか?

単純なカーネルがグローバルメモリを再読み込みする理由を学びます。 ブラウザで直接実行するハンズオンコードでCUDA Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

CUDA Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのCUDA Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。

「データ再利用の問題」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このCUDA Academyレッスンでコードを書いて実行できますか?

はい。すべてのCUDA Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. データ再利用の問題
  2. ロード・同期・計算パターン
  3. ステンシルとスライディングウィンドウ
  4. 端のタイルを処理する
← CUDA Academyに戻る