Przejdź do treści
Biblioteka skilli
Programowanie · Analiza

kernel-profiling-nsight

/kernel-profiling-nsight

Profiluje pracę GPU w Nsight Systems i Nsight Compute: czyta oś czasu, nazywa klasę wąskiego gardła i wskazuje metrykę, która określa poprawkę.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Profiluje pracę GPU w Nsight Systems i Nsight Compute: czyta oś czasu, nazywa klasę wąskiego gardła i wskazuje metrykę, która określa poprawkę.

Oryginalny opis (EN)

Profile GPU work with Nsight Systems and Nsight Compute to read the timeline, name the bottleneck class, and pull the metric that dictates the fix. Use when a GPU program is slower than expected and you need evidence before touching a kernel.

Jak działa

  1. Method
  2. Litmus tests
  3. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 60 linii, 504 słów
Podgląd SKILL.md
---
name: kernel-profiling-nsight
description: Profile GPU work with Nsight Systems and Nsight Compute to read the timeline, name the bottleneck class, and pull the metric that dictates the fix. Use when a GPU program is slower than expected and you need evidence before touching a kernel.
---

# Kernel profiling with Nsight

The two tools split the job cleanly: Nsight Systems shows the whole timeline of
where time goes across CPU, copies, and kernels, while Nsight Compute dissects
one kernel's internals. The common mistake is opening Compute first and missing
that the GPU sat idle 60 percent of the run waiting on the host. Profile
top-down, from timeline to kernel, so the change you make is the one costing
wall-clock time.

## Method

1. **Capture the whole run with Nsight Systems first.** Run `nsys profile -o out
   ./app` and open the report. Scan GPU utilization across the timeline: gaps
   between kernels mean the device is starved by host code, tiny launches, or a
   synchronous `cudaMemcpy`. Close idle time before optimizing any kernel.
2. **Annotate phases with NVTX ranges.** Wrap logical stages (data load,
   forward, backward) in `nvtxRangePush`/`nvtxRangePop` so the timeline reads
   as named bands instead of an undifferentiated wall of kernels. This makes
   the starved phase obvious at a glance.
3. **Name the bottleneck class before optimizing.** Every kernel is capped by
   one of three things: memory bandwidth, compute throughput, or latency from
   too little parallelism. Nsight Compute's Speed Of Light section reports
   Memory and Compute as percentages of peak; high memory and low compute is
   bandwidth-bound, both low is latency-bound and usually low occupancy.
4. **Capture the target kernel with the full set.** Run
   `ncu --set full -k kernel_name -c 1 ./app` to profile one invocation. Filter
   by name and count because profiling every launch is slow, and the full set is
   what lets the guided analysis rules fire.
5. **Read the metrics that name the fix, not raw counters.**
   `dram__throughput` and `sm__throughput` give the SOL split,
   `l1tex__t_sector_hit_rate` shows cache reuse, and low sectors-per-request
   flags uncoalesced loads. Warp State Statistics names the top stall: Long
   Scoreboard is waiting on memory, Barrier is `__syncthreads` contention.
6. **Follow the guided rules, change one thing, reprofile.** Compute prints
   findings like "uncoalesced global access" with an estimated speedup. Treat
   each as a lead, apply a single change, and reprofile, since a fix often
   shifts the bottleneck to a new class rather than removing it.
7. **Diff before and after to prove the win.** Open the two `.ncu-rep`
   files side by side and confirm both the targeted metric moved and
   kernel duration dropped. A counter that improved without cutting
   duration was not the bottleneck.

## Litmus tests

- Can you state memory-, compute-, or latency-bound with SOL percentages behind
  the claim?
- Did you rule out GPU idle time in Nsight Systems before opening a kernel?
- Does the profiler name a concrete stall reason rather than a vague "it's
  slow"?
- After the change, did kernel duration in the report actually fall?

## Boundaries

Nsight tells you where time goes and why a kernel stalls; it does not write the
faster kernel. Turning uncoalesced loads into coalesced ones is
cuda-kernel-basics; turning bandwidth-bound into compute-bound is
gpu-memory-hierarchy. Overhead from `ncu` is high, so profile a reduced input,
and never draw conclusions from a debug build.

Wersje

W bazie nie ma innych skilli o nazwie kernel-profiling-nsight.

Migawka bazy z 13.11.2026 · wersja paczki 37237fc96c07 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100nsys-optimizer
    Optymalizuje kod symulacji CUDA i GPU na podstawie profilowania NVIDIA Nsight Systems, wskazuje wąskie gardła i prowadzi całą pętlę optymalizacji, na przykład gdy jedna scena działa wolniej.
  • 90kernel-flow
    Prowadzi optymalizację kernela CUDA na GPU NVIDIA: pomiar wąskiego gardła w Nsight Compute i weryfikację poprawności.
  • 100cuda-profiling
    Prowadzi profilowanie CUDA w Nsight Systems i Nsight Compute: metryki roofline i zajętości oraz adnotacje faz przez NVTX.
  • 100perf-nsight-systems
    Obsługuje CLI Nsight Systems (nsys) do profilowania osi czasu systemu: profile, raporty .nsys-rep, nsys stats, bezczynność GPU i trening rozproszony z nakładaniem NCCL.
  • 100cuda-profiling
    Prowadzi profilowanie kerneli CUDA w Nsight Systems i Nsight Compute: modele roofline, kernele ograniczone pamięcią lub obliczeniami oraz znaczniki NVTX.
  • 100nvidia-tensorrt-llm-perf-nsight-systems
    Obsługuje CLI Nsight Systems (nsys) do profilowania osi czasu: nsys profile, analiza raportów .nsys-rep, nsys stats, diagnoza bezczynności GPU i nakładania NCCL w treningu rozproszonym.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.