Open yulin3262 opened 1 day ago
Can you please add a few more details? Output from which is not zero: CSim (csim=True in hls4ml.build(...)) or the hls_prediction? Does the line np.testing.assert_allclose fail or something later?
Thank you very much for your reply. In my project, both hls_prediction and csim can output the result, but when I integrated the IP core derived from hls_model.build(csim=True, export=True) into my FPGA project for simulation, the output of IP core was always 0. Below is my project file、log and generated IP core, I can't find anything wrong? The test_recurrent_pytorch.py file in this project is also our official routine. hls4mlprj_pytorch_api_gru_Vivado_io_stream.zip log.txt
I use hls4ml to generate the IP core of the fully connected network, and the IP core can be normally output when integrated into the FPGA project.Is there a successful case of hls4ml converting gru network and applying it to FPGA? Can you provide a reference case?
Unfortunately, we don't provide examples of how to integrate IPs into larger application, as this is application-specific and can be done in many ways:
from pathlib import Path
import numpy as np import pytest import torch import torch.nn as nn
from hls4ml.converters import convert_from_pytorch_model from hls4ml.utils.config import config_from_pytorch_model from hls4ml.utils import plot_model import plotting import hls4ml
test_root_path = Path(file).parent
import os os.environ['PATH'] = '/tools/Xilinx/Vivado/2019.2/bin:' + os.environ['PATH']
class GRUNet(nn.Module): def init(self): super().init() self.rnn = nn.GRU(4, 2, num_layers=1, batch_first=True, bias=True)
def test_gru(backend, io_type): model = GRUNet() model.eval()
if name == 'main': test_gru('Vivado', 'io_stream')