NVIDIA Nsight 開発ツールを用いたニューラル再構築パイプラインの最適化
NVIDIA は、Nsight 開発ツールを活用したニューラル再構築パイプラインの最適化手法を公開し、開発者のパフォーマンス向上とデバッグ効率化に寄与している。
キーポイント
Nsight ツールによる可視化とボトルネック特定
NVIDIA Nsight Systems と Nsight Compute を組み合わせることで、パイプライン全体のレイテンシや GPU/CPU の非同期実行におけるボトルネックを詳細に可視化する手法が紹介されている。
並列処理とデータ転送の最適化
ニューラル再構築プロセスにおいて、データ転送(PCIe)と計算処理のオーバーラップを実現し、GPU 利用率を最大化する具体的なコード変更例が示されている。
開発サイクルの短縮効果
従来の試行錯誤型デバッグから、データ駆動型の分析へ移行することで、パフォーマンスチューニングにかかる時間を大幅に削減できることが強調されている。
影響分析・編集コメントを表示
影響分析
この記事は、AI モデルの開発者が単なるモデル精度だけでなく、推論・トレーニングパイプライン全体の効率化を重視する動きを示しています。特に、NVIDIA のハードウェア性能を最大限引き出すためのツール活用事例として、開発現場のベストプラクティスとして広く参照される可能性があります。
編集コメント
モデルの精度向上だけでなく、インフラ側の最適化が製品化の成否を分ける重要な要素であることを再認識させる記事です。開発者がツールを使いこなすための具体的な指針として価値があります。
NVIDIA Omniverse NuRec は、カメラや LiDAR などのマルチセンサーデータから現実世界の環境の高忠実度な 3D レプリカを構築するためのニューラル再構成パイプラインです。これは、自動運転車 (AV) やロボティクスプラットフォームによってキャプチャされた動的シーンを、NVIDIA Omniverse および関連するシミュレーションワークフロー内でレンダリング、再生、分析可能なシミュレーション対応のデジタル環境として再構成するために使用されます。
これらの再構築は、物理 AI および自律システムの開発において重要な役割を果たします。エンジニアは現実世界の運転やロボティクスのシナリオをキャプチャし、環境を再構成した上で、そのシーンを検査または再生することができます。これにより、モデルの挙動をより深く理解したり、知覚結果を検証したり、合成視点データを生成したり、下流の機械学習ワークフロー用のトレーニングデータを作成したりすることが可能になります。
NuRec は、ガウシアンスプラッティングなどのニューラルレンダリング技術と、GPU 加速されたレンダリングおよびシミュレーションパイプラインを組み合わせることで、非常に現実的なシーン再構築を実現します。しかし、このレベルの忠実度には大きな計算コストが伴います。再構成およびレンダリングのワークロードには、大量のセンサーデータ、複雑な PyTorch ベースのトレーニングループ、GPU リソースを強く駆動する高度に専門化された CUDA カーネルが含まれています。
本記事では、NVIDIA Nsight Developer Tools を活用して NuRec ニューラル再構築パイプラインを最適化する例を紹介していきます。
パフォーマンス最適化の課題解決
NuRec ワークフローにおいてパフォーマンスは極めて重要です。なぜなら、再構築に要する時間がエンジニアの生産性に直接影響を与えるからです。一般的なワークフローでは、興味深いまたは問題のある AV(自動運転車)の実行記録を特定します。例えば、知覚や計画スタックが予期せぬ挙動を示したシナリオなどです。そして、エンジニアが可能な限り迅速にシーンを検査できるよう再構築を開始します。再構築に数時間待たされることは、反復作業とデバッグの速度を著しく低下させます。
この最適化取り組みの初期段階では、シーンや設定によっては、比較的短いキャプチャであっても再構築に 1 時間以上から数時間を要することがありました。チームの長期的な目標はさらに野心的で、30 秒間のキャプチャを約 30 秒で再構築できるリアルタイム再構築パフォーマンスの実現です。
パフォーマンスは再構築そのもの以外でも重要です。シーンが再構築された後、レンダリング専用のワークフローでは、強化学習(RL)、合成データ生成(SDG)、大規模シミュレーションのために膨大な数のフレームを生成することがあります。このスケールにおいて、わずかなパフォーマンスの向上も、GPU 使用時間とインフラコストの大幅な削減に直結します。
これらの課題に対処するため、NVIDIA のプロファイリングおよび最適化ツール、主に NVIDIA Nsight Systems と NVIDIA Nsight Compute を使用して NuRec ワークロードを分析し、ソフトウェアスタック全体にわたるボトルネックを特定するとともに、アプリケーションレベルのワークフローと基盤となる CUDA カーネルの両方を反復的に最適化しました。
Nsight Systems を用いたプロファイリングと最適化
Nsight Systems は、CPU、GPU、ストレージ、ネットワークなどを含むワークロードのパフォーマンス挙動やリソース利用率を可視化し理解するためのプラットフォームプロファイリングツールです。多くのパフォーマンス最適化ワークフローにおける最初のステップは、Nsight Systems プロファイルを実行してベースラインを確立し、初期のボトルネックまたは改善すべき主要領域を特定することです。
トレーニングループの最適化を目的として、Nsight Systems の組み込み関数サポートと PyTorch に含まれる NVIDIA Tools Extension SDK (NVTX) を使用し、図 1 に示す順伝播(フォワードパス)の単一イテレーションにズームインしました。当初の仮説では、レンダリングカーネルがランタイムの大部分を占め、最適化の最良の出発点になると考えていました。しかし、上部に表示された CUDA ハードウェア(HW)タイムラインは、GPU の大半の時間が未利用または全く使用されていないことを示していました。上部行に青色が表示されていない点にご注意ください。また、アプリケーションは予想よりもはるかに多くの小さなカーネルを使用していることもわかりました。
image*図 1. 順伝播(フォワードパス)の単一イテレーションに対する Nsight Systems プロファイルタイムライン*
この初期の発見の後、時間の消費箇所と GPU が未利用となっているフェーズを特定するために、順伝播(フォワードパス)の各フェーズをさらに深く掘り下げる必要がありました。さまざまなフェーズや関数を区別するために、コードに追加の NVTX アノテーションを追加しました。新しいプロファイル(図 2)では、レンダリングが開始される前に collect_gaussian_parameters が時間の大部分を占めており、順伝播(フォワードパス)ごとに複数回呼び出されていることが示されました。
image*図 2. 実行時間の大部分を占める collect_gaussian_parameters の特定*
さらに深く掘り下げたところ、最も時間を要しているのは interpolate 関数(4.148 ms)であり、GPU を重くする多数の小さなカーネルやメモリ操作を呼び出していることがわかりました。これは図 3 の下部にある CUDA API 行で確認できます。
image*図 3. 最適化の機会として、interpolate 関数の多数の小さなカーネルを特定*
私たちは interpolate 関数下のコードを検討し、小さなカーネルを融合させて GPU により大きな作業チャンクを提出することに注力しました。その結果、これらすべての作業を単一のカーネルに凝縮することができ、interpolate 関数の実行時間を 4.184 ms から 83.81 μs(マイクロ秒)に短縮できました(図 4)。これはほぼ 50 倍の高速化です。
image*図 4. CUDA API 行に単一の融合カーネルを備えた interpolate 関数*
次に、GPU が稼働している間に CPU が多数の小さなカーネルをキューに追加するのを遅らせていた長い cudaStreamSynchronize API(タイムライン上で緑色のバーとして表示)を特定しました。これにより、同期 API の戻り値後に小さなカーネルがスケジュールされて起動された後、上部の CUDA ハードウェア行に示されるような、GPU 利用率が不均一な状態が生じました(図 5)。
image*Figure 5. Long cudaStreamSynchronize (bottom green row) followed by patchy GPU execution (top blue row)*
同期ポイントを1つ削除すると、その先の他のポイントがボトルネックとなりました。このプロセスを繰り返し、CPU が GPU で作業中であっても効率的に仕事をキューに追加できるまで十分な数の同期ポイントを削除しました。これにより、小さなカーネルは CPU の起動時間による制約から解放されたため、コンパクトに実行できるようになりました。
image*Figure 6. Compact GPU utilization (top blue row) after synchronization points removed*
パラメータ収集に要する時間を短縮し、ボトルネックを引き起こしていた同期ポイントを削除したことで、一部のカーネル最適化に取り組むことが可能になりました。Nsight Systems を使用すれば、どのカーネルが最もホット(高負荷)であるかを特定できます。この場合、renderBackward カーネルは明らかに最有力候補でした。
image*図 7. Nsight Systems における実行時間上位のカーネル*
Nsight Compute を用いたカーネル最適化
Nsight Compute は、個々のカーネルのプロファイリングと最適化に最適なツールです。このツールは、さまざまな種類のハードウェアカウンター、ソフトウェアパッチング、および計測機能を用いて、非常に微細な粒度で大量のパフォーマンスデータを収集するためにカーネルを自動的に再実行できます。また、ユーザーが問題の特定と理解を支援するための組み込みルールシステムとガイド付き分析機能を備えています。
renderBackward カーネルは、カメラデータと LiDAR データの両方の処理で使用されています。Nsight Compute でこのカーネルの複数のインスタンスをプロファイリングした結果、その稼働率(occupancy)は約 15% しかないことが明らかになり、また、どの入力データを処理しているかによって、このカーネルの動作やリソース要件が著しく異なることも判明しました。
最も実行時間の長い 3 つの renderBackward カーネルは LiDAR データに由来し、残りの 3 つはカメラデータに由来しています。これらの違いにもかかわらず、両方のケースでスレッドあたり 167 のレジスタが割り当てられていました(図 8)。
image*図 8. Nsight Compute でプロファイリングされた renderBackward カーネルの 6 インスタンス*
トップの LiDAR カーネルを Nsight Compute ベースライン として設定し、カメラカーネルと比較したところ、両者ともアクセスの大半が共有メモリ内で行われていたものの、LiDAR とカメラの両方のカーネルインスタンスがブロックあたり同じ量の共有メモリを静的に割り当てていたにもかかわらず、カメラカーネルは約 75% 少ないリクエストを行っていたことが自動的に明らかになりました。
image*図 9. LiDAR とカメラデータカーネルにおける共有メモリアクセスの違い*
renderBackward カーネルがカメラデータに使用された場合と LiDAR データに使用された場合のこれらの動作の違い、およびレジスタと共有メモリの割り当てが両者で静的かつ同一であるという事実を踏まえ、次のステップとして、処理対象がカメラデータか LiDAR データかに応じてカーネルを分割することを試みました。
各バージョンのカーネルについて、チームは launch_bounds 修飾子とブロックあたりに割り当てる共有メモリの量を用いて実験し、レジスタ割り当てを調整しました。cudaFuncSetCacheConfig ランタイム API を使用して、両カーネルの優先設定を「より大きな共有メモリとより小さな L1 キャッシュ」とするように変更しました。
このテストと最適化の後、LiDAR とカメラのカーネルはそれぞれレジスタ割り当ての必要量を 167 から 64、128 に削減し、両方とも当初割り当てられた共有メモリの約半分でも効率的に実行可能となりました。これにより、occupancy(利用効率)が約 15% から 30-50% の範囲に向上し、全体の実行時間が大幅に短縮されました。最も長い LiDAR カーネルの実行時間は 31 ms から 18 ms に減少しています。
<img src="https://developer-blogs.nvidia.com/wp-content/uploads/2026/06/nsight-compute-summary-renderbackward-kernel.webp" decoding="async" width="1866" height="242" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" data-src="https://developer-blogs.nvidia.com/wp-content/uploads/2026/06/nsight-compute-summary-renderbackward-kernel.webp" alt="Nsight Compute summary p
原文を表示
NVIDIA Omniverse NuRec is a neural reconstruction pipeline for building high-fidelity 3D representations of real-world environments from multisensor data such as cameras and lidar. It is used to reconstruct dynamic scenes captured by autonomous vehicle (AV) and robotics platforms into simulation-ready digital environments that can be rendered, replayed, and analyzed inside NVIDIA Omniverse and related simulation workflows.
These reconstructions play a critical role in the development of physical AI and autonomous systems. Engineers can capture a real-world driving or robotics scenario, reconstruct the environment, and then inspect or replay the scene. This enables them to better understand model behavior, validate perception results, generate synthetic viewpoints, or create training data for downstream machine learning workflows.
NuRec combines neural rendering techniques such as Gaussian splatting with GPU-accelerated rendering and simulation pipelines to produce highly realistic scene reconstructions. However, this level of fidelity comes with significant computational cost. Reconstruction and rendering workloads involve large volumes of sensor data, complex PyTorch-based training loops, and highly specialized CUDA kernels that push GPU resources heavily.
This post walks through an example to showcase how to optimize the NuRec neural reconstruction pipeline using NVIDIA Nsight Developer Tools.
Solving performance optimization challenges
Performance is critical for NuRec workflows because reconstruction turnaround time directly impacts engineering productivity. A common workflow involves identifying an interesting or problematic AV run—for example, a scenario where the perception or planning stack behaved unexpectedly—and launching a reconstruction so engineers can inspect the scene as quickly as possible. Waiting several hours for reconstruction slows iteration and debugging velocity significantly.
At the start of this optimization effort, reconstructing even relatively short captures could take from over an hour to several hours depending on the scene and configuration. The team’s long-term goal is much more ambitious: real-time reconstruction performance, where a 30-second capture can be reconstructed in approximately 30 seconds.
Performance also matters beyond reconstruction itself. Once scenes have been reconstructed, rendering-only workflows may generate massive numbers of frames for reinforcement learning (RL), synthetic data generation (SDG), and large-scale simulation. At this scale, even modest performance improvements can translate directly into substantial reductions in GPU time and infrastructure cost.
To tackle these challenges, NVIDIA profiling and optimization tools were used, primarily NVIDIA Nsight Systems and NVIDIA Nsight Compute, to analyze the NuRec workload, identify bottlenecks across the software stack, and iteratively optimize both the application-level workflow and the underlying CUDA kernels.
Profiling and optimization using Nsight Systems
Nsight Systems is a platform profiling tool to help you visualize and understand the performance behavior and resource utilization of workloads, including CPU, GPU, storage, networking, and more. The first step in many performance optimization workflows is to run an Nsight Systems profile to establish a baseline and try to identify some initial bottlenecks or key areas for improvement.
With the goal of optimizing the training loop, we used the Nsight Systems built-in function support and NVIDIA Tools Extension SDK (NVTX) included in PyTorch to zoom into a single iteration of the forward pass shown in Figure 1. The initial assumption was that the rendering kernel would take most of the runtime and would be the best starting point for optimization. However, the CUDA HW timeline at the top revealed that the majority of time the GPU was underutilized or not used at all. Notice the lack of blue on the top row. The application was also using many more tiny kernels than was expected.

After this initial realization, it was important to drill deeper into the phases of the forward pass to identify where time was being spent and what phases were underutilizing the GPU. Additional NVTX annotations were added to the code to delineate various phases and functions. A new profile (Figure 2) showed that collect_gaussian_parameters was taking the majority of the time before rendering even started and is called multiple times in each forward pass.

Digging even deeper revealed the interpolate function taking the plurality of the time (4.148 ms) and calling many small kernels and memory operations that bogged down the GPU, as seen in the bottom CUDA API row in Figure 3.

We dug into the code under the interpolate function and focused on fusing the small kernels and submitting larger chunks of work to the GPU. We were able to condense all of this work into a single kernel that reduced the interpolate function from 4.184 ms to 83.81 us (Figure 4). This is nearly a 50x speedup.

Next we identified long cudaStreamSynchronize APIs (visible as green bars on the timeline) that were delaying the CPU from enqueuing many small kernels while the GPU was active. This resulted in patchy GPU utilization shown in the top CUDA HW row after the synchronize API returned as the small kernels were scheduled and launched (Figure 5).

After removing one synchronization point, others down the line would become the bottleneck. This process was continued until enough were removed that the CPU could efficiently enqueue work while the GPU was busy. This allowed the tiny kernels to run compactly because they were no longer CPU launch-time bound.

Reducing the time spent collecting the parameters and removing synchronization points that were causing bottlenecks enabled digging into some kernel optimizations. Nsight Systems enables you to identify which kernels are the hottest. The renderBackward kernel was clearly the top candidate in this case.

Kernel optimization using Nsight Compute
Nsight Compute is the best tool for profiling and optimizing individual kernels. It can automatically replay kernels to collect large amounts of performance data at very fine granularities using various types of hardware counters, software patching, and instrumentation. It includes a built-in rule system and guided analysis to help users identify and understand issues.
The renderBackward kernel is used in both camera and lidar data processing. Profiling multiple instances of this kernel with Nsight Compute revealed that it has only ~15% occupancy and the behavior and resource requirements of this kernel differ significantly depending on which of these inputs is being processed.
The longest three renderBackward kernels are from lidar data and the other three are from camera data. Despite these differences, both were allocating 167 registers per thread (Figure 8).

Setting the top lidar kernel as an Nsight Compute baseline and comparing a camera kernel automatically revealed that while both had the vast majority of accesses in shared memory, the camera kernels were making ~75% fewer requests even though both lidar and camera instances of the kernel were allocating the same amount of shared memory per block statically.

Noting these behavior differences between whether the renderBackward kernel was used for camera or lidar data, and the fact that register and shared memory allocations were static and identical for both, the next step was to try splitting the kernel depending on whether it was processing camera or lidar data.
For each version of the kernel, the team experimented and tuned register allocations with the launch_bounds qualifier and the amount of shared memory we were allocating per block. The cudaFuncSetCacheConfig runtime API was used to set the preference of both kernels to have a larger shared memory and smaller L1 cache.
After this testing and optimization, the lidar and camera kernels decreased their register allocation needs from 167 to 64 and 128 respectively and both were able to run efficiently with about half of the originally allocated shared memory. This improved occupancy from ~15% to between 30-50% and overall runtime significantly, with the longest lidar kernel decreasing from 31 ms to 18 ms.
<img src="https://developer-blogs.nvidia.com/wp-content/uploads/2026/06/nsight-compute-summary-renderbackward-kernel.webp" decoding="async" width="1866" height="242" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" data-src="https://developer-blogs.nvidia.com/wp-content/uploads/2026/06/nsight-compute-summary-renderbackward-kernel.webp" alt="Nsight Compute summary p
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み