Palestra realizada por Luciano Palma no Intel Software Day 2013 (22/10/2013)
Conheça a arquitetura do Intel Xeon Phi, um coprocessador capaz de entregar mais de 2 TFlops de processamento para sua solução de HPC (High Performance Computing).
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Entenda de onde vem toda a potência do Intel® Xeon Phi™
1. Entenda de onde
vem toda a potência do
Intel® Xeon Phi™
Luciano Palma
Community Manager – Servers & HPC
Intel Software do Brasil
Luciano.Palma@intel.com
2. Por que Programação Paralela é Importante?
Pesquisa
Científica
Competitividade
na Indústria
Modelagem de
Clima/Tempo
Pesquisa Farmacêutica
Análises Financeiras
Imagens Médicas
CAD/manufatura
Exploração de Energia
Criação de Conteúdo Digital
Simulações
Projeto de novos Produtos
Segurança Nacional
Corrida Computacional
Segurança
Nacional
Desempenho Computacional
Total por país
Maiores Desafios Maior Complexidade Computacional…
… mantendo um “orçamento energético” realista
3. A Capacidade Computacional evoluiu.
O Software não acompanhou.
A densidade de transistores continua aumentando, mas…
… o aumento da velocidade (clock) não
A grande maioria dos PCs vendidos são multi-core, mas…
… muitos programas / cargas ainda não tiram proveito
do paralelismo possível
O Processamento Paralelo é chave para obter
o máximo
desempenho
possível
4. Computação Serial vs. Paralela
Serialização
for (i=0; i< num_sites; ++i) {
search (searchphrase, website[i]);
}
Faz Sentido!
Fácil para fazer “debug”
Determinístico
No entanto…
… aplicações serializadas não maximizam o desempenho de saída
(output) e não evoluirão no tempo com o avanço das tecnologias
Paralelização – dá para fazer?!
parallel_for (i=0; i< num_sites; ++i) {
Depende da quantidade de trabalho search (searchphrase, website[i]);
}
a realizar e da habilidade
de dividir a tarefa
É necessário entender a entrada (input), saída (output)
e suas dependências
5. Dividindo o trabalho…
Decomposição de Tarefas:
Executa diferentes funções do
programa em paralelo.
Limitada escalabilidade, portanto
precisamos de…
Decomposição de Dados:
Dados são separados em blocos e
cada bloco é processado em uma
task diferente.
A divisão (splitting) pode ser
contínua, recursiva.
Maiores conjuntos de dados
mais tasks
O Paralelismo cresce à medida que
o tamanho do problema cresce
#pragma omp parallel shared(data, ans1, ans2)
{
#pragma omp sections
{
#pragma omp section
ans1=do_this(data);
#pragma omp section
ans2=do_that(data);
}
}
#pragma omp parallel_for shared(data, ans1)
private(i)
for(i=0; i<N; i++) {
ans1(i) = do_this(data(i));
}
#pragma omp parallel_for shared(data, ans2)
private(i)
for(i=0; i<N; i++) {
ans2(i) = do_that(data(i));
}
6. Técnicas de Programação Paralela:
Como dividir o trabalho entre sistemas?
É possível utilizar Threads (OpenMP, TBB, Cilk, pthreads…) ou
Processos (MPI, process fork..) para programar em paralelo
Modelo de Memória Compartilhada
Único espaço de memória utilizado por múltiplos processadores
Espaço de endereçamento unificado
Simples para trabalhar, mas requer cuidado para evitar condições de corrida
(“race conditions”) quando existe dependência entre eventos
Passagem de Mensagens
Comunicação entre processos
Pode demandar mais trabalho para implementar
Menos “race conditions” porque as mensagens podem forçar o sincronismo
“Race conditions”
acontecem quando processos ou
threads separados modificam ou
dependem das mesmas coisas…
Isso é notavelmente difícil de
“debugar”!
8. Cálculo de π – Teoria
π pode ser calculado através da integral abaixo
1
π = ∫ f(x) * dx = 4 / (1 + x2) * dx = 3.141592654...
0
9. Cálculo de π – Primeira Aproximação
Valor grosseiramente aproximado de π
π = 4 / (1 + 0,52) * 1 = 4 / 1,25 π = 3,2
10. Cálculo de π – Segunda Aproximação
Com mais aproximações, o valor de π tende ao valor teórico
f(0,25) = 3,735; f(0,75) = 2,572 π = 3,153
3,735 * 0,5
= 1,867
2,572 * 0,5
= 1,286
11. 2,102 * 0,1 = 0,210
2,322 * 0,1 = 0,232
2,560 * 0,1 = 0,256
2,812 * 0,1 = 0,281
3,071 * 0,1 = 0,397
3,326 * 0,1 = 0,333
3,563 * 0,1 = 0,356
3,765 * 0,1 = 0,376
3,912 * 0,1 = 0,391
3,990 * 0,1 = 0,399
Cálculo de π – Aumentando os intervalos…
Quanto mais intervalos, maior a precisão do cálculo
Aproximação com 10 intervalos π = 3,1424
19. Intel® Xeon Phi™
É o coprocessador certo para mim?
http://software.intel.com/pt-br/articles/is-the-intel-xeon-phi-coprocessor-right-for-me
20. Intel® Xeon Phi™
Ainda mais poder de
processamento!
Até 61 cores (4 threads por core)
Até 16 GB RAM GDDR5
Transferência de memória até 352 GB/sec
Vetores de 512 bits
1,2 TFLOPs de processamento (Precisão Dupla)
1 slot PCIe-x16
Uso eficiente de energia (225W - 300 W)
23. Intel® Xeon Phi™
Visão de Hardware da Arquitetura do Intel® Xeon Phi™
Um anel bidirecional de alta velocidade
interconecta as caches L2 dos cores
24. Intel® Xeon Phi™
GFLOP/sec =16 (SP SIMD Lane) x 2 (FMA) x 1.1 (GHZ) x
60 (# cores) = 2.112 (aritmética de precisão simples)
GFLOP/sec = 8 (DP SIMD Lane) x 2 (FMA) x 1.1 (GHZ) x 60
(# cores) = 1.056 (aritmética de precisão dupla)
25. Linha de Produtos Intel® Xeon Phi™
Família 3
Excelente Solução para
Computação Paralela
Liderança em Desempenho/$
Família 5
Otimizada para Ambientes
de Alta Densidade
6GB GDDR5
240GB/s
>1TF DP
3120P
5110P
5120D
7120P
7120X
8GB GDDR5
>300GB/s
>1TF DP
Liderança em Desempenho/watt
225-245W
Família 7
16GB GDDR5
Mais Alto Desempenho,
Mais Memória
Liderança em Desempenho
25
3120A
352GB/s
>1.2TF DP
Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components,
software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the
performance of that product when combined with other products. For more information go to http://www.intel.com/performance
26. Por que descer neste nível?
Para tirar o máximo proveito dos recursos do hardware!
Utilizar todas as “threads de hardware”
Não esquecer o HyperThread
Utilizar todas as unidades de execução
Retirar o máximo de instruções por ciclo de clock
Otimizar o uso dos unidades de vetores (AVX/AVX2)
Loops otimizados
Manter as caches com dados/instruções válidos
Evitar “cache misses”
Aproveitar o “branch prediction”
Evitar o “stall” da pipeline
27. Por que descer neste nível?
Para tirar o máximo proveito dos recursos do hardware!
Utilizar todas as “threads de hardware”
Não esquecer o HyperThread
Utilizar todas as unidades de execução
Retirar o máximo de instruções por ciclo de clock
Otimizar o uso dos unidades de vetores (AVX/AVX2)
Loops otimizados
Manter as caches com dados/instruções válidos
Evitar “cache misses”
Aproveitar o “branch prediction”
Evitar o “stall” da pipeline
28. Por que descer neste nível?
Para tirar o máximo proveito dos recursos do hardware!
Utilizar todas as “threads de hardware”
Não esquecer o HyperThread
Utilizar todas as unidades de execução
Retirar o máximo de instruções por ciclo de clock
Otimizar o uso dos unidades de vetores (AVX/AVX2)
Loops otimizados
Manter as caches com dados/instruções válidos
Evitar “cache misses”
Aproveitar o “branch prediction”
Evitar o “stall” da pipeline
29. Existem recursos para lhe ajudar!
Ferramentas de Software da Intel
http://software.intel.com
IDZ – Intel Developer Zone
30. Modelos de Programação Paralela
Intel® Cilk™ Plus
Intel® Threading
Building Blocks
• Extensões para
as linguagens
C/C++ para
simplificar o
paralelismo
• Template
libraries
amplamente
usadas em C++
para paralelismo
• Código aberto
Também um
produto Intel
Domain Specific
Libraries
• Intel® Integrated
Performance
Primitives
• Intel® Math
Kernel Library
Padrões
estabelecidos
• Message Passing
Interface (MPI)
• OpenMP*
• Coarray Fortran
• OpenCL*
• Código aberto
Também um
produto Intel
Níveis de abstração conforme a necessidade
Mesmos modelos para multi-core (Xeon) e
many-core (Xeon Phi)
33. Risk Factors
The above statements and any others in this document that refer to plans and expectations for the second quarter, the year and the future are forward-looking
statements that involve a number of risks and uncertainties. Words such as “anticipates,” “expects,” “intends,” “plans,” “believes,” “seeks,” “estimates,” “may,”
“will,” “should” and their variations identify forward-looking statements. Statements that refer to or are based on projections, uncertain events or assumptions
also identify forward-looking statements. Many factors could affect Intel’s actual results, and variances from Intel’s current expectations regarding such factors
could cause actual results to differ materially from those expressed in these forward-looking statements. Intel presently considers the following to be the
important factors that could cause actual results to differ materially from the company’s expectations. Demand could be different from Intel's expectations due
to factors including changes in business and economic conditions, including supply constraints and other disruptions affecting customers; customer acceptance of
Intel’s and competitors’ products; changes in customer order patterns including order cancellations; and changes in the level of inventory at customers.
Uncertainty in global economic and financial conditions poses a risk that consumers and businesses may defer purchases in response to negative financial events,
which could negatively affect product demand and other related matters. Intel operates in intensely competitive industries that are characterized by a high
percentage of costs that are fixed or difficult to reduce in the short term and product demand that is highly variable and difficult to forecast. Revenue and the
gross margin percentage are affected by the timing of Intel product introductions and the demand for and market acceptance of Intel's products; actions taken
by Intel's competitors, including product offerings and introductions, marketing programs and pricing pressures and Intel’s response to such actions; and Intel’s
ability to respond quickly to technological developments and to incorporate new features into its products. Intel is in the process of transitioning to its next
generation of products on 22nm process technology, and there could be execution and timing issues associated with these changes, including products defects
and errata and lower than anticipated manufacturing yields. The gross margin percentage could vary significantly from expectations based on capacity utilization;
variations in inventory valuation, including variations related to the timing of qualifying products for sale; changes in revenue levels; segment product mix; the
timing and execution of the manufacturing ramp and associated costs; start-up costs; excess or obsolete inventory; changes in unit costs; defects or disruptions
in the supply of materials or resources; product manufacturing quality/yields; and impairments of long-lived assets, including manufacturing, assembly/test and
intangible assets. The majority of Intel’s non-marketable equity investment portfolio balance is concentrated in companies in the flash memory market segment,
and declines in this market segment or changes in management’s plans with respect to Intel’s investments in this market segment could result in significant
impairment charges, impacting restructuring charges as well as gains/losses on equity investments and interest and other. Intel's results could be affected by
adverse economic, social, political and physical/infrastructure conditions in countries where Intel, its customers or its suppliers operate, including military conflict
and other security risks, natural disasters, infrastructure disruptions, health concerns and fluctuations in currency exchange rates. Expenses, particularly certain
marketing and compensation expenses, as well as restructuring and asset impairment charges, vary depending on the level of demand for Intel's products and
the level of revenue and profits. Intel’s results could be affected by the timing of closing of acquisitions and divestitures. Intel's results could be affected by
adverse effects associated with product defects and errata (deviations from published specifications), and by litigation or regulatory matters involving
intellectual property, stockholder, consumer, antitrust, disclosure and other issues, such as the litigation and regulatory matters described in Intel's SEC reports.
An unfavorable ruling could include monetary damages or an injunction prohibiting Intel from manufacturing or selling one or more products, precluding particular
business practices, impacting Intel’s ability to design its products, or requiring other remedies such as compulsory licensing of intellectual property. A detailed
discussion of these and other factors that could affect Intel’s results is included in Intel’s SEC filings, including the report on Form 10-K for the year ended Dec.
31, 2011.
Rev. 4/17/12