Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Save model weights in quantized fixed point representation instead of floating point

Aperta
#808 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp, python
Ambito
backend

Direzione di ricerca

The issue concerns the Vivado writer, which emits model weights into the C++ header files of the HLS project. Start by finding where that writer serializes weight values and where the configured fixed precision is applied. Done means the generated weights are written as quantized fixed-point or integer values rather than floats, and csim results still match. The representation (decimal or integer) is not settled in the thread, so confirm it with maintainers before coding.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Details

Currently, hls4ml writes model weights to C++ header files included in the compiled HLS project. These weights are stored in floating point representation. Without delving into the source code it's difficult to tell but the weights appear to be rounded to a number of decimal places equal to the word length of the PTQ fixed precisions selected in hls4ml (see below).

fig1

We can run a csim to save the "true" quantized model parameters (see below, upper right). In our work with NI FPGA hardware (programmed via LabVIEW), we experienced issues where LabVIEW coerces the floating point weights (see below, left) to different fixed-point decimal representations (see below, bottom right) than Vivado HLS. Loading these LabVIEW parsed weights, we observe incorrect model outputs in comparison to csim. However, loading the quantized fixed-point weights produced by Vivado HLS instead yields correct predictions.

fig3

New behavior

It may be beneficial for future external weight functionality and those looking to view the "true" quantized weights associated with their model to save the model weights in their quantized decimal or integer representation instead of floating point.

Motivation

As hls4ml expands in reach and functionality, compatibility issues like these between Vivado HLS and other platforms such as LabVIEW may arise. Writing the true quantized weights may curb many potential issues.

Parts of hls4ml being affected

Vivado writer.

Lingua principale
Python
Stelle
2.2k
Fork
605
Merge medio
6g 16h
PR unite (30g)
20

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fastmachinelearning/hls4ml

Tutte le issue di fastmachinelearning/hls4ml

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.