0Pricing
CUDA Academy · Lección

Perfilar, optimizar y publicar

Cerrar el ciclo con métricas de Nsight

Perfilar, optimizar y publicar es una lección gratuita de CUDA Academy en CoddyKit. Esta es la lección 4 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de CUDA Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de CUDA Academy incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

Measure, Do Not Guess

Optimization starts with data, not hunches. Always profile first to learn where the time really goes before you change a single line. 🔍

Start With the Timeline

Open Nsight Systems to see the whole run: kernels, copies, and gaps. The timeline shows whether transfers and compute actually overlap.

Find the Hot Kernel

One stage usually dominates. The timeline reveals the longest-running kernel, and that is exactly where your tuning effort should go first.

Zoom In With Nsight Compute

For the hot kernel, switch to Nsight Compute. It reports per-kernel metrics like memory throughput, stalls, and achieved occupancy.

Read the Roofline

The roofline tells you if a kernel is memory-bound or compute-bound. That single answer decides which optimizations are even worth trying.

Fix Memory-Bound Kernels

If you are memory-bound, chase coalescing, shared-memory tiling, and vectorized loads. Feeding data faster is the only path to more speed.

Fix Compute-Bound Kernels

If you are compute-bound, raise ILP with unrolling, cut redundant math, or move to lower precision. Here the arithmetic units are the limit.

Label Your Code With NVTX

Wrap pipeline stages in NVTX ranges so the timeline shows named bars instead of anonymous kernels. Readable profiles are faster to debug.

nvtxRangePush("blur");
blurKernel<<<grid, block>>>(d_in, d_out);
nvtxRangePop();

Change One Thing at a Time

Apply a single optimization, then re-profile. This tight loop proves each change helped and stops you from chasing two effects at once.

Know When to Stop

When a kernel nears its roofline limit, more tuning yields little. Recognize diminishing returns and spend your time on the next bottleneck.

Validate, Then Ship

Before release, confirm correctness against a reference and check the speedup is stable. A fast but wrong pipeline is not shippable. 🚢

Quick Check

Nsight Compute says your hot kernel is memory-bound. Which fix should you try first?

Recap

You learned to profile with Nsight, read the roofline to classify kernels, apply targeted fixes one at a time, and validate before shipping a fast, correct pipeline. 🏁

Preguntas frecuentes

¿La lección «Perfilar, optimizar y publicar» es gratis?

Sí — el texto completo de «Perfilar, optimizar y publicar» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de CUDA Academy, actualiza a CoddyKit PRO. El curso de CUDA Academy incluye 4 lecciones en total.

¿Qué aprenderé en «Perfilar, optimizar y publicar»?

Cerrar el ciclo con métricas de Nsight Practicas CUDA Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar CUDA Academy?

No se requiere experiencia previa. CUDA Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 4 de 4.

¿Cuánto tiempo toma la lección «Perfilar, optimizar y publicar»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de CUDA Academy?

Sí. Cada lección de CUDA Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Diseño de la canalización de procesamiento
  2. Fusión de filtros en un solo kernel
  3. Procesamiento por bloques para imágenes grandes
  4. Perfilar, optimizar y publicar
← Volver a CUDA Academy