Entenda de onde vem toda a potência do Intel® Xeon Phi™

731 views

Published on

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).

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
731
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Entenda de onde vem toda a potência do Intel® Xeon Phi™

  1. 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. 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. 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. 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. 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. 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”!
  7. 7. Exemplo de uso OpenMP – Cálculo de π
  8. 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. 9. Cálculo de π – Primeira Aproximação Valor grosseiramente aproximado de π π = 4 / (1 + 0,52) * 1 = 4 / 1,25  π = 3,2
  10. 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. 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
  12. 12. 3,326 * 0,1 = 0,333 3,563 * 0,1 = 0,356 2,102 * 0,1 = 0,210 2,102 * 0,1 = 0,210 PI = 3,1424 2,102 * 0,1 = 0,210 Thread 2,322 * 0,1 = 0,232 2,560 * 0,1 = 0,256 2,812 * 0,1 = 0,281 Thread 3,071 * 0,1 = 0,397 Thread 2,322 * 0,1 = 0,232 2,322 * 0,1 = 0,232 2,560 * 0,1 = 0,256 2,560 * 0,1 = 0,256 2,812 * 0,1 = 0,281 2,812 * 0,1 = 0,281 3,071 * 0,1 = 0,397 3,071 * 0,1 = 0,397 3,765 * 0,1 = 0,376 3,326 * 0,1 = 0,333 3,326 * 0,1 = 0,333 3,563 * 0,1 = 0,356 3,563 * 0,1 = 0,356 3,765 * 0,1 = 0,376 3,765 * 0,1 = 0,376 3,912 * 0,1 = 0,391 3,912 * 0,1 = 0,391 3,990 * 0,1 = 0,399 3,990 * 0,1 = 0,399 3,912 * 0,1 = 0,391 3,990 * 0,1 = 0,399 Solução do Problema com Paralelismo Cada thread realiza o cálculo de alguns intervalos Thread REDUÇÃO
  13. 13. Agora um pouco de hardware…
  14. 14. Engenharia e Arquitetura… 14
  15. 15. Intel inside, inside Intel… Um processador com múltiplos cores possui componentes “comuns” aos cores. Estes compontentes recebem o nome de Uncore.
  16. 16. Intel inside, inside Intel… E agora, dentro do core…
  17. 17. MicroArquitetura Sandy Bridge FRONT-END BACK-END
  18. 18. Intel® Xeon Phi™ Ainda mais poder de processamento!
  19. 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. 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)
  21. 21. Intel® Xeon Phi™ Cada placa é vista como um nó num cluster Programação: x86
  22. 22. Intel® Xeon Phi™ Visão de Software da Arquitetura do Intel® Xeon Phi™
  23. 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. 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. 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. 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. 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. 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. 29. Existem recursos para lhe ajudar! Ferramentas de Software da Intel http://software.intel.com IDZ – Intel Developer Zone
  30. 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)
  31. 31. Nota sobre Otimização
  32. 32. Legal Disclaimer • INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. • A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS. • Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information. • The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. • Intel processor numbers are not a measure of performance. Processor numbers differentiate features within each processor family, not across different processor families. Go to: http://www.intel.com/products/processor_number. • Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. • Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-5484725, or go to: http://www.intel.com/design/literature.htm • Intel, Core, Atom, Pentium, Intel inside, Sponsors of Tomorrow, Pentium, 386, 486, DX2 and the Intel logo are trademarks of Intel Corporation in the United States and other countries. • *Other names and brands may be claimed as the property of others. • Copyright ©2012 Intel Corporation.
  33. 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

×