NVIDIA CUDA 13.3 が C++ のタイルプログラミング、コンパイラ自動調整、Python 更新で GPU 開発を強化
NVIDIA は CUDA 13.3 をリリースし、C++ における Tile プログラミングの正式導入、CUDA Python の 1.0 安定版公開、および Compiler Autotuning による性能向上を実現した。
キーポイント
CUDA Tile C++ の正式リリースと拡張
高レベルなタイルベースのカーネル開発を可能にする CUDA Tile が C++ で正式サポートされ、Hopper アーキテクチャを含む全対応 GPU での利用が可能になった。
CUDA Python 1.0 の安定化
CUDA Python エコシステムが 1.0 に到達し、セマンティックバージョニングの導入により API の安定性が保証され、グリーンコンテキストやプロセスチェックポイントなどの新機能が追加された。
CompileIQ による自動チューニング
新しい Compiler Autotuning フレームワーク「CompileIQ」が実装され、GEMM やアテンションなどの重要カーネルで最大 15% の速度向上を実現した。
C++23 サポートとライブラリ更新
NVCC が C++23 を正式サポートし、Tensor interoperability が DLPack/mdspan で拡張されるなど、cuBLAS や Nsight ツールなどの主要コンポーネントも大幅にアップデートされた。
cuda.core の安定化と新機能
Pythonic な CUDA ランタイムインターフェースである cuda.core がバージョン 1.0 で正式に安定版となり、グリーンコンテキストやプロセスチェックポイント機能が追加されました。
GPU リソースの分離と共有
グリーンコンテキストにより GPU の SM を分割して遅延敏感なカーネルを保護し、IPC 機能によってプロセス間でのホストを経由しない VRAM の直接共有が可能になりました。
Python ライブラリのバージョン更新
CUDA C API に直接アクセスする cuda.binding や CCCL アルゴリズムへのアクセスを提供する cccl-cuda など、主要な Python ライブラリが CUDA 13.3 で新バージョンとしてリリースされました。
影響分析・編集コメントを表示
影響分析
このリリースは、GPU 開発のハードルを下げつつ性能を最大化する方向へ大きく舵を切ったものであり、特に大規模モデルや科学計算における開発効率と実行速度に直接的な恩恵をもたらす。C++ と Python の両エコシステムに対する本格的なサポート強化により、NVIDIA のプラットフォームロックインがさらに強固になる一方で、デベロッパーの生産性が劇的に向上する見込みである。
編集コメント
CUDA の進化において、C++ と Python の両軸で開発体験を劇的に改善する重要なマイルストーンです。特に自動チューニング機能の導入は、複雑な最適化作業からの解放を意味し、実務への即効性が極めて高いと言えます。
NVIDIA CUDA 13.3 は、CUDA エコシステム全体の開発者に対して、新たな機能とパフォーマンス最適化をもたらします。C++ における NVIDIA CUDA Tile プログラミングの発表により、複雑な低レベル GPU の詳細を自動的に管理し、最適なパフォーマンスと移植性を実現する、高レベルでタイルベースのカーネル開発が可能になりました。さらに、CUDA Tile プログラミングは、すべての対応済み GPU アーキテクチャに加え、Compute Capability 9.0(NVIDIA Hopper)GPU でもサポートされるようになりました。
また、CUDA Python 1.0もリリースし、CUDA Python ソフトウェアエコシステムのサポートと安定性を確固たるものとし、グリーンコンテキストやプロセスのチェックポイント機能といった重要な機能を新たに導入しました。
パフォーマンスを追求する方々向けに、新しく発表された NVIDIA CompileIQ コンパイラ自動調整フレームワークは、GEMM やアテンションなどのクリティカルなカーネルにおいて最大 15% の高速化を実現します。本リリースでは、NVCC における公式のC++23 サポート、CCCL 3.3 でのDLPack/mdspanとの拡張されたテンソル相互運用性、および数学ライブラリ(cuBLAS、cuSPARSE、cuSOLVER)とプロファイリングツール(Nsight Compute、Nsight Systems)に関する多数の更新も含まれています。
CUDA Tile C++ のリリース
CUDA 13.3 のリリースに伴い、CUDA Tile サポートが C++ に拡張され、大規模な既存の C++ コードベースと開発者コミュニティが、高度に最適化された GPU タイルカーネルを作成できるようになりました。このモデルは並列処理、メモリアクセス、非同期処理、およびその他の低レベルの詳細を自動化し、NVIDIA GPU アーキテクチャ間で移植可能な C++ コードを実現します。詳細については、ブログ記事をご覧ください。
CUDA Python 1.0 のリリース
CUDA Python は、CUDA を Python プログラミング言語に公開するライブラリ群です。バージョン 1.0 のリリースにより、セマンティックバージョニングへのコミットを表明します。これは、破壊的な API 変更がメジャーバージョンのリリース時だけ発生することを保証するものです。マイナーリリースでは新機能の追加が行われ、パッチリリースではバグ修正が行われます。削除予定の公開 API は、まずマイナーリリースで非推奨とされ、明確な移行パスが提示されます。
以下は、CUDA Python 1.0 に含まれるソフトウェアコンポーネントに関する詳細情報です。
ライブラリ説明次期メジャーバージョン
cuda.binding CUDA C API への低レベル Python バインディング。13.3.0
cuda.core CUDA ランタイムおよびその他のコア機能への Pythonic なアクセス。1.0.0
cccl-cuda CCCL の並列アルゴリズムへの Pythonic なアクセスと、CCCL の高効率かつカスタマイズ可能な並列アルゴリズムへの容易なアクセス。1.0.0
cuda-pathfinder ユーザーの Python 環境にインストールされた CUDA コンポーネントを検出するためのユーティリティ。1.6
cuda.coop は、API の変更対象となる _experimental ネームスペースの下、cuda-cccl パッケージ内でも利用可能です。cuda.coop は、Numba CUDA カーネル内で使用するための再利用可能なブロック全体およびワープ全体の *デバイス* プリミティブを提供します。
cuda.core が安定版になりました
cuda.core は、CUDA ランタイム(デバイス、ストリーム、プログラム、リンカー、メモリリソース、グラフを含む)への Python 的なインターフェースを提供します。バージョン 1.0 では、過去のリリースサイクルで安定化が進んできた API を単一のサポート対象表面に統合しました。同時に、グリーンコンテキスト、CUDA チェックポイント機能などのサポートを追加しました。
- グリーンコンテキスト:GPU の SM(ストリーミングマルチプロセッサ)を互いに排他的なパーティションに分割し、それぞれが独自のコンテキストとストリームを持つようにします。これにより、レイテンシ敏感なカーネルが、同じプロセス内で実行されるスループット指向の長時間実行型カーネルから保護されます。
- プロセスチェックポイント:実行中のプロセスの完全な CUDA 状態(デバイス割り当て、ストリーム、コンテキストを含む)のスナップショットを取得し、後で復元できます。これにより、GPU プロセス向けに CRIU スタイルのワークフローが実現され、耐障害性の高い長時間ジョブ、共有クラスター上でのプリエンプションと移行、推論ワーカーの高速ウォームスタートが可能になります。Linux のみで利用可能です。
- プロセス間共有(IPC):ホストを経由してコピーすることなく、Python プロセス間で GPU メモリを共有できます。1 つのプロセスが割り当てを行い、他のプロセスは同じ物理 VRAM を各自のアドレス空間にマップします。マルチプロセス ML サービングやゼロコピーのプロデューサー/コンシューマーパイプラインに最適です。
以下は、cuda.core API の使用法の簡単な例です。
from cuda.core import Device, Stream, Program, ProgramOptions, LaunchConfig, launch
dev = Device()
dev.set_current()
stream = dev.create_stream()
prog = Program(src, code_type="c++", options = ProgramOptions(arch=f"sm_{dev.arch}"))
kernel = prog.compile("cubin").get_kernel("my_kernel")
launch(stream, LaunchConfig(grid=64, block=256), kernel, *args)
from cuda.core import Linker, LinkerOptions
module = Linker(
[obj1, obj2],
options=LinkerOptions(arch=f"sm_{dev.arch}")
).link("cubin")
from cuda.core import ProgramOptions
opts = ProgramOptions(std="c++17", arch=f"sm_{dev.arch}", create_pch=True, pch_dir="/tmp/pch")
from cuda.core import DeviceMemoryResource, PinnedMemoryResource, PinnedMemoryResourceOptions, ManagedMemoryResource, ManagedMemoryResourceOptions
pinned = PinnedMemoryResource(PinnedMemoryResourceOptions(numa_id=0))
from cuda.core.graph import GraphBuilder, GraphDef
gb = stream.create_graph_builder()
gb.begin_building()
graph = gb.end_building().complete()
graph.launch(stream)
gdef = GraphDef()
gdef.add_kernel_node(kernel, LaunchConfig(grid=64, block=256), args=args)
from cuda.core import DeviceMemoryResource, DeviceMemoryResourceOptions
mr = DeviceMemoryResource(dev,
options=DeviceMemoryResourceOptions(max_size=1 << 20, ipc_enabled=True))
buffer = mr.allocate(nbytes)
from cuda.core import ContextOptions, SMResourceOptions
sm = dev.resources.sm
long_grp, crit_grp = sm.split(SMResourceOptions(count=(sm.sm_count - 16, 16)))[0]
ctx_crit = dev.create_context(ContextOptions(resources=[crit_grp]))
s_crit = ctx_crit.create_stream()
from cuda.core import checkpoint
proc = checkpoint.Process(os.getpid())
proc.lock(timeout_ms=5000)
proc.checkpoint()
proc.restore()
proc.unlock()
from cuda.core import StridedMemoryView, TensorMapDescriptor
tmap = StridedMemoryView(tensor).as_tensor_map(box_shape=(128,))
from cuda.core.utils import StridedMemoryView
view = StridedMemoryView(torch_tensor); capsule = view.__dlpack__()
from cuda.core import system
print(system.num_devices, system.driver_version)
from cuda.bindings import nvml
nvml.init()
name = nvml.device_get_name(nvml.device_get_handle_by_index_v2(0))
from cuda.bindings import nvfatbin
handle = nvfatbin.create()
CCCL Python release 1.0.0: cuda.compute
cuda.compute は、CUDA Core Compute Libraries (CCCL) の高度に最適化された並列アルゴリズム(ソート、スキャン、リダクション、変換、ユニーク、ヒストグラム、トップ k など)を、ホストから呼び出し可能なビルディングブロックとして Python に持ち込みます。前回のリリースからの主な変更点は以下の通りです。
- アルゴリズム演算子として Python のラムダ式を使用できるようになり、単純なリダクション、スキャン、変換、述語の記述におけるボイラープレートコードを削減できます。
- アルゴリズムは副作用(状態)を持つ演算子をサポートするようになり、アキュムレータの実行や条件付き変換などのユースケースが可能になりました。
- 新しい cuda.compute.upper_bound および cuda.compute.lower_bound API は、CUB の並列バイナリ検索を Python に公開します。
- 高速な再帰呼び出しのために、すべてのアルゴリズムにわたって統合されたキャッシングが実装されました。
import cuda.compute
from cuda.compute import OpKind
d_input = cp.arange(1, 1_000_001, dtype=cp.int32)
d_output = cp.empty(1, dtype=cp.int32)
h_init = np.array([0], dtype=np.int32)
cuda.compute.reduce_into(
d_input, d_output, OpKind.PLUS, d_input.size, h_init
)
cuda.compute.reduce_into(
d_input, d_output,
lambda a, b: a if a > b else b,
d_input.size, h_init,
)
cuda.coop は、Numba CUDA カーネル内部で使用するための CCCL のワープ幅およびブロック幅の協調プリミティブを公開します。現時点では、このモジュールは _experimental 名前空間下にあり、セマンティックバージョニングに従わない API 変更が行われる可能性があります。
from numba import cuda
from cuda.coop._experimental import block, warp
THREADS = 128
block_sum = coop.block.make_sum(numba.int32, THREADS)
@cuda.jit(link=block_sum.files)
def reduce_kernel(data, out):
total = block_sum(data[cuda.threadIdx.x])
if cuda.threadIdx.x == 0:
out[0] = total
h_in = np.ones(THREADS, dtype=np.int32)
d_in = cuda.to_device(h_in)
d_out = cuda.device_array(1, dtype=np.int32)
reduce_kernel1, THREADS
assert d_out.copy_to_host()[0] == THREADS
新しい Numba CUDA MLIR バックエンド
Numba CUDA MLIR は、MLIR と最新の NVVM ツールチェーンの上にゼロから構築された、Python 向けの新しい Numba 互換カーネルジェネレーターです。これは Numba-CUDA から継承される familiar @cuda.jit プログラミングモデルを維持しつつ、より短いコンパイル遅延、改善された診断機能、そして NVVM スタックに新アーキテクチャや機能が追加された際にそれらに対応するためのクリーンなパスを提供します。Numba CUDA MLIR は、単にインポート文を書き換えるだけで numba.cuda のドロップイン代替品として使用できます:
from numba import cuda
from numba_cuda_mlir import cuda
@cuda.jit
def vector_add(a, b, out):
i = cuda.grid(1)
if i < out.shape[0]:
out[i] = a[i] + b[i]
既存の Numba-CUDA 互換性に加え、Numba CUDA MLIR は以下の特徴を備えています:
- より高速な JIT コンパイル。ベクトル加算、ソフトマックス、コレスキー分解、アテンション、ブラック・ショールズモデル、FFT、行列乗算など、実際のカーネルのスイート全体において、ウォームアップ後の JIT コンパイル時間は幾何平均で約 1.4 倍、個々のカーネルでは最大約 2 倍高速化されています(Numba-CUDA と比較)。
- より低い起動遅延。典型的なカーネルではホスト側のカーネルディスパッチオーバーヘッドが約 2〜3.5 倍削減され、スカラー引数が多数あるカーネルでは最大約 17 倍削減されます。これは以前、引数のパック化がボトルネックとなっていたケースです。
Numba CUDA MLIR 0.3 は PyPI から numba-cuda-mlir[cu13] をインストールしてテストでき、GitHub で開発を追跡することもできます。
今日から CUDA Python を試す
CUDA Python スタックを直接 PyPI からインストールしてください:
pip install cuda-python cuda-cccl numba-cuda-mlir[cu13]
これにより、cuda.bindings 13.3.0、cuda.core 1.0.0、cuda.compute 1.0.0 が取り込まれ、ライブラリの検出には cuda-pathfinder が利用されます。
CompileIQ のローンチ
GPU カーネルにおける最大パフォーマンスを実現するための新しいコンパイラ自動調整フレームワーク「CompileIQ」が、CUDA 13.3 とともに登場しました。GPU コンパイラは一般的に広く有効な最適化ヒューリスティクスを適用しますが、特定のカーネルに対して必ずしも最適なわけではありません。CompileIQ はこれを変え、進化的アルゴリズムおよび遺伝的アルゴリズムを用いて、各カーネルにカスタム調整された専用のコンパイラ構成を生成します。
これにより追加のパフォーマンスが引き出されます。例えば、LLM 推論の計算量の 90% 以上を占める重要なカーネルである GEMM やアテンションにおいて、CompileIQ はすでに最適化済みの Triton アテンションおよび CUTLASS GEMM カーネルに対して最大で15% の高速化を実現します。CompileIQ の仕組みや使用方法については、こちらのブログ記事をご覧ください。
数値ライブラリ
CUDA 13.3 に含まれるコア CUDA 数値ライブラリには、いくつかの新機能と目立ったパフォーマンス向上が用意されています。
- cuSPARSE:
- SpSV および SpSM における CSC フォーマットへの対応。
- SpMVOp における混合精度計算への対応。
- SpMvOp 計算における混合インデックス型(64 ビットオフセット、32 ビットインデックス)の CSR 行列への対応。
- cusparseSpMVOp_createDescr() のパフォーマンスが 2.5 倍に向上。
- 新しい API「SPMVOP_ALG1」を導入。以下の機能をサポート:
- スパースパターンを維持したまま行列値を更新可能。
- バッファサイズの最適化。
- プリプロセスのオーバーヘッド削減。
- cuBLAS:
CUDA のグリーンコンテキストサポート。
- NVIDIA Blackwell Ultra における FP4 行列乗算の性能向上。
- NVIDIA Blackwell および Blackwell Ultra における TF32 行列乗算の性能向上。
- NVIDIA Hopper、Blackwell、および Blackwell Ultra における SYMV(対称ベクトル乗算)の性能向上。
- 問題空間全体で一定となる固定ワークスペースサイズを強制することで、FP64 エミュレートされた行列乗算のユーザーエクスペリエンスが改善されました。
- cuSOLVER:
64 ビットインターフェース cusolverDnXpolar は、cuSOLVERDn における極分解のための QDWH アルゴリズム実装を公開します。
- 分割統治法を用いて対称三対角行列の固有値および任意の場合に固有ベクトルを計算する 64 ビットインターフェース cusolverDnXstedc。
- 固有ベクトルのポストプロセッシングをホストからデバイスへ移動させることで、固有ベクトルを含む cusolverDnXgeev の性能が向上しました。
- cuSOLVERDn における極分解のための QDWH アルゴリズム実装を公開するパブリックな 64 ビットインターフェース cusolverDnXpolar(13.2 U1 で利用可能)。
- 分割統治法を用いて対称三対角行列の固有値および任意の場合に固有ベクトルを計算するパブリックな 64 ビットインターフェース cusolverDnXstedc(13.2 U1 で利用可能)。
- 固有ベクトルのポストプロセッシングをホストからデバイスへ移動させることで、固有ベクトルを含む cusolverDnXgeev の性能が向上しました。
- cusolverDn[D,Z]syevj は低精度の事前条件付けを使用しており、これにより B200 上の中規模および大規模行列において通常 20% の計算時間短縮が達成され、FP32:FP64 比が大きい GPU ではさらに大きな改善が見られます。
CCCL
CUDA 13.3 には CCCL 3.3 が同梱されています。主な新機能として、DLPack/mdspan の相互運用性、包括的な乱数分布ライブラリ、新しい検索および分割スキャンアルゴリズム、そして柔軟な N から M への変換機能が挙げられます。
テンソル相互運用性
深層学習フレームワークはテンソルを介して通信しますが、CUDA C++ コードではしばそレベルが低く、生ポインタ、形状、ストライド、手書きのインデックス処理が必要となります。CCCL により、Python フレームワークと CUDA C++ の境界間でもそのテンソル構造を維持しやすくなります。DLPack 相互運用性を利用することで、PyTorch、JAX、CuPy などのフレームワークからのテンソルを cuda::to_device_mdspan を用いて cuda::std::mdspan ビューに変換し、C++ カーネルで使用できるようになります。また、cuda::std::mdspan ビューは cuda::to_dlpack_tensor を用いて DLPack 形式へ再度変換することも可能です。
CCCL はまた、カーネル内部のテンソルビューモデルを cuda::shared_memory_mdspan を通じて拡張します。共有メモリをフラットなバッファとして扱うのではなく、開発者は共有メモリのタイルに対して多次元ビューを作成でき、インデックス付けが明確になり、エラーが発生しにくくなります。また、この共有メモリ特化型はアドレス空間の安全性チェックを提供し、共有メモリのロード/ストア命令を保証します。
乱数分布
CCCL 3.3 は <cuda/std/random> に包括的なデバイス互換乱数分布セットを追加し、libcu++ を C++ 標準ライブラリの <random> ヘッダーとほぼ同等のレベルに引き上げました。CCCL 3.3 では、17 の包括的な乱数分布(一様分布、正規分布、ポアソン分布、ベルヌーイ分布)が提供されます。さらに、CCCL 3.3 は C++26 から C++17 へ cuda::std::philox4x32 および cuda::std::philox4x64 エンジンをバックポートし、<cuda/random> に cuda::pcg64 を拡張として追加しました。PCG64 は Numpy のデフォルトの擬似乱数生成器(PRNG)であり、品質とパフォーマンスの良好なバランスを提供します。
#include <cuda/random>
#include <cuda/std/random>
__global__ void sample_kernel() {
cuda::pcg64 rng(threadIdx.x);
cuda::std::normal_distribution<float> dist(0.0f, 1.0f);
float sample = dist(rng);
}
検索:cub::DeviceFind::FindIf
CCCL 3.3 は、述語を満たす最初の要素を見つけるための新しい光速デバイス全体検索アルゴリズムである cub::DeviceFind::FindIf を追加しました。
cub::DeviceFind::FindIf(
d_temp, temp_bytes, input, output,
[] __device__ (int value) {
return value > 42;
}, num_items);
このアルゴリズムは、CCCL 3.2 で使用されていた検索実装と比較して最大 7 倍の高速化を実現し、thrust::find_if、thrust::all_of、thrust::any_of、thrust::none_of、thrust::equal、thrust::mismatch、thrust::is_sorted、thrust::partition_point などを含む Thrust の検索および述語照会アルゴリズムを加速します。
image*図 1. CCCL 3.2 と CCCL 3.3 の新しい thrust::find_if を比較した正規化された実行時間*
CCCL 3.3 に含まれるその他の新アルゴリズムは以下の通りです。
- セグメントスキャン: cub::DeviceSegmentedScan は、並列スキャンのセグメント版を提供し、複数の独立したセグメントにわたってスキャン操作を効率的に計算します。
- バイナリ検索: cub::DeviceFind::LowerBound / UpperBound は、順序付けられたシーケンス内の複数の値に対して並列検索を実行します。
- トランスフォーム: cub::DeviceTransform は now、N 個の入力シーケンスを M 個の出力シーケンスに変換する機能をサポートしています。
C++23 サポート:nvcc および nvrtc における完全な C++23 インテグレーションにより、開発者は最新の言語標準を利用できるようになります。本リリースは CUDA の開発体験を近代化し、コードベースが現代の標準と整合性を持つように保証すると同時に、クロスプラットフォーム間の移植性を大幅に向上させます。
- 改善された nvrtc の出典即利用型エクスペリエンス:標準的な CUDA C++ ヘッダーをバンドルすることで、NVRTC はランタイムコンパイルプロセスを簡素化し、事前設定の要件を削減します。この更新により include パスの管理が容易になり、移植性が高く堅牢なランタイムコンパイルワークフローの迅速な実現が可能になります。
- nvcc への nvprune の統合:コンパイラ内に直接プルーニング機能を組み込むことで、アーティファクト管理をより効率的に行い、マルチアーキテクチャ展開を簡素化できます。
CUDA 13.3 のさらなる強化機能
CUDA 13.3 におけるその他の強化機能については、本セクションで詳しく解説します。
MPS の部分的エラー隔離
MPS は部分的なエラー隔離のサポートを追加しました。この機能を使用すると、CUDA ドライバはエラーを障害を起こしたパーティションまたはクライアントに特定し、そのクライアントの処理を終了させることができますが、障害の原因となっていない他のパーティション内の他のクライアントは終了されません。この機能の使用方法については、リリースノート を参照してください。
既存グラフへのグラフ再キャプチャの有効化
CUDA グラフにおいて、新しい API cudaStreamBeginRecaptureToGraph() を使用すると、既存のソースグラフに対してストリームキャプチャを開始できるようになります。グラフが再キャプチャされる際、更新されたノードパラメータは既存のノード内で自動的に反映されます。
Green コンテキストにおけるデフォルトストリームの作成はオプションとなりました
CUDA ドライバー API で使用される Green コンテキストでは、CU_GREEN_CTX_DEFAULT_STREAM フラグを介してデフォルト(NULL)ストリームを作成する必要がなくなりました。このストリームの作成は現在、オプションとなっています。
NVML が非アクティブなリマップ済み行を報告
新しい NVML API である nvmlDeviceGetRemappedRows_v2 を使用すると、非アクティブな行のリマッピング数を取得できます。一方、従来の API である nvmlDeviceGetRemappedRows は、現在アクティブな行のリマッピング数のみを返すようになりました。
mmap() サポートが追加されました
今回のリリースでは mmap() のサポートが拡張され、GDRCopy カーネルドライバーのインストールが不利となる環境においても、離散 GPU メモリの低遅延 CPU マッピングを提供可能になりました。
始め方
CUDA Toolkit 13.3 をダウンロードして、今日から使い始めてください。
謝辞
*NVIDIA の貢献者である Andy Terrel, Rob Armstrong, Jackson Marusarz, Becca Zandstein, Mridula Prakash, Daniel Rodriguez, Georgii Evtushenko に感謝します。*
原文を表示
NVIDIA CUDA 13.3 brings new capabilities and performance optimizations to developers across the CUDA ecosystem. The launch of NVIDIA CUDA Tile programming in C++, enables high-level, tile-based kernel development that automatically manages complex low-level GPU details for optimal performance and portability. Additionally, CUDA Tile programming is now supported on Compute Capability 9.0 (NVIDIA Hopper) GPUs in addition to all other supported GPU architectures.
We are also releasing CUDA Python 1.0, solidifying the support and stability of the CUDA Python SW ecosystem, and introducing critical features like green contexts and process checkpointing.
For performance enthusiasts, the newly launched NVIDIA CompileIQ compiler auto-tuning framework delivers up to a 15% speedup on critical kernels like GEMM and attention. This release also features official C++23 support in NVCC, expanded tensor interoperability with DLPack/mdspan in CCCL 3.3, and numerous updates to the math libraries (cuBLAS, cuSPARSE, cuSOLVER) and profiling tools (Nsight Compute and Nsight Systems).
Release of CUDA Tile C++
With the release of CUDA 13.3, CUDA Tile support is extended to C++, enabling the large existing C++ codebase and developer base to create highly-optimized GPU tile kernels. This model automates parallelism, memory movement, asynchrony, and other low-level details, resulting in C++ code that is portable across NVIDIA GPU architectures. For more information, check out our blog post.
Release of CUDA Python 1.0
CUDA Python is a set of libraries that expose CUDA to the Python programming language. By providing the 1.0 release, we are committing to semantic versioning: ensuring breaking API changes only during major-version releases. Minor releases add features and patch releases are bug fixes. Any public API scheduled for removal is first deprecated in a minor release with a clear replacement path.
The following is more information on the software components included in CUDA Python 1.0.
cuda.coop is also available in the cuda-cccl package under the _experimental namespace, which is subject to API changes. cuda.coop provides the reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels.
cuda.core is now stable
cuda.core provides a Pythonic interface to the CUDA runtime, including devices, streams, programs, linkers, memory resources, and graphs. Version 1.0 consolidates APIs that have been stabilizing over the previous release cycles into a single supported surface. At the same time, we added support for green contexts, CUDA checkpointing, and more.
- Green contexts: Split a GPU’s SMs into disjoint partitions, each with its own context and streams, so latency-sensitive kernels are shielded from long-running throughput kernels in the same process.
- Process checkpointing: Snapshot the full CUDA state of a running process—including device allocations, streams, context—and restore it later. Unlocks CRIU-style workflows for GPU processes: fault-tolerant long jobs, preemption and migration on shared clusters, and fast warm-start of inference workers. Only available in Linux.
- Inter-process sharing (IPC): Share GPU memory across Python processes without copying through the host. One process allocates, and others map the same physical VRAM into their own address space. Ideal for multi-process ML serving and zero-copy producer/consumer pipelines.
The following are quick examples of how to use cuda.core APIs.
from cuda.core import Device, Stream, Program, ProgramOptions, LaunchConfig, launch
dev = Device()
dev.set_current()
stream = dev.create_stream()
prog = Program(src, code_type="c++", options = ProgramOptions(arch=f"sm_{dev.arch}"))
kernel = prog.compile("cubin").get_kernel("my_kernel")
launch(stream, LaunchConfig(grid=64, block=256), kernel, *args)
from cuda.core import Linker, LinkerOptions
module = Linker(
[obj1, obj2],
options=LinkerOptions(arch=f"sm_{dev.arch}")
).link("cubin")
from cuda.core import ProgramOptions
opts = ProgramOptions(std="c++17", arch=f"sm_{dev.arch}", create_pch=True, pch_dir="/tmp/pch")
from cuda.core import DeviceMemoryResource, PinnedMemoryResource, PinnedMemoryResourceOptions, ManagedMemoryResource, ManagedMemoryResourceOptions
pinned = PinnedMemoryResource(PinnedMemoryResourceOptions(numa_id=0))
from cuda.core.graph import GraphBuilder, GraphDef
gb = stream.create_graph_builder()
gb.begin_building()
graph = gb.end_building().complete()
graph.launch(stream)
gdef = GraphDef()
gdef.add_kernel_node(kernel, LaunchConfig(grid=64, block=256), args=args)
from cuda.core import DeviceMemoryResource, DeviceMemoryResourceOptions
mr = DeviceMemoryResource(dev,
options=DeviceMemoryResourceOptions(max_size=1 << 20, ipc_enabled=True))
buffer = mr.allocate(nbytes)
from cuda.core import ContextOptions, SMResourceOptions
sm = dev.resources.sm
long_grp, crit_grp = sm.split(SMResourceOptions(count=(sm.sm_count - 16, 16)))[0]
ctx_crit = dev.create_context(ContextOptions(resources=[crit_grp]))
s_crit = ctx_crit.create_stream()
from cuda.core import checkpoint
proc = checkpoint.Process(os.getpid())
proc.lock(timeout_ms=5000)
proc.checkpoint()
proc.restore()
proc.unlock()
from cuda.core import StridedMemoryView, TensorMapDescriptor
tmap = StridedMemoryView(tensor).as_tensor_map(box_shape=(128,))
from cuda.core.utils import StridedMemoryView
view = StridedMemoryView(torch_tensor); capsule = view.__dlpack__()
from cuda.core import system
print(system.num_devices, system.driver_version)
from cuda.bindings import nvml
nvml.init()
name = nvml.device_get_name(nvml.device_get_handle_by_index_v2(0))
from cuda.bindings import nvfatbin
handle = nvfatbin.create()
CCCL Python release 1.0.0: cuda.compute
cuda.compute brings the CUDA Core Compute Libraries (CCCL)’s highly tuned parallel algorithms—sort, scan, reduce, transform, unique, histogram, top-k, and more—to Python as host-callable building blocks. Changes since the last release include:
- Python lambdas can be used as algorithm operators, reducing boilerplate for simple reductions, scans, transforms, and predicates.
- Algorithms support operators with side effects (state), enabling use cases like running accumulators and conditional transforms.
- New cuda.compute.upper_bound and cuda.compute.lower_bound APIs expose CUB’s parallel binary search to Python.
- Consolidated caching across all algorithms for faster repeated invocations.
import cuda.compute
from cuda.compute import OpKind
d_input = cp.arange(1, 1_000_001, dtype=cp.int32)
d_output = cp.empty(1, dtype=cp.int32)
h_init = np.array([0], dtype=np.int32)
cuda.compute.reduce_into(
d_input, d_output, OpKind.PLUS, d_input.size, h_init
)
cuda.compute.reduce_into(
d_input, d_output,
lambda a, b: a if a > b else b,
d_input.size, h_init,
)
cuda.coop exposes CCCL’s warp-wide and block-wide cooperative primitives for use inside Numba CUDA kernels. At the moment, this module is under the _experimental namespace and may have API changes that don’t follow semantic versioning.
from numba import cuda
from cuda.coop._experimental import block, warp
THREADS = 128
block_sum = coop.block.make_sum(numba.int32, THREADS)
@cuda.jit(link=block_sum.files)
def reduce_kernel(data, out):
total = block_sum(data[cuda.threadIdx.x])
if cuda.threadIdx.x == 0:
out[0] = total
h_in = np.ones(THREADS, dtype=np.int32)
d_in = cuda.to_device(h_in)
d_out = cuda.device_array(1, dtype=np.int32)
reduce_kernel[1, THREADS](d_in, d_out)
assert d_out.copy_to_host()[0] == THREADS
New Numba CUDA MLIR backend
Numba CUDA MLIR is a new Numba-compatible kernel generator for Python, written from the ground up on top of MLIR and the modern NVVM toolchain. It preserves the familiar @cuda.jit programming model from Numba-CUDA while delivering lower compile latency, better diagnostics, and a cleaner path to target new GPU architectures and features as they land in the NVVM stack. Numba CUDA MLIR can be used as a drop-in replacement for numba.cuda by simply replacing the import statement:
from numba import cuda
from numba_cuda_mlir import cuda
@cuda.jit
def vector_add(a, b, out):
i = cuda.grid(1)
if i < out.shape[0]:
out[i] = a[i] + b[i]
Beyond existing Numba-CUDA compatibility Numba CUDA MLIR also features:
- Faster JIT compile. Across a suite of real kernels (vector add, softmax, Cholesky, attention, Black-Scholes, FFT, matmul), warm JIT compile times are ~1.4x faster on geomean and up to ~2x faster on individual kernels versus Numba-CUDA.
- Lower launch latency. Host-side kernel dispatch overhead drops by roughly 2-3.5x for typical kernels and up to ~17x for kernels with many scalar arguments, where argument packing previously dominated.
You can test Numba CUDA MLIR 0.3 by installing it from PyPI numba-cuda-mlir[cu13] and follow its development on GitHub.
Try CUDA Python today
Install the CUDA Python stack directly from PyPI:
pip install cuda-python cuda-cccl numba-cuda-mlir[cu13]
This pulls in cuda.bindings 13.3.0, cuda.core 1.0.0, cuda.compute 1.0.0, along with cuda-pathfinder for library discovery.
CompileIQ launched
A new compiler auto-tuning framework for maximum performance on GPU kernels called CompileIQ, launches with CUDA 13.3. GPU compilers apply generic optimization heuristics that are broadly effective but aren’t necessarily optimal for specific kernels. CompileIQ flips this dynamic by using evolutionary and genetic algorithms to generate specialized compiler configurations custom-tailored to each kernel.
This unlocks extra performance. For example, for critical kernels like GEMM and attention, which account for over 90% of LLM inference compute, CompileIQ delivers up to a 15% speedup on already-optimized Triton attention and CUTLASS GEMM kernels. Read more about CompileIQ, including how it works and how to use it, in this blog post.
Math libraries
Core CUDA math libraries in CUDA 13.3 include several new features and notable performance improvements available, including:
- cuSPARSE:
Support for CSC format in SpSV and SpSM.
- Support for mixed precision in SpMVOp.
- Support for mixed index type (64-bit offset, 32-bit index) CSR matrix in SpMvOp computation
- Improved cusparseSpMVOp_createDescr() performance by 2.5x.
- Introduced new API SPMVOP_ALG1, which supports:
Updating matrix values while maintaining the same sparsity pattern.
- Optimized buffer size.
- Reduced preprocess overhead.
- cuBLAS:
CUDA green context support.
- Performance improvement to FP4 matmuls on NVIDIA Blackwell Ultra.
- Performance improvement to TF32 matmuls on NVIDIA Blackwell and Blackwell Ultra.
- SYMV performance improvements for NVIDIA Hopper, Blackwell, and Blackwell Ultra.
- Improved user experience for FP64 emulated matmuls by enforcing a fixed workspace size that is constant across the problem space.
- cuSOLVER:
A 64-bit interface cusolverDnXpolar exposes the QDWH algorithm implementation for polar decomposition in cuSOLVERDn
- A 64-bit interface cusolverDnXstedc, which computes the eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix using the divide and conquer method
- Performance improvements for cusolverDnXgeev with eigenvectors by moving the eigenvector post-processing from the host to the device.
- Public 64-bit interface cusolverDnXpolar, which exposes the QDWH algorithm implementation for polar decomposition in cuSOLVERDn (available in 13.2 U1).
- Public 64-bit interface cusolverDnXstedc, which computes the eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix using the divide and conquer method (available in 13.2 U1).
- Performance improvements for cusolverDnXgeev with eigenvectors by moving the eigenvector post-processing from the host to the device.
- cusolverDn[D,Z]syevjuses low-precision preconditioning, which typically improves the time-to-solution by 20% for mid-sized and large matrices on B200, and by even more on GPUs with a large FP32: FP64 ratio.
CCCL
CUDA 13.3 ships with CCCL 3.3. Highlights include DLPack/mdspan interoperability, a comprehensive random number distribution library, new search and segmented scan algorithms, and a flexible N-to-M transform.
Tensor interoperability
Deep learning frameworks speak in tensors, but CUDA C++ code often has to work one level lower—raw pointers, shapes, strides, and hand-written indexing. CCCL makes it easier to preserve that tensor structure across the boundary between Python frameworks and CUDA C++. With DLPack interoperability, tensors from frameworks such as PyTorch, JAX, and CuPy can be converted into cuda::std::mdspan views with cuda::to_device_mdspan for use in C++ kernels, and cuda::std::mdspan views can be converted back to DLPack with cuda::to_dlpack_tensor.
CCCL also extends this tensor-view model inside kernels with cuda::shared_memory_mdspan. Instead of treating shared memory as a flat buffer, developers can create multi-dimensional views over shared-memory tiles, making indexing clearer and less error-prone. The shared-memory specialization also provides address-space safety checks and guarantees shared-memory load/store instructions.
Random number distributions
CCCL 3.3 adds a comprehensive set of device-compatible random distributions to <cuda/std/random>, bringing libcu++ to near-parity with the C++ standard library’s <random> header. CCCL 3.3 brings a comprehensive set of 17 random uniform, normal, Poisson, and Bernoulli distributions. In addition, CCCL 3.3 backports the cuda::std::philox4x32 and cuda::std::philox4x64 engines from C++26 to C++17 and adds cuda::pcg64 as an extension in <cuda/random>. PCG64 is the default PRNG in Numpy and provides a good balance between quality and performance.
#include <cuda/random>
#include <cuda/std/random>
__global__ void sample_kernel() {
cuda::pcg64 rng(threadIdx.x);
cuda::std::normal_distribution<float> dist(0.0f, 1.0f);
float sample = dist(rng);
}
Search: cub::DeviceFind::FindIf
CCCL 3.3 adds cub::DeviceFind::FindIf, a new speed-of-light device-wide search algorithm for finding the first element that satisfies a predicate.
cub::DeviceFind::FindIf(
d_temp, temp_bytes, input, output,
[] __device__ (int value) {
return value > 42;
}, num_items);
This algorithm delivers up to 7x speedup compared to the search implementation used in CCCL 3.2 and accelerates Thrust’s search and predicate-query algorithms, including thrust::find_if, thrust::all_of, thrust::any_of, thrust::none_of, thrust::equal, thrust::mismatch, thrust::is_sorted, thrust::partition_point, and more.

More new algorithms in CCCL 3.3 include:
- Segmented scan: cub::DeviceSegmentedScan provides a segmented version of a parallel scan that efficiently computes a scan operation over multiple independent segments.
- Binary search: cub::DeviceFind::LowerBound / UpperBound performs a parallel search for multiple values in an ordered sequence.
- Transform: cub::DeviceTransform now supports transforming N input sequences into M output sequences.
Compilers/NVCC
C++23 support: Full C++23 integration in nvcc and nvrtc empowers developers to use the latest language standard.This release modernizes the CUDA development experience, ensuring codebase consistency with modern standards while significantly improving cross-platform portability.
- Enhanced nvrtc out-of-the-box experience: By bundling standard CUDA C++ headers, NVRTC streamlines the runtime compilation process and reduces prerequisite setup.This update simplifies include-path management, enabling faster implementation of portable and robust runtime compilation workflows.
- Integrated nvprune in nvcc: The inclusion of pruning capabilities directly within the compiler allows for more efficient artifact management and simplified multi-arch deployment.
More CUDA 13.3 enhancements
More enhancements in CUDA 13.3 are detailed in this section.
MPS partial error isolation
MPS has added support for partial error isolation. When using this feature, the CUDA driver can attribute the error to the faulting partition/client and terminate that client’s work, while other clients in other partitions that did not cause the fault won’t be terminated. For more info on how to use this feature, see the release notes.
Enable graph recapture to an existing graph
In CUDA graphs, a new API cudaStreamBeginRecaptureToGraph() enables you to initiate a stream capture into an existing source graph. As the graph is recaptured, any updated node parameters will be updated in the existing node.
Default stream creation is optional in green contexts
Green Contexts used in the CUDA Driver API no longer require the creation of the default (NULL) stream via the CU_GREEN_CTX_DEFAULT_STREAM flag. Creation of this stream is now optional.
NVML reports inactive remapped rows
A new NVML API, nvmlDeviceGetRemappedRows_v2, can acquire the number of inactive row remappings while the old API, nvmlDeviceGetRemappedRows, now returns only the number of active row remappings.
Added mmap() support
This release extends mmap() support, providing a low-latency CPU mapping of discrete GPU memory in environments where it may be disadvantageous to install GDRCopy kernel drivers.
Get started
Download CUDA Toolkit 13.3 and get started today.
Acknowledgments
*Thanks to NVIDIA contributors Andy Terrel, Rob Armstrong, Jackson Marusarz, Becca Zandstein, Mridula Prakash, Daniel Rodriguez, and Georgii Evtushenko.*
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み