Denoising Diffusion Probabilistic Models (DDPMs) have emerged as state-of-the-art generative models, yet their substantial computational cost poses challenges for scalable training and fast sampling. This thesis investigates performance optimization techniques that leverage PyTorch's built-in acceleration capabilities to reduce execution time. Using a U-Net architecture based on the original DDPM implementation, closely related to an unmasked PixelCNN++, we conduct experiments on CIFAR-10 and CelebA datasets. Techniques such as torch.compile(), Automatic Mixed Precision (AMP), tensor core usage, quantization and gradient checkpointing are evaluated for their effectiveness in accelerating both training and sampling. The results show up to 2.51 speedup in training and 1.81 faster sampling without significant degradation in sample quality, as measured by the standard metric Fréchet Inception Distance. These findings underline the value of framework-level optimizations in making diffusion models more efficient and suitable for practical applications.
I modelli probabilistici di diffusione con annullamento del rumore (DDPM) si sono affermati come modelli generativi all'avanguardia, tuttavia il loro notevole costo computazionale pone delle sfide per l'addestramento scalabile e il campionamento rapido. Questa tesi indaga tecniche di ottimizzazione delle prestazioni che sfruttano le capacità di accelerazione integrate di PyTorch per ridurre i tempi di esecuzione. Utilizzando un'architettura U-Net basata sull'implementazione originale del DDPM, strettamente correlata a un PixelCNN++ non mascherato, conduciamo esperimenti su dataset CIFAR-10 e CelebA. Tecniche come torch.compile(), Automatic Mixed Precision (AMP), utilizzo di tensore cores, quantizzazione e checkpointing vengono valutate per la loro efficacia nell'accelerare sia l'addestramento che il campionamento. I risultati mostrano un aumento della velocità di addestramento fino a 2.51 volte e un campionamento più veloce di 1.81 volte senza un degrado significativo della qualità del campione, come misurato dalla metrica standard Fréchet Inception Distance. Questi risultati sottolineano il valore delle ottimizzazioni a livello di framework nel rendere i modelli di diffusione più efficienti e adatti ad applicazioni pratiche.
Diffusione efficiente: metodi e tecniche per accelerare i DDPM
POIRÈ, MATTEO
2024/2025
Abstract
Denoising Diffusion Probabilistic Models (DDPMs) have emerged as state-of-the-art generative models, yet their substantial computational cost poses challenges for scalable training and fast sampling. This thesis investigates performance optimization techniques that leverage PyTorch's built-in acceleration capabilities to reduce execution time. Using a U-Net architecture based on the original DDPM implementation, closely related to an unmasked PixelCNN++, we conduct experiments on CIFAR-10 and CelebA datasets. Techniques such as torch.compile(), Automatic Mixed Precision (AMP), tensor core usage, quantization and gradient checkpointing are evaluated for their effectiveness in accelerating both training and sampling. The results show up to 2.51 speedup in training and 1.81 faster sampling without significant degradation in sample quality, as measured by the standard metric Fréchet Inception Distance. These findings underline the value of framework-level optimizations in making diffusion models more efficient and suitable for practical applications.| File | Dimensione | Formato | |
|---|---|---|---|
|
LMCE_Thesis_Poiré.pdf
accesso aperto
Descrizione: Tesi laurea magistrale in Computer Engineering - Data Science
Dimensione
3.66 MB
Formato
Adobe PDF
|
3.66 MB | Adobe PDF | Visualizza/Apri |
È consentito all'utente scaricare e condividere i documenti disponibili a testo pieno in UNITESI UNIPV nel rispetto della licenza Creative Commons del tipo CC BY NC ND.
Per maggiori informazioni e per verifiche sull'eventuale disponibilità del file scrivere a: unitesi@unipv.it.
https://hdl.handle.net/20.500.14239/33577