by
Comunidado
Como construir uma rede neural no
Azure Machine Learning com a
tecnologia CUDA da NVIDIA
Walter Coan
by Comunidado
Joinville 05 de abril 2025
10 anos
Walter Silvestre Coan
www.linkedin.com/in/waltercoan/
• Microsoft MVP na categoria Internet das Coisas
• Mestre em Sistemas Distribuídos e Redes de sensores sem fio PUCPR
• Instrutor autorizado Microsoft, AWS, NVIDIA na Ka Solution
• Professor universitário a 19 anos
Agenda
• NVIDIA CUDA
• Azure Machine Learning
• GPU Kernels
• Rede Neural Profunda (Deep Neural Network)
CUDA
• Compute Unified Device Architecture (2006)
• Plataforma de computação por paralelização
• Permite acelerar o processamento de dados
utilizando GPU (Graphics Processing Units)
• API (Application Program Interface)
• Camada de Software (drivers, bibliotecas,
compiladores) que permite a execução de instruções
pela GPU de forma paralela (kernels)
CPU x GPU
• Central Processing Unit x Graphical Processing Unit
DRAM
L3 Cache
L2 Cache L2 Cache
Core
L1 Cache
Con
trol
Core
L1 Cache
Con
trol
Core
L1 Cache
Con
trol
Core
L1 Cache
Con
trol
DRAM
L1 Cache
Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
CPU x GPU
https://www.youtube.com/watch?v=-P28LKWTzrI
NVIDIA Hopper
H100
Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
NVIDIA Hopper
H100
• 8 GPC Graphics Processing Clusters
Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
NVIDIA Hopper
H100 • 8 GPC Graphics Processing Clusters
• 18 SM Stream Multiprocessor por GPC
• 144 SMs por GPU
• 128 FP32 CUDA Cores por SM,
• 18432 FP32 CUDA por GPU
• 4 fourth-generation Tensor Cores por SM
• 576 por GPU
• 6 HBM3 or HBM2e stacks, 12 512-bit memory
controllers
• 60 MB L2 cache
• Fourth-generation NVLink and PCIe Gen 5
Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
NVIDIA Hopper
H100
• SIMT – Single Instruction Multiple Threads
• Cada instrução e feita por uma Thread
• Cada thread possui seu próprio Program Counter
• Cada Thread é executada um core CUDA
• Theads são agrupadas em grupos de 32 chamadas de Warps
• Warps são agrupados em Thread Blocks
• Thread Blocks são executados pelos SM Streaming
Multiprocessors
• Gigathread Engine coordena o scheduling dos SM
• Compartilham a memória L1 Cache
Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
CPU x GPU
• CPU - Central Processing Unit
• Conjunto de instruções complexa
• Capaz de executar Sistemas Operacionais
• Conexão com periféricos
• GPU - Graphical Processing Unit
• Capaz de realizar instruções simples (somas e multiplicações)
em grandes quantidades
• Multiplicação de matrizes (dot product)
Azure Machine Learning
Fonte: https://learn.microsoft.com/en-gb/azure/machine-learning/concept-azure-machine-learning-architecture?view=azureml-api-1
Azure Machine Learning is a cloud service for accelerating and managing the machine learning (ML) project
lifecycle. ML professionals, data scientists, and engineers can use it in their day-to-day workflows to train and
deploy models and manage machine learning operations (MLOps).
Azure Machine Learning
• NCv3 sizes series
• NVIDIA Tesla V100 GPUs
Part Quantity
Count Units
Specs
SKU ID, Performance Units, etc.
Processor 6 - 24 vCPUs Intel Xeon E5-2690 v4
(Broadwell) [x86-64]
Memory 112 - 448 GiB
Local Storage 1 Disk 736 - 2948 GiB
IOPS (RR)
MBps (RR)
Remote Storage 12 - 32 Disks 20000 - 80000 IOPS
200 - 800 MBps
Network 4 - 8 NICs Mbps
Accelerators 1 - 4 Nvidia Tesla V100 GPU
(16GB)
Azure Machine Learning
• NCv3 sizes series
• NVIDIA Tesla V100 GPUs
Fonte: https://www.nvidia.com/en-gb/data-center/tesla-v100/
Programa na CPU
1 2
3 4
2 4
2 4
3 6
5 8
GPU Kernels
• Programa que é executado pela GPU
1 2
3 4
2 4
2 4
3 6
5 8
Rede Neural Profunda
• Tipo de Machine Learning que simula a forma como o cérebro humano
aprende
• Humanos
• Rede de neurônios que passam sinais elétricos quando ativados
(sinapses), que aprendemos durante toda a nossa vida.
• Máquinas
• Rede de neurônios artificias (perceptrons) que utilizam funções matemáticas
baseadas na regressão linear para aprender características com base em uma
base de dados de treinamento.
Fonte: https://learn.microsoft.com/en-us/training/modules/train-evaluate-deep-learn-models/1-introduction
Rede Neural Profunda
Fonte: https://learn.microsoft.com/en-us/training/modules/train-evaluate-deep-learn-models/1-introduction
Dados de
Entrada
Input Layer
Hidden Layer
Output Layer
Classificação
Rede Neural Profunda
• MNIST – Modified National Institute os Standards and
Technology
• Dataset 70.000 imagens em escala de cinza de números
escritos a mão (0 a 9)
Rede Neural Profunda -
Def
Treinamento (valores 0-255)
Teste (valores 0-255)
Transform
•ToTensor() (28Hx28Wx1C)
•Nomalize(mean=(0.5), std=(0,5)) (centro ZERO, escala -1 ate 1)
0 0 0 0 0 0 0
0 0 1 1 1 0 0
0 0 0 0 1 0 0
0 0 0 1 0 0 0
0 0 1 0 0 0 0
0 0 0 0 0 0 0
-1 -1 -1 -1 -1 -1 -1
-1 -1 1 1 1 -1 -1
-1 -1 -1 -1 1 -1 -1
-1 -1 -1 1 -1 -1 -1
-1 -1 1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1
Rede Neural Profunda -
Def
fc1(28 * 28,128)
784
fc1(128, 64)
128 64 10
fc1(64, 10)
Dados de
Entrada
Classificação
Rede Neural Profunda -
Def
x1
x2
x3
x4
w1
w2
w3
w4
Activation
Function Y
Rede Neural Profunda -
Def
• Activation Function – RELU - Rectified Linear Unit
Rede Neural Profunda -
Def
• Activation Function LogSoftmax
Rede Neural Profunda -
Training
• Loss Function
• Calcula a distância entre os valores de treinamento e os valores
previstos pelo modelo
• NLLLoss
• The negative log likelihood loss
Certo, Walter! Vamos imaginar que você está brincando de adivinhar qual brinquedo
está escondido dentro de uma caixa. Você tem várias opções: carrinho, bola, boneca
ou urso de pelúcia. Alguém dá dicas para você adivinhar, mas você tem que usar
essas dicas para escolher o brinquedo certo.
Agora, o "negative log likelihood loss" é como um jogo que avalia quão bem você
está adivinhando. Se você faz uma boa escolha (perto da resposta certa), o "castigo"
do jogo é pequeno. Mas, se você escolhe algo muito errado, o "castigo" fica maior.
Esse "castigo" (ou perda) ajuda você a aprender a adivinhar melhor na próxima vez. É
assim que os computadores aprendem a tomar boas decisões quando estão
"treinando". Eles jogam o jogo muitas vezes, erram, aprendem com o erro e
melhoram! 😊
Rede Neural Profunda -
Training
• Adam Adaptive Moment Estimation
• “Adam: A Method for Stochastic Optimization“.
x1
x2
x3
x4
w1
w2
w3
w4
Activation
Function Y
Fonte: https://learn.microsoft.com/en-us/training/modules/train-evaluate-deep-learn-models/2-deep-neural-network-concepts
Obrigado!
walter.coan@gmail.com
www.waltercoan.com.br
by Comunidado
Joinville 05 de abril 2025
10 anos

Palestra SQLSAT 2025 AZURE ML NVIDIA CUDA

  • 1.
  • 2.
    Como construir umarede neural no Azure Machine Learning com a tecnologia CUDA da NVIDIA Walter Coan
  • 3.
    by Comunidado Joinville 05de abril 2025 10 anos
  • 4.
    Walter Silvestre Coan www.linkedin.com/in/waltercoan/ •Microsoft MVP na categoria Internet das Coisas • Mestre em Sistemas Distribuídos e Redes de sensores sem fio PUCPR • Instrutor autorizado Microsoft, AWS, NVIDIA na Ka Solution • Professor universitário a 19 anos
  • 5.
    Agenda • NVIDIA CUDA •Azure Machine Learning • GPU Kernels • Rede Neural Profunda (Deep Neural Network)
  • 6.
    CUDA • Compute UnifiedDevice Architecture (2006) • Plataforma de computação por paralelização • Permite acelerar o processamento de dados utilizando GPU (Graphics Processing Units) • API (Application Program Interface) • Camada de Software (drivers, bibliotecas, compiladores) que permite a execução de instruções pela GPU de forma paralela (kernels)
  • 7.
    CPU x GPU •Central Processing Unit x Graphical Processing Unit DRAM L3 Cache L2 Cache L2 Cache Core L1 Cache Con trol Core L1 Cache Con trol Core L1 Cache Con trol Core L1 Cache Con trol DRAM L1 Cache Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
  • 8.
  • 9.
  • 10.
    NVIDIA Hopper H100 • 8GPC Graphics Processing Clusters Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
  • 11.
    NVIDIA Hopper H100 •8 GPC Graphics Processing Clusters • 18 SM Stream Multiprocessor por GPC • 144 SMs por GPU • 128 FP32 CUDA Cores por SM, • 18432 FP32 CUDA por GPU • 4 fourth-generation Tensor Cores por SM • 576 por GPU • 6 HBM3 or HBM2e stacks, 12 512-bit memory controllers • 60 MB L2 cache • Fourth-generation NVLink and PCIe Gen 5 Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
  • 12.
    NVIDIA Hopper H100 • SIMT– Single Instruction Multiple Threads • Cada instrução e feita por uma Thread • Cada thread possui seu próprio Program Counter • Cada Thread é executada um core CUDA • Theads são agrupadas em grupos de 32 chamadas de Warps • Warps são agrupados em Thread Blocks • Thread Blocks são executados pelos SM Streaming Multiprocessors • Gigathread Engine coordena o scheduling dos SM • Compartilham a memória L1 Cache Fonte: https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
  • 13.
    CPU x GPU •CPU - Central Processing Unit • Conjunto de instruções complexa • Capaz de executar Sistemas Operacionais • Conexão com periféricos • GPU - Graphical Processing Unit • Capaz de realizar instruções simples (somas e multiplicações) em grandes quantidades • Multiplicação de matrizes (dot product)
  • 14.
    Azure Machine Learning Fonte:https://learn.microsoft.com/en-gb/azure/machine-learning/concept-azure-machine-learning-architecture?view=azureml-api-1 Azure Machine Learning is a cloud service for accelerating and managing the machine learning (ML) project lifecycle. ML professionals, data scientists, and engineers can use it in their day-to-day workflows to train and deploy models and manage machine learning operations (MLOps).
  • 15.
    Azure Machine Learning •NCv3 sizes series • NVIDIA Tesla V100 GPUs Part Quantity Count Units Specs SKU ID, Performance Units, etc. Processor 6 - 24 vCPUs Intel Xeon E5-2690 v4 (Broadwell) [x86-64] Memory 112 - 448 GiB Local Storage 1 Disk 736 - 2948 GiB IOPS (RR) MBps (RR) Remote Storage 12 - 32 Disks 20000 - 80000 IOPS 200 - 800 MBps Network 4 - 8 NICs Mbps Accelerators 1 - 4 Nvidia Tesla V100 GPU (16GB)
  • 16.
    Azure Machine Learning •NCv3 sizes series • NVIDIA Tesla V100 GPUs Fonte: https://www.nvidia.com/en-gb/data-center/tesla-v100/
  • 17.
    Programa na CPU 12 3 4 2 4 2 4 3 6 5 8
  • 18.
    GPU Kernels • Programaque é executado pela GPU 1 2 3 4 2 4 2 4 3 6 5 8
  • 19.
    Rede Neural Profunda •Tipo de Machine Learning que simula a forma como o cérebro humano aprende • Humanos • Rede de neurônios que passam sinais elétricos quando ativados (sinapses), que aprendemos durante toda a nossa vida. • Máquinas • Rede de neurônios artificias (perceptrons) que utilizam funções matemáticas baseadas na regressão linear para aprender características com base em uma base de dados de treinamento. Fonte: https://learn.microsoft.com/en-us/training/modules/train-evaluate-deep-learn-models/1-introduction
  • 20.
    Rede Neural Profunda Fonte:https://learn.microsoft.com/en-us/training/modules/train-evaluate-deep-learn-models/1-introduction Dados de Entrada Input Layer Hidden Layer Output Layer Classificação
  • 21.
    Rede Neural Profunda •MNIST – Modified National Institute os Standards and Technology • Dataset 70.000 imagens em escala de cinza de números escritos a mão (0 a 9)
  • 22.
    Rede Neural Profunda- Def Treinamento (valores 0-255) Teste (valores 0-255) Transform •ToTensor() (28Hx28Wx1C) •Nomalize(mean=(0.5), std=(0,5)) (centro ZERO, escala -1 ate 1) 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
  • 23.
    Rede Neural Profunda- Def fc1(28 * 28,128) 784 fc1(128, 64) 128 64 10 fc1(64, 10) Dados de Entrada Classificação
  • 24.
    Rede Neural Profunda- Def x1 x2 x3 x4 w1 w2 w3 w4 Activation Function Y
  • 25.
    Rede Neural Profunda- Def • Activation Function – RELU - Rectified Linear Unit
  • 26.
    Rede Neural Profunda- Def • Activation Function LogSoftmax
  • 27.
    Rede Neural Profunda- Training • Loss Function • Calcula a distância entre os valores de treinamento e os valores previstos pelo modelo • NLLLoss • The negative log likelihood loss Certo, Walter! Vamos imaginar que você está brincando de adivinhar qual brinquedo está escondido dentro de uma caixa. Você tem várias opções: carrinho, bola, boneca ou urso de pelúcia. Alguém dá dicas para você adivinhar, mas você tem que usar essas dicas para escolher o brinquedo certo. Agora, o "negative log likelihood loss" é como um jogo que avalia quão bem você está adivinhando. Se você faz uma boa escolha (perto da resposta certa), o "castigo" do jogo é pequeno. Mas, se você escolhe algo muito errado, o "castigo" fica maior. Esse "castigo" (ou perda) ajuda você a aprender a adivinhar melhor na próxima vez. É assim que os computadores aprendem a tomar boas decisões quando estão "treinando". Eles jogam o jogo muitas vezes, erram, aprendem com o erro e melhoram! 😊
  • 28.
    Rede Neural Profunda- Training • Adam Adaptive Moment Estimation • “Adam: A Method for Stochastic Optimization“. x1 x2 x3 x4 w1 w2 w3 w4 Activation Function Y Fonte: https://learn.microsoft.com/en-us/training/modules/train-evaluate-deep-learn-models/2-deep-neural-network-concepts
  • 29.
  • 30.
    by Comunidado Joinville 05de abril 2025 10 anos