Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Automated Generation of Configurable CNN IPs using Serial Coding
KTH, School of Electrical Engineering and Computer Science (EECS).
2025 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE creditsStudent thesisAlternative title
Automatiserad generering av konfigurerbar CNN IPs med hjälp av temporal kodning (Swedish)
Abstract [en]

In recent years, significant progress has been made in the field of artificial intelligence, particularly in neural networks, due to increased computing power and available data. This development has created the need for new platforms on which to implement these networks, which differ from traditional platforms, such as CPUs and GPUs. This change is sometimes made in an attempt to reduce resources, time, or energy based on the specific application’s needs. Field-programmable gate arrays (FPGAs) are a good alternative for using neural networks in edge computing, but developing the necessary hardware is costly and complex. Therefore, this thesis focuses on creating an automatic convolutional neural network (CNN) compiler that generates a hardware system from a software description. Several objectives guided this approach: first, to reduce the time it takes to design a CNN architecture for hardware; and second, to create different models with the same hardware design to assess its performance in various areas. We begin with a design that prioritizes reducing area and latency. Thanks to this automatic compiler, we can test this design’s effectiveness for different CNN architectures, helping us better understand the original design’s benefits and limitations. We created a functional Python compiler that takes networks described in PyTorch and Brevitas and generates the corresponding VHDL code to implement those networks in a Xilinx FPGA. Using this tool, we generated up to 12 different CNN models and measured their accuracy, latency, power consumption, and resource utilization. We generated some of these models with the LeNet-5 architecture to compare it with existing implementations of the same architecture and verify that our design significantly reduces area compared to other approaches.

Abstract [sv]

Under de senaste åren har betydande framsteg gjorts inom artificiell intelligens, särskilt inom neurala nätverk, på grund av ökad datorkraft och tillgängliga data. Denna utveckling har skapat ett behov av nya plattformar för att implementera dessa nätverk, vilka skiljer sig från traditionella plattformar som CPU:er och GPU:er. Denna förändring görs ibland i ett försök att minska resurser, tid eller energi baserat på den specifika applikationens behov. Field-programmable gate arrays (FPGA) är ett bra alternativ för att använda neurala nätverk i edge computing, men att utveckla den nödvändiga hårdvaran är kostsamt och komplext. Därför fokuserar denna avhandling på att skapa en automatisk CNN-kompilator (convolutional neural network) som genererar ett hårdvarusystem från en mjukvarubeskrivning. Flera mål styrde denna strategi: för det första att minska den tid det tar att utforma en CNN-arkitektur för hårdvara; och för det andra att skapa olika modeller med samma hårdvarudesign för att bedöma dess prestanda inom olika områden. Vi börjar med en design som prioriterar att minska area och latens. Tack vare den automatiska kompilatorn kan vi testa hur effektiv den här designen är för olika CNN-arkitekturer, vilket hjälper oss att bättre förstå fördelarna och begränsningarna med den ursprungliga designen. Vi skapade en funktionell Python-kompilator som tar nätverk som beskrivs i PyTorch och Brevitas och genererar motsvarande VHDL-kod för att implementera dessa nätverk i en Xilinx FPGA. Med hjälp av detta verktyg genererade vi upp till 12 olika CNN-modeller och mätte deras noggrannhet, latens, strömförbrukning och resursutnyttjande. Vi genererade några av dessa modeller med LeNet-5-arkitekturen för att jämföra den med befintliga implementeringar av samma arkitektur och verifiera att vår design minskar ytan avsevärt jämfört med andra metoder.

Abstract [es]

En los últimos años se han producido avances significativos en el campo de la inteligencia artificial, sobre todo en al área de redes neuronales, debido al aumento de la potencia de cálculo y de los datos disponibles. Este desarrollo ha creado la necesidad de nuevas plataformas para implementar estas redes, que difieren de las tradicionales, como pueden ser las CPUs y las GPUs. En ocasiones, este cambio se lleva a cabo con el objetivo de reducir recursos, tiempo o energía en función de las necesidades específicas de la aplicación. Las Field-Programmable Gate Arrays (FPGA) son una buena alternativa para el uso de redes neuronales en edge computing, pero el desarrollo del hardware necesario es costoso y complejo. Por ello, esta tesis se centra en crear un compilador automático de redes neuronales convolucionales (CNN) que genere un sistema de hardware a partir de una descripción de software. Varios objetivos han guiado este enfoque: en primer lugar, reducir el tiempo necesario para diseñar una arquitectura de CNN para hardware y, en segundo lugar, crear diferentes modelos con el mismo diseño de hardware para evaluar su rendimiento en diversas áreas. Comenzamos con un diseño que prioriza la reducción del área y la latencia. Gracias a este compilador automático, podemos probar la eficacia de este diseño para distintas arquitecturas de CNN, lo que nos ayuda a comprender mejor las ventajas y limitaciones del diseño original. Hemos creado un compilador funcional de Python que toma las redes descritas en PyTorch y Brevitas y genera el código VHDL correspondiente para implementar dichas redes en una FPGA Xilinx. Utilizando esta herramienta, generamos hasta doce modelos diferentes de CNN y medimos su precisión, latencia, consumo de energía y utilización de recursos. Generamos algunos de estos modelos con la arquitectura LeNet-5 para compararlos con las implementaciones existentes de la misma arquitectura y comprobar que nuestro diseño reduce significativamente el área en comparación con otros enfoques.

Place, publisher, year, edition, pages
2025. , p. 90
Series
TRITA-EECS-EX ; 2025:499
Keywords [en]
Field-Programmable gate arrays (FPGAs), Neural Networks (NNs), Convolutional Neural Networks (CNNs), Register Transfer Level (RTL), VHSIC Hardware Description Language (VHDL)
Keywords [sv]
Canvas Lärplattform, Dockerbehållare, Prestandajustering Field-Programmable gate arrays (FPGAs), Neural Networks (NNs), Convolutional Neural Networks (CNNs), Register Transfer Level (RTL), VHSIC Hardware Description Language (VHDL)
Keywords [es]
Field-Programmable gate arrays (FPGAs), Neural Networks (NNs), Convolutional Neural Networks (CNNs), Register Transfer Level (RTL), VHSIC Hardware Description Language (VHDL)
National Category
Electrical Engineering, Electronic Engineering, Information Engineering
Identifiers
URN: urn:nbn:se:kth:diva-367844OAI: oai:DiVA.org:kth-367844DiVA, id: diva2:1986403
Supervisors
Examiners
Available from: 2025-08-11 Created: 2025-07-31 Last updated: 2025-08-11Bibliographically approved

Open Access in DiVA

fulltext(3774 kB)282 downloads
File information
File name FULLTEXT01.pdfFile size 3774 kBChecksum SHA-512
c45c28deb732aaaa957ef9c373eb4ab9e2361a915ea68213aeb5230d8bd796375770dd65e5e10006565101fc3b3b6554d0539f95bf822587bb157a7351fea5a9
Type fulltextMimetype application/pdf

By organisation
School of Electrical Engineering and Computer Science (EECS)
Electrical Engineering, Electronic Engineering, Information Engineering

Search outside of DiVA

GoogleGoogle Scholar
Total: 284 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 642 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf