Travail De Bachelor Rapport Final

Total Page:16

File Type:pdf, Size:1020Kb

Travail De Bachelor Rapport Final Travail de Bachelor NEXT GENERATION DIGITAL ARITHMETIC ±∞ P 0 sit DANS Rapport final Auteur: Baeriswyl Julien Superviseur: Dassati Alberto (ADI) 27 juillet 2018 Table des matières 1 Préface 9 1.1 Remerciements........................................9 1.2 Résumé............................................9 2 Introduction 11 2.1 Contexte........................................... 11 2.1.1 Cadre de déroulement................................ 11 2.1.2 Contexte informatique................................ 11 2.1.2.1 Types de représentation de nombres................... 11 2.1.2.2 Pourquoi a-t-on besoin d’une alternative ?................ 11 2.1.2.3 Alternatives à l’heure actuelle....................... 11 2.1.2.3.1 Inconvénients des alternatives.................. 12 2.1.2.3.2 Pourquoi les Posits ?....................... 12 2.2 Objectif principal....................................... 12 2.3 Objectifs pratiques...................................... 12 3 Notions mathématiques 13 3.1 Ensemble de nombres.................................... 13 3.2 Représentations des nombres................................ 13 3.3 Notation scientifique..................................... 14 3.4 Nombres dans l’informatique................................. 14 3.4.0.1 Problèmes liés aux approximations.................... 14 3.4.1 Nombres entiers................................... 15 3.4.2 Nombres à virgule.................................. 15 3.4.3 Principe de clôture.................................. 15 3.4.4 Arithmétique d’intervalles.............................. 15 3.4.5 Real projective line .................................. 15 3.4.6 Arithmétique multi-précision............................. 16 3.4.7 Tapered floating point ................................ 16 4 Nombres à virgule flottante ou floating-point 17 4.1 Représentations standards IEEE Std 754-1985/ IEEE Std 754-2008............ 17 4.1.1 Formats binaires................................... 17 4.1.1.1 Exposant.................................. 17 4.1.1.2 Mantisse.................................. 17 4.1.1.3 Bit implicite................................ 17 4.1.1.4 Signe.................................... 17 4.1.1.5 Représentations spéciales......................... 18 4.1.1.6 Signification selon le champ exposant................... 18 4.1.1.7 Example.................................. 18 4.1.2 Intervalles dynamiques................................ 19 4.1.2.1 Distribution des nombres sur l’intervalle................. 19 4.1.3 Particularités..................................... 19 4.1.4 Inconvénients..................................... 19 4.2 Représentations alternatives................................. 19 4.3 Support dans les systèmes informatiques.......................... 20 4.3.1 Méthodes de support................................ 20 3 Département TIC, 27 juillet 2018 4.3.2 Support logiciel................................... 21 4.3.3 Support matériel................................... 21 4.3.4 Support dans GNU/Linux .............................. 21 4.3.4.1 GNU Toolchain (GCC,...) ou LLVM ?................... 21 5 À propos des Universal Numbers ou Unum 22 5.1 Historique.......................................... 22 5.2 Unum I............................................ 22 5.2.1 Buts......................................... 22 5.2.2 Format........................................ 22 5.2.2.1 Organisation des champs......................... 22 5.2.2.2 Signification des champs......................... 23 5.2.3 Application...................................... 23 5.3 Unum II........................................... 23 5.3.1 Buts......................................... 23 5.3.2 Principes....................................... 23 5.3.2.1 Encodage SORN.............................. 23 5.3.3 Format........................................ 24 5.4 Unum III........................................... 24 5.4.1 Buts......................................... 24 5.4.2 Première variante, le Posit .............................. 24 5.4.2.1 Particularités................................ 24 5.4.2.2 Format................................... 24 5.4.2.2.1 Organisation des champs.................... 24 5.4.2.2.2 Signification des champs.................... 25 5.4.2.3 Le champ regime ............................. 25 5.4.2.4 Équivalence avec le standard IEEE Std 754-2008 ............ 26 5.4.2.5 Exemple de format............................ 26 5.4.2.6 Méthodes de calcul............................ 27 5.4.2.7 Algorithmes................................ 28 5.4.3 Seconde variante, le Valid .............................. 30 5.4.3.1 Format................................... 30 5.5 Implémentations des Posits ................................. 30 5.5.1 Logicielles...................................... 30 5.5.2 Matérielles (soft-core)................................ 30 5.5.3 Observations..................................... 31 6 Réalisation du projet 32 6.1 Structure du projet...................................... 32 6.2 Licence logicielle....................................... 32 6.3 Émulation logicielle floating-point dans GNU/Linux .................... 32 6.3.1 Du côté noyau.................................... 32 6.3.2 Architectures supportées par la GNU Toolchain .................. 32 6.4 Immersion dans la GNU Toolchain.............................. 33 6.4.1 Infrastructure..................................... 33 6.4.1.1 Pré-requis................................. 33 6.4.1.2 Composants................................ 33 6.4.1.3 Organisation des sources......................... 33 6.4.1.4 Types de fichiers.............................. 34 6.4.2 Fonctionnement de GCC ............................... 34 6.4.2.1 Front-end................................. 34 4 Département TIC, 27 juillet 2018 6.4.2.2 Back-end.................................. 34 6.4.3 Options floating-point à la compilation d’une application.............. 34 6.4.3.1 ARM ABI s : OABI vs EABI ........................ 35 6.4.3.2 Usage des ressources matérielles..................... 35 6.4.3.3 Lien dans les applications......................... 35 6.4.3.4 Implémentations des routines....................... 35 6.5 Mécanismes à gérer..................................... 35 6.6 Considérations sur le développement............................ 36 6.6.1 Interventions dans les sources............................ 36 6.6.2 Version de GCC .................................... 36 6.7 Méthodes d’intégration................................... 36 6.7.1 Aspect fonctionnel.................................. 36 6.7.1.1 Bénéfice pour l’utilisateur......................... 36 6.7.2 Portabilité...................................... 36 6.7.2.1 Types entiers natifs............................ 37 6.7.2.2 Support de la cible............................ 37 6.7.3 Remplacement.................................... 37 6.7.3.1 Approche générique............................ 37 6.7.4 Ajout......................................... 37 6.7.5 Principes algorithmiques de l’implémentation générique............... 38 6.8 Mise en place des Posits dans la GNU Toolchain ..................... 38 6.8.1 Méthode de mise en place.............................. 38 6.8.2 Modification de GCC ................................. 38 6.8.3 Modification de Binutils .............................. 39 6.9 Choix de la cible et de l’environnement hôte........................ 39 6.9.1 Environnement cible................................. 39 6.9.1.1 Plate-formes................................ 39 6.9.1.2 Système d’exploitation........................... 39 6.9.2 Outils de développement............................... 39 6.9.2.1 Moteurs de production.......................... 39 6.9.2.2 Outils d’analyse.............................. 40 7 Tests 41 7.1 Méthodologie......................................... 41 7.1.1 Types de tests.................................... 41 7.1.2 Tailles de Posits ................................... 41 7.1.3 Ressources de tests................................. 41 7.1.4 Facteurs limitants.................................. 41 7.1.5 Choix de la batterie de tests............................. 42 7.1.5.1 Tests unitaires............................... 42 7.1.5.2 Tests fonctionnels............................. 42 7.1.5.3 Tests de performance........................... 42 7.1.6 Choix des plate-formes de test............................ 42 7.2 Tests logiciels........................................ 42 7.2.1 Wrappers ....................................... 42 7.2.2 Bancs de test.................................... 42 7.2.3 Benchmarking .................................... 43 7.3 Améliorations et tests manquants.............................. 43 7.4 Résultats des tests...................................... 43 7.5 Hardware de test....................................... 43 7.5.1 Machines hôtes................................... 43 5 Département TIC, 27 juillet 2018 7.5.2 Plate-formes cibles (embarquées).......................... 44 8 Conclusion 45 8.1 Résultats obtenus...................................... 45 8.2 Gestion du temps...................................... 45 8.2.1 Quelles auraient été les mesures à prendre ?..................... 45 8.3 Difficultés rencontrées.................................... 45 8.4 À poursuivre dans le futur.................................. 46 Glossaire 47 Bibliographie 48 9 Authentification 52 Annexes 53 A Journal de travail 54 9.1 Révisions du document.................................... 54 9.2 Planification initiale..................................... 54 9.2.1 Suivi du planning..................................
Recommended publications
  • Leveraging Posit Arithmetic in Deep Neural Networks
    Leveraging Posit Arithmetic in Deep Neural Networks Master’s Thesis Course 2020–2021 Author Raul Murillo Montero Advisors Dr. Alberto A. del Barrio García Dr. Guillermo Botella Juan Master in Computer Science Engineering Faculty of Computer Science Complutense University of Madrid This document is prepared for double-sided printing. Leveraging Posit Arithmetic in Deep Neural Networks Master’s Thesis in Computer Science Engineering Department of Computer Architecture and Automation Author Raul Murillo Montero Advisors Dr. Alberto A. del Barrio García Dr. Guillermo Botella Juan Call: January 2021 Grade: 10 Master in Computer Science Engineering Faculty of Computer Science Complutense University of Madrid Course 2020–2021 Copyright c Raul Murillo Montero Acknowledgements To my advisors, Alberto and Guillermo, thank you for giving me the opportunity to embark on this project, for all the corrections, the constant suggestions for improve- ment, and your support. Thanks to my family and to all of you who have accompanied me on this journey and have made it a little easier. v COMPLUTENSE UNIVERSITY OF MADRID Abstract Faculty of Computer Science Department of Computer Architecture and Automation Master in Computer Science Engineering Leveraging Posit Arithmetic in Deep Neural Networks by Raul Murillo Montero The IEEE 754 Standard for Floating-Point Arithmetic has been for decades imple- mented in the vast majority of modern computer systems to manipulate and com- pute real numbers. Recently, John L. Gustafson introduced a new data type called positTM to represent real numbers on computers. This emerging format was designed with the aim of replacing IEEE 754 floating-point numbers by providing certain ad- vantages over them, such as a larger dynamic range, higher accuracy, bitwise iden- tical results across systems, or simpler hardware, among others.
    [Show full text]
  • Study of the Posit Number System: a Practical Approach
    STUDY OF THE POSIT NUMBER SYSTEM: A PRACTICAL APPROACH Raúl Murillo Montero DOBLE GRADO EN INGENIERÍA INFORMÁTICA – MATEMÁTICAS FACULTAD DE INFORMÁTICA UNIVERSIDAD COMPLUTENSE DE MADRID Trabajo Fin Grado en Ingeniería Informática – Matemáticas Curso 2018-2019 Directores: Alberto Antonio del Barrio García Guillermo Botella Juan Este documento está preparado para ser imprimido a doble cara. STUDY OF THE POSIT NUMBER SYSTEM: A PRACTICAL APPROACH Raúl Murillo Montero DOUBLE DEGREE IN COMPUTER SCIENCE – MATHEMATICS FACULTY OF COMPUTER SCIENCE COMPLUTENSE UNIVERSITY OF MADRID Bachelor’s Degree Final Project in Computer Science – Mathematics Academic year 2018-2019 Directors: Alberto Antonio del Barrio García Guillermo Botella Juan To me, mathematics, computer science, and the arts are insanely related. They’re all creative expressions. Sebastian Thrun Acknowledgements I have to start by thanking Alberto Antonio del Barrio García and Guillermo Botella Juan, the directors of this amazing project. Thank you for this opportunity, for your support, your help and for trusting me. Without you any of this would have ever been possible. Thanks to my family, who has always supported me and taught me that I am only limited by the limits I choose to put on myself. Finally, thanks to all of you who have accompanied me on this 5 year journey. Sharing classes, exams, comings and goings between the two faculties with you has been a wonderful experience I will always remember. vii Abstract The IEEE Standard for Floating-Point Arithmetic (IEEE 754) has been for decades the standard for floating-point arithmetic and is implemented in a vast majority of modern computer systems.
    [Show full text]
  • Posits: an Alternative to Floating Point Calculations
    Rochester Institute of Technology RIT Scholar Works Theses 5-2020 Posits: An Alternative to Floating Point Calculations Matt Wagner [email protected] Follow this and additional works at: https://scholarworks.rit.edu/theses Recommended Citation Wagner, Matt, "Posits: An Alternative to Floating Point Calculations" (2020). Thesis. Rochester Institute of Technology. Accessed from This Master's Project is brought to you for free and open access by RIT Scholar Works. It has been accepted for inclusion in Theses by an authorized administrator of RIT Scholar Works. For more information, please contact [email protected]. POSITS:AN ALTERNATIVE TO FLOATING POINT CALCULATIONS by MATT WAGNER GRADUATE PAPER Submitted in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE in Electrical Engineering Approved by: Mr. Mark A. Indovina, Senior Lecturer Graduate Research Advisor, Department of Electrical and Microelectronic Engineering Dr. Sohail A. Dianat, Professor Department Head, Department of Electrical and Microelectronic Engineering DEPARTMENT OF ELECTRICAL AND MICROELECTRONIC ENGINEERING KATE GLEASON COLLEGE OF ENGINEERING ROCHESTER INSTITUTE OF TECHNOLOGY ROCHESTER,NEW YORK MAY, 2020 I dedicate this paper to everyone along the way. Declaration Declaration I hereby declare that except where specific reference is made to the work of others, that all content of this Graduate Paper are original and have not been submitted in whole or in part for consideration for any other degree or qualification in this, or any other University. This Graduate Project is the result of my own work and includes nothing which is the outcome of work done in collaboration, except where specifically indicated in the text.
    [Show full text]
  • Deckblatt KIT, 15-02
    Up-to-date Interval Arithmetic From Closed Intervals to Connected Sets of Real Numbers Ulrich Kulisch Preprint 15/02 INSTITUT FÜR WISSENSCHAFTLICHES RECHNEN UND MATHEMATISCHE MO DELLBILDUNG Anschriften der Verfasser: Prof. Dr. Ulrich Kulisch Institut fur¨ Angewandte und Numerische Mathematik Karlsruher Institut fur¨ Technologie (KIT) D-76128 Karlsruhe Up-to-date Interval Arithmetic From closed intervals to connected sets of real numbers Ulrich Kulisch Institut f¨ur Angewandte und Numerische Mathematik Karlsruher Institut f¨ur Technologie Kaiserstrasse 12 D-76128 Karlsruhe GERMANY [email protected] Abstract. This paper unifies the representations of different kinds of computer arithmetic. It is motivated by ideas developed in the book The End of Error by John Gustafson [5]. Here interval arithmetic just deals with connected sets of real numbers. These can be closed, open, half-open, bounded or unbounded. The first chapter gives a brief informal review of computer arithmetic from early floating-point arithmetic to the IEEE 754 floating-point arithmetic standard, to conventional interval arith- metic for closed and bounded real intervals, to the proposed standard IEEE P1788 for interval arithmetic, to advanced computer arithmetic, and finally to the just recently defined and pub- lished unum and ubound arithmetic [5]. Then in chapter 2 the style switches from an informal to a pure and strict mathematical one. Different kinds of computer arithmetic follow an abstract mathematical pattern and are just special realizations of it. The basic mathematical concepts are condensed into an abstract ax- iomatic definition. A computer operation is defined via a monotone mapping of an arithmetic operation in a complete lattice onto a complete sublattice.
    [Show full text]
  • Up-To-Date Interval Arithmetic from Closed Intervals to Connected Sets of Real Numbers
    Up-to-date Interval Arithmetic From closed intervals to connected sets of real numbers Ulrich Kulisch Institut f¨ur Angewandte und Numerische Mathematik Karlsruher Institut f¨ur Technologie D-76128 Karlsruhe GERMANY [email protected] Abstract. This paper unifies the representations of different kinds of computer arithmetic. It is motivated by the book The End of Error by John Gustafson [5]. Here interval arithmetic just deals with connected sets of real numbers. These can be closed, open, half-open, bounded or unbounded. In an earlier paper [19] the author showed that different kinds of computer arithmetic like floating-point arithmetic, conventional interval arithmetic for closed real intervals and arithmetic for interval vectors and interval matrices can all be derived from an abstract axiomatic definition of computer arithmetic and are just special realizations of it. A computer operation is defined via a monotone mapping of an arithmetic operation in a complete lattice onto a complete sublattice. This paper shows that the newly defined unum and ubound arithmetic [5] can be deduced from the same abstract mathematical model. To a great deal unum and ubound arithmetic can be seen as an extension of arithmetic for closed real intervals to open and half-open real intervals, just to connected sets of real numbers. Deriving computer executable formulas for ubound arithmetic on the base of pure floating-point numbers (without the IEEE 754 exceptions) leads to a closed calculus that is totally free of exceptions, i.e., any arithmetic operation of the set +, −, ·,/, and the dot product for ubounds together with a number of elementary functions always delivers a ubound as result.
    [Show full text]
  • Posit Arithmetic John L
    Copyright © 2017 John L. Gustafson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: This copyright and permission notice shall be included in all copies or substantial portions of the software. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OR CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Posit Arithmetic John L. Gustafson 10 October 2017 1 Overview Unums are for expressing real numbers and ranges of real numbers. There are two modes of operation, selectable by the user: posit mode and valid mode. In posit mode, a unum behaves much like a floating-point number of fixed size, rounding to the nearest expressible value if the result of a calculation is not expressible exactly; however, the posit representation offers more accuracy and a larger dynamic range than floats with the same number of bits, as well as many other advantages. We can refer to these simply as posits for short, just as we refer to IEEE 754 Standard floating-point numbers as floats.
    [Show full text]