Giter VIP home page Giter VIP logo

mase's Introduction

Machine-Learning Accelerator System Exploration Tools

Contributors Forks Stargazers Issues Doc

Overview

Machine learning accelerators have been used extensively to compute models with high performance and low power. Unfortunately, the development pace of ML models is much faster than the accelerator design cycle, leading to frequent changes in the hardware architecture requirements, rendering many accelerators obsolete. Existing design tools and frameworks can provide quick accelerator prototyping, but only for a limited range of models that fit into a single hardware device. With the emergence of large language models such as GPT-3, there is an increased need for hardware prototyping of large models within a many-accelerator system to ensure the hardware can scale with ever-growing model sizes.

MASE provides an efficient and scalable approach for exploring accelerator systems to compute large ML models by directly mapping onto an efficient streaming accelerator system. Over a set of ML models, MASE can achieve better energy efficiency to GPUs when computing inference for recent transformer models.

Alt text

MASE Publications

  • Fast Prototyping Next-Generation Accelerators for New ML Models using MASE: ML Accelerator System Exploration, link
    @article{cheng2023fast,
    title={Fast prototyping next-generation accelerators for new ml models using mase: Ml accelerator system exploration},
    author={Cheng, Jianyi and Zhang, Cheng and Yu, Zhewen and Montgomerie-Corcoran, Alex and Xiao, Can and Bouganis, Christos-Savvas and Zhao, Yiren},
    journal={arXiv preprint arXiv:2307.15517},
    year={2023}}
    
  • MASE: An Efficient Representation for Software-Defined ML Hardware System Exploration, link
    @article{zhangmase,
    title={MASE: An Efficient Representation for Software-Defined ML Hardware System Exploration},
    author={Zhang, Cheng and Cheng, Jianyi and Yu, Zhewen and Zhao, Yiren}}
    

Repository structure

This repo contains the following directories:

  • components - Internal hardware library
  • scripts - Installation scripts
  • machop - MASE's software stack
  • hls - HLS component of MASE
  • mlir-air - MLIR AIR for ACAP devices
  • docs - Documentation
  • Docker - Docker container configurations

MASE Dev Meetings

Donation

If you think MASE is helpful, please donate for our work, we appreciate your support!

mase's People

Contributors

aaron-zhao123 avatar aaronmkts avatar bet20icl avatar chengzhang-98 avatar dereklai1 avatar diegovano avatar firemountain154b avatar jeffreywong20 avatar jianyicheng avatar johnny1882 avatar lambda-shuttle avatar mwijeyasinghebbx avatar pgimenes avatar yu-zhewen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mase's Issues

flop_estimator module is broken.

The flop_estimator module cannot be loaded due to some faulty imports, such as get_input_args in deepspeed.py.

I have attempted to fix this but it is ambiguous on what exactly is required and time is limited.

Hardware

  • quantization pass to update output bitwidth
  • insert cast pass

Conda env not installing

Using Anaconda3-2022.10 (or later) and Python Version 3.10.6 as required, the script scripts/init-conda.sh fails to install deepspeed:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Installing pip dependencies: \ Ran pip subprocess with arguments:
['/home/wfp23/anaconda3/envs/mase/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt']
Pip subprocess output:
Collecting lightning (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 1))
  Using cached lightning-2.1.3-py3-none-any.whl.metadata (56 kB)
Collecting transformers (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 2))
  Using cached transformers-4.37.0-py3-none-any.whl.metadata (129 kB)
Collecting diffusers (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 3))
  Using cached diffusers-0.25.1-py3-none-any.whl.metadata (19 kB)
Collecting accelerate (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 4))
  Using cached accelerate-0.26.1-py3-none-any.whl.metadata (18 kB)
Collecting toml (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 5))
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting timm (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 6))
  Using cached timm-0.9.12-py3-none-any.whl.metadata (60 kB)
Collecting pytorch-nlp (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 7))
  Using cached pytorch_nlp-0.5.0-py3-none-any.whl (90 kB)
Collecting datasets (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 8))
  Using cached datasets-2.16.1-py3-none-any.whl.metadata (20 kB)
Collecting onnx (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 9))
  Using cached onnx-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (15 kB)
Collecting onnxruntime (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 10))
  Using cached onnxruntime-1.16.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.3 kB)
Collecting optimum (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 11))
  Using cached optimum-1.16.2-py3-none-any.whl.metadata (17 kB)
Collecting black (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 12))
  Using cached black-23.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (68 kB)
Collecting GitPython (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 13))
  Using cached GitPython-3.1.41-py3-none-any.whl.metadata (14 kB)
Collecting colorlog (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 14))
  Using cached colorlog-6.8.0-py3-none-any.whl.metadata (10 kB)
Collecting cocotb==1.8.0 (from cocotb[bus]==1.8.0->-r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 15))
  Using cached cocotb-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.8 kB)
Collecting pytest (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 16))
  Using cached pytest-7.4.4-py3-none-any.whl.metadata (7.9 kB)
Collecting pytest-cov (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 17))
  Using cached pytest_cov-4.1.0-py3-none-any.whl.metadata (26 kB)
Collecting pytest-xdist (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 18))
  Using cached pytest_xdist-3.5.0-py3-none-any.whl.metadata (3.1 kB)
Collecting pytest-sugar (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 19))
  Using cached pytest_sugar-0.9.7-py2.py3-none-any.whl (10 kB)
Collecting pytest-html (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 20))
  Using cached pytest_html-4.1.1-py3-none-any.whl.metadata (3.9 kB)
Collecting pytest-profiling (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 21))
  Using cached pytest_profiling-1.7.0-py2.py3-none-any.whl (8.3 kB)
Collecting ipython (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 22))
  Using cached ipython-8.20.0-py3-none-any.whl.metadata (5.9 kB)
Collecting ipdb (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 23))
  Using cached ipdb-0.13.13-py3-none-any.whl (12 kB)
Collecting sentencepiece (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 24))
  Using cached sentencepiece-0.1.99-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)
Collecting einops (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 25))
  Using cached einops-0.7.0-py3-none-any.whl.metadata (13 kB)
Collecting deepspeed==0.3.5 (from -r /home/wfp23/ADL/mase/machop/condaenv.pza5spem.requirements.txt (line 26))
  Downloading deepspeed-0.3.5.tar.gz (207 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 207.5/207.5 kB 26.0 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

Pip subprocess error:
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      Traceback (most recent call last):
        File "/tmp/pip-install-4v1g1vze/deepspeed_f57f4dccc17344fead82d595813905fb/setup.py", line 18, in <module>
          import torch
      ModuleNotFoundError: No module named 'torch'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-4v1g1vze/deepspeed_f57f4dccc17344fead82d595813905fb/setup.py", line 21, in <module>
          raise ImportError('Unable to import torch, please visit https://pytorch.org/ '
      ImportError: Unable to import torch, please visit https://pytorch.org/ to see how to properly install torch on your system.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

failed

CondaEnvException: Pip failed

I have tried manually installing torch using both pip and conda but does not resolve the problem.

loading checkpoints onto cpu machine

Question:
When loading a trained model onto a cpu machine, an error occurs in mase/machop/chop/tools/checkpoint_load.py due to not having a CPU

Commit hash: e98079f

Command to reproduce:
./ch search --accelerator cpu --config configs/examples/jsc_bardia_by_type.toml --load /content/mase/mase_output/jsc_bardia_e_50_b_128_l_001/software/training_ckpts/best.ckpt

Error log:

Traceback (most recent call last):
  File "/content/mase/machop/./ch", line 6, in <module>
    ChopCLI().run()
  File "/content/mase/machop/chop/cli.py", line 270, in run
    run_action_fn()
  File "/content/mase/machop/chop/cli.py", line 395, in _run_search
    search(**search_params)
  File "/content/mase/machop/chop/actions/search/search.py", line 58, in search
    model = load_model(load_name=load_name, load_type=load_type, model=model)
  File "/content/mase/machop/chop/tools/checkpoint_load.py", line 84, in load_model
    model = load_lightning_ckpt_to_unwrapped_model(
  File "/content/mase/machop/chop/tools/checkpoint_load.py", line 15, in load_lightning_ckpt_to_unwrapped_model
    src_state_dict = torch.load(checkpoint)["state_dict"]
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1014, in load
    return _load(opened_zipfile,
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1422, in _load
    result = unpickler.load()
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1392, in persistent_load
    typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1366, in load_tensor
    wrap_storage=restore_location(storage, location),
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 381, in default_restore_location
    result = fn(storage, location)
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 274, in _cuda_deserialize
    device = validate_cuda_device(location)
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 258, in validate_cuda_device
    raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

Comments:
Please would you consider changing "src_state_dict = torch.load(checkpoint)["state_dict"]" to something like:

if(torch.cuda.is_available()) : src_state_dict = torch.load(checkpoint)["state_dict"]
    else: src_state_dict= torch.load(checkpoint, map_location=torch.device('cpu'))["state_dict"]

so that this doesn't break when using CPU

The accelerator flag doesn't seem to help - the print below shows that the accelerator is correctly overridden to cpu

+-------------------------+--------------------------+--------------+--------------------------+--------------------------+
| Name                    |         Default          | Config. File |     Manual Override      |        Effective         |
+-------------------------+--------------------------+--------------+--------------------------+--------------------------+
| task                    |      classification      |     cls      |                          |           cls            |
| load_name               |           None           |              | /content/mase/mase_outpu | /content/mase/mase_outpu |
|                         |                          |              | t/jsc_bardia_e_50_b_128_ | t/jsc_bardia_e_50_b_128_ |
|                         |                          |              | l_001/software/training_ | l_001/software/training_ |
|                         |                          |              |     ckpts/best.ckpt      |     ckpts/best.ckpt      |
| load_type               |            mz            |      pl      |                          |            pl            |
| batch_size              |           128            |     512      |                          |           512            |
| to_debug                |          False           |              |                          |          False           |
| log_level               |           info           |              |                          |           info           |
| report_to               |       tensorboard        |              |                          |       tensorboard        |
| seed                    |            0             |      42      |                          |            42            |
| quant_config            |           None           |              |                          |           None           |
| training_optimizer      |           adam           |              |                          |           adam           |
| trainer_precision       |         16-mixed         |              |                          |         16-mixed         |
| learning_rate           |          1e-05           |     0.01     |                          |           0.01           |
| weight_decay            |            0             |              |                          |            0             |
| max_epochs              |            20            |      5       |                          |            5             |
| max_steps               |            -1            |              |                          |            -1            |
| accumulate_grad_batches |            1             |              |                          |            1             |
| log_every_n_steps       |            50            |      5       |                          |            5             |
| num_workers             |            2             |              |                          |            2             |
| num_devices             |            1             |              |                          |            1             |
| num_nodes               |            1             |              |                          |            1             |
| accelerator             |           auto           |     cpu      |           cpu            |           cpu            |
| strategy                |           auto           |              |                          |           auto           |
| is_to_auto_requeue      |          False           |              |                          |          False           |
| github_ci               |          False           |              |                          |          False           |
| disable_dataset_cache   |          False           |              |                          |          False           |
| target                  |   xcu250-figd2104-2L-e   |              |                          |   xcu250-figd2104-2L-e   |
| num_targets             |           100            |              |                          |           100            |
| is_pretrained           |          False           |              |                          |          False           |
| max_token_len           |           512            |              |                          |           512            |
| project_dir             | /content/mase/mase_outpu |              |                          | /content/mase/mase_outpu |
|                         |            t             |              |                          |            t             |
| project                 |           None           |   jsc-tiny   |                          |         jsc-tiny         |
| model                   |           None           |  jsc-bardia  |                          |        jsc-bardia        |
| dataset                 |           None           |     jsc      |                          |           jsc            |
+-------------------------+--------------------------+--------------+--------------------------+--------------------------+

Convolution TB is not currently working and the RTL has compilation errors.

Question: What is the necessary fix?

Commit hash: d49620d78de8e6b85016b880b144b6214146be4d [on the main branch]

Before running the below command you must edit deps.py at machop/mase_components/deps.py and replace line 63 with this "conv/convolution": ["conv", "linear", "common", "fixed_arithmetic", "cast"], The effect of this is to add the cast directories so it can find the fixed rounding module.

Command to reproduce:

cd
make sync
make shell
pip3 install mpmath==1.3.0
cd machop/mase_components/conv/
python3 test/convolution_tb.py

Output:


/workspace/machop/mase_cocotb/runner.py:9: UserWarning: Python runners and associated APIs are an experimental feature and subject to change.
  from cocotb.runner import get_runner, get_results
%Warning-SELRANGE: /workspace/machop/mase_components/linear/rtl/fixed_linear.sv:188:37: Selection index out of range: 2 outside 1:0
                                                                                      : ... note: In instance 'convolution.fl_instance'
  188 |           .data_out      (data_out_0[i])
      |                                     ^
                   /workspace/machop/mase_components/conv/rtl/convolution.sv:178:1: ... note: In file included from 'convolution.sv'
                   ... For warning description see https://verilator.org/warn/SELRANGE?v=5.020
                   ... Use "/* verilator lint_off SELRANGE */" and lint_on around source to disable this message.
%Warning-SELRANGE: /workspace/machop/mase_components/linear/rtl/fixed_linear.sv:188:37: Selection index out of range: 3 outside 1:0
                                                                                      : ... note: In instance 'convolution.fl_instance'
  188 |           .data_out      (data_out_0[i])
      |                                     ^
                   /workspace/machop/mase_components/conv/rtl/convolution.sv:178:1: ... note: In file included from 'convolution.sv'
%Error: /workspace/machop/mase_components/conv/rtl/convolution.sv:180:15: Slices of arrays in assignments have different unpacked dimensions, 16 versus 8
                                                                        : ... note: In instance 'convolution'
  180 |       .weight(ib_weight),
      |               ^~~~~~~~~
%Error: /workspace/machop/mase_components/linear/rtl/fixed_linear.sv:167:19: Slices of arrays in assignments have different unpacked dimensions, 4 versus 2
                                                                           : ... note: In instance 'convolution.fl_instance'
  167 |         .data_in (bias),
      |                   ^~~~
        /workspace/machop/mase_components/conv/rtl/convolution.sv:178:1: ... note: In file included from 'convolution.sv'
-Info: Command Line disabled gate optimization with -fno-gate.  This may cause ordering problems.
%Error: Exiting due to 2 error(s)
x =  tensor([[[[247, 240,  22],
          [240,   8, 238],
          [233, 234, 211],
          [243, 212, 253]],

         [[252,  27, 222],
          [  0, 226,   7],
          [ 25,  26, 246],
          [ 92, 181, 254]]]], dtype=torch.int32)
weight =  Parameter containing:
tensor([[[[-0.0022,  0.1549],
          [-0.2376, -0.2124],
          [-0.1112,  0.0774]],

         [[-0.0057,  0.2289],
          [-0.0256,  0.0764],
          [-0.0872, -0.0567]]],


        [[[-0.2758, -0.1912],
          [-0.1190,  0.0107],
          [ 0.1141,  0.1732]],

         [[-0.1957, -0.1257],
          [ 0.1049,  0.2397],
          [-0.0594,  0.2160]]],


        [[[-0.0465,  0.0305],
          [ 0.2614, -0.2678],
          [-0.1817, -0.0731]],

         [[-0.1125,  0.2494],
          [-0.1871, -0.1329],
          [-0.2017, -0.2704]]],


        [[[-0.1685,  0.2481],
          [ 0.1288,  0.1399],
          [ 0.0152, -0.1480]],

         [[ 0.0488, -0.2695],
          [-0.2086, -0.1488],
          [ 0.1821,  0.1693]]]], requires_grad=True)
bias =  Parameter containing:
tensor([-0.1280, -0.0104,  0.1846,  0.2870], requires_grad=True)
weight =  tensor([[[[  0,   1],
          [254, 254],
          [255,   1]],

         [[  0,   2],
          [  0,   1],
          [255,   0]]],


        [[[254, 254],
          [255,   0],
          [  1,   1]],

         [[254, 255],
          [  1,   2],
          [  0,   2]]],


        [[[  0,   0],
          [  2, 254],
          [255, 255]],

         [[255,   2],
          [255, 255],
          [254, 254]]],


        [[[255,   2],
          [  1,   1],
          [  0, 255]],

         [[  0, 254],
          [254, 255],
          [  1,   1]]]], dtype=torch.int32)
bias =  tensor([255,   0,   1,   2], dtype=torch.int32)
tensor([[[[63,  0],
          [63, 59],
          [ 9,  1]],

         [[63, 60],
          [ 3, 55],
          [13,  4]],

         [[ 2,  1],
          [ 0,  1],
          [ 0, 61]],

         [[ 1, 63],
          [ 2, 16],
          [52,  5]]]], dtype=torch.int32)
/workspace/machop/mase_components/conv/test/build/convolution
##########################################
#### TEST 0 : {'DATA_WIDTH': 8, 'DATA_FRAC_WIDTH': 3, 'W_WIDTH': 8, 'W_FRAC_WIDTH': 3, 'BIAS_WIDTH': 8, 'BIAS_FRAC_WIDTH': 3, 'OUT_WIDTH': 6, 'OUT_FRAC_WIDTH': 2, 'IN_X': 3, 'IN_Y': 4, 'IN_C': 2, 'KERNEL_X': 2, 'KERNEL_Y': 3, 'OUT_C': 4, 'UNROLL_OUT_C': 2, 'UNROLL_IN_C': 2, 'UNROLL_KERNEL_OUT': 4, 'SLIDING_NUM': 6, 'STRIDE': 2, 'PADDING_Y': 2, 'PADDING_X': 1}
##########################################
INFO: Running command perl /usr/local/bin/verilator -cc --exe -Mdir /workspace/machop/mase_components/conv/test/build/convolution/test_0 -DCOCOTB_SIM=1 --top-module convolution --vpi --public-flat-rw --prefix Vtop -o convolution -LDFLAGS '-Wl,-rpath,/usr/local/lib/python3.11/dist-packages/cocotb/libs -L/usr/local/lib/python3.11/dist-packages/cocotb/libs -lcocotbvpi_verilator' -Wno-GENUNNAMED -Wno-WIDTHEXPAND -Wno-WIDTHTRUNC -Wno-UNOPTFLAT -prof-c --stats --trace -O0 -build-jobs 8 -Wno-fatal -Wno-lint -Wno-style -I/workspace/machop/mase_components/conv/rtl -I/workspace/machop/mase_components/linear/rtl -I/workspace/machop/mase_components/common/rtl -I/workspace/machop/mase_components/fixed_arithmetic/rtl -I/workspace/machop/mase_components/cast/rtl -GDATA_WIDTH=8 -GDATA_FRAC_WIDTH=3 -GW_WIDTH=8 -GW_FRAC_WIDTH=3 -GBIAS_WIDTH=8 -GBIAS_FRAC_WIDTH=3 -GOUT_WIDTH=6 -GOUT_FRAC_WIDTH=2 -GIN_X=3 -GIN_Y=4 -GIN_C=2 -GKERNEL_X=2 -GKERNEL_Y=3 -GOUT_C=4 -GUNROLL_OUT_C=2 -GUNROLL_IN_C=2 -GUNROLL_KERNEL_OUT=4 -GSLIDING_NUM=6 -GSTRIDE=2 -GPADDING_Y=2 -GPADDING_X=1 /usr/local/lib/python3.11/dist-packages/cocotb/share/lib/verilator/verilator.cpp /workspace/machop/mase_components/conv/rtl/convolution.sv in directory /workspace/machop/mase_components/conv/test/build/convolution/test_0
Process 'perl' terminated with error 1

Better Documentaiton, Tutorials and Tests

The current documetnation of MASE is somehow a bit dated, so I am thinking of having a collective effort to bring it to a more usable state, this is related to the fix/tests branch.

What we need to do for passes.rst

On a high-level, we want to achieve:

  • Each pass has its associated test, this is for both testing and also for users to have an example to play around. This is reflected in passes.rst as a table. In the usage example column, we put in the test code that has exercised this implemented pass.
  • Each pass should have its documentation on how to set up the pass_args, an example is prune, we should include a python code block to clarify things like
      .. code-block:: python
    
          pass_config = {
              "weight" : {
                  "scope": "local", # ["local, "global"] are available
                  "granularity": "element", # ["element"] are available
                  "method": "l1", # ["l1", "random"] are available
                  "sparsity": 0.5, # a float between 0.0 and 1.0
              }
              "activation" : {
                  "scope": "local", # ["local, "global"] are available
                  "granularity": "element", # ["element"] are available
                  "method": "l1", # ["l1", "random"] are available
                  "sparsity": 0.5, # a float between 0.0 and 1.0
          }
    

Module analysis passes

Module transform passes

Graph analysis passes

Graph transform passes

Graph interface passes

What we need to do for tutorials.rst

lab4: Task 3, timescale not being automatically generated?

commit: 9d7fc37

command:

from chop.actions import simulate

simulate(skip_build=False, skip_test=False)

error:
INFO: Running command perl /usr/bin/verilator -cc --exe -Mdir /home/bakhtiar/Documents/school/advanced_deep_learning_sys/lab4/sim_build -DCOCOTB_SIM=1 --top-module top --vpi --public-flat-rw --prefix Vtop -o top -LDFLAGS '-Wl,-rpath,/home/bakhtiar/.local/lib/python3.10/site-packages/cocotb/libs -L/home/bakhtiar/.local/lib/python3.10/site-packages/cocotb/libs -lcocotbvpi_verilator' -Wno-fatal -Wno-lint -Wno-style --trace -I/home/bakhtiar/.mase/top/hardware/rtl -I/home/bakhtiar/anaconda3/envs/mase/lib/python3.10/site-packages/mase_components/pycache/rtl /home/bakhtiar/.local/lib/python3.10/site-packages/cocotb/share/lib/verilator/verilator.cpp /home/bakhtiar/.mase/top/hardware/rtl/top.sv in directory /home/bakhtiar/Documents/school/advanced_deep_learning_sys/lab4/sim_build
%Error-TIMESCALEMOD: /home/bakhtiar/.mase/top/hardware/rtl/top.sv:109:3: Timescale missing on this module as other modules have it (IEEE 1800-2017 3.14.2.2)
/home/bakhtiar/.mase/top/hardware/rtl/top.sv:8:8: ... Location of module with timescale
8 | module top #(
| ^~~
%Error-TIMESCALEMOD: /home/bakhtiar/.mase/top/hardware/rtl/top.sv:165:3: Timescale missing on this module as other modules have it (IEEE 1800-2017 3.14.2.2)
/home/bakhtiar/.mase/top/hardware/rtl/top.sv:8:8: ... Location of module with timescale
8 | module top #(
| ^~~
%Error: Exiting due to 2 error(s)
... See the manual and https://verilator.org/ for more assistance.

Training Software Runner is broken

  • Runner for training does not support vision models and has some bugs in the evaluation of the loss
  • See errors below:
File "/home/bkt123/dev/advanced-deep-learning-systems/mase-2/machop/chop/actions/search/strategies/runners/software/__init__.py", line 11, in get_sw_runner
    return SW_RUNNERS[name](model_info, task, dataset_info, accelerator, config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bkt123/dev/advanced-deep-learning-systems/mase-2/machop/chop/actions/search/strategies/runners/software/base.py", line 22, in __init__
    self._post_init_setup()
  File "/home/bkt123/dev/advanced-deep-learning-systems/mase-2/machop/chop/actions/search/strategies/runners/software/train.py", line 60, in _post_init_setup
    self._setup_metric()
  File "/home/bkt123/dev/advanced-deep-learning-systems/mase-2/machop/chop/actions/search/strategies/runners/software/train.py", line 82, in _setup_metric
    raise ValueError(f"model type {self.model_info} is not supported.")
ValueError: model type MaseModelInfo(name='jsc-tiny', model_source=<ModelSource.PHYSICAL: 'physical'>, task_type=<ModelTaskType.PHYSICAL: 'physical'>, image_classification=False, physical_data_point_classification=True, sequence_classification=False, seq2seqLM=False, causal_LM=False, is_quantized=False, is_lora=False, is_sparse=False, is_fx_traceable=True) is not supported.

To reproduce:

  • Add the following runner in any search config toml, for example configs/examples/jsc_toy_by_type.toml:
[search.strategy.sw_runner.basic_train]
name = "accuracy"
data_loader = "train_dataloader"
num_samples = 1000000
max_epochs = 2
lr_scheduler = "linear"
optimizer = "adam"
learning_rate = 1e-4
num_warmup_steps = 0
  • Run the search:
./ch search --config configs/examples/jsc_toy_by_type.toml

GitHub Action PAT access

It seems that pull requests from non-admin cannot access the PAT to trigger CI properly. This needs to be fixed...

[bug] MaseGraph's classmethod from_module

MaseGraph.from_module is a classmethod but accesses to self in line 226.

@classmethod
def from_module(
cls,
model: torch.nn.Module,
cf_args: Optional[Dict[str, Any]] = None,
custom_ops: dict = {},
):
assert isinstance(
model, torch.nn.Module
), f"model must be a torch.nn.Module. Received: {type(model)}"
graph_module = self.trace_torch_module(model, cf_args, custom_ops)
return cls(model=graph_module, cf_args=cf_args)

Error in Lab3 - task 3

I am trying to run the provided code to run the search command in mase for task 3:

 !./ch search --config configs/examples/jsc_toy_by_type.toml --load '/model/path' --load-type pl 

I am getting the following error suggesting something is transforming the mase graph incorrectly, I think?

 Traceback (most recent call last):
  File "/content/mase/machop/./ch", line 6, in <module>
    ChopCLI().run()
  File "/content/mase/machop/chop/cli.py", line 249, in run
    self._run_search()
  File "/content/mase/machop/chop/cli.py", line 373, in _run_search
    search(**search_params)
  File "/content/mase/machop/chop/actions/search/search.py", line 85, in search
    search_space.build_search_space()
  File "/content/mase/machop/chop/actions/search/search_space/quantization/graph.py", line 76, in build_search_space
    mase_graph = self.rebuild_model(sampled_config=None, is_eval_mode=True)
  File "/content/mase/machop/chop/actions/search/search_space/quantization/graph.py", line 59, in rebuild_model
    mg = add_common_metadata_analysis_pass(mg, self.dummy_input)
  File "/content/mase/machop/chop/passes/graph/analysis/add_metadata/add_common_metadata.py", line 380, in add_common_metadata_analysis_pass
    logger.debug(graph.fx_graph)
AttributeError: 'tuple' object has no attribute 'fx_graph' 

I am not sure to how to proceed - if I have made a mistake somewhere or should debug the codebase

Thank you

_emit_cocotb_test attempts to access unnamed variable

def _emit_cocotb_test(graph):
    test_template = f"""
import cocotb

{inspect.getsource(test)}
"""

    tb_path = Path.home() / ".mase" / "top" / "hardware" / "test" / "mase_top_tb"
    tb_path.mkdir(parents=True, exist_ok=True)
    with open(tb_path / "test.py", "w") as f:
        f.write(test_template)

    # In this format-string below
    verilator_build = f"""
#!/bin/bash
# This script is used to build the verilator simulation
verilator --binary --build {verilator_buff}
"""
    verilator_file = os.path.join(sim_dir, "build.sh")
    with open(verilator_file, "w", encoding="utf-8") as outf:
        outf.write(verilator_build)

In the above snippet from ./machop/chop/passes/graph/transforms/verilog/emit_tb.py there is an undefined reference to verilator_buff.

Swin attention modules list

Hi, as requested I list the modules I will be using in my project:

  • Linear
  • ReLU
  • LayerNorm
  • Convolution
  • Self attention (feature/bert branch)

I hope I included all of them but might be expanded as project goes on

Error when saving parametrized module

When saving a parametrized module, for my case, adding a torch.nn.utils.parametrize.register_parametrization() to the layers, it raises error: RuntimeError: Serialization of parametrized modules is only supported through state_dict(), at /mase/machop/chop/passes/graph/interface/save_and_load.py line 13, save_graph_module_ckpt().
It seems like torch.save() cannot support the parametrized module to save the model structure.
截图 2024-03-13 15-56-27

RuntimeError: a leaf Variable that requires grad is being used in an in-place operation.

I am trying to repro Lab 4: https://github.com/DeepWok/mase/blob/main/docs/labs/lab4-hardware.ipynb
I am using commit ID: 047f27b, where I updated the test_verilog_analysis_pass.

Steps to repro:

  1. create a python file my.py
import os, sys

from chop.ir.graph.mase_graph import MaseGraph

from chop.passes.graph.analysis import (
    init_metadata_analysis_pass,
    add_common_metadata_analysis_pass,
    add_hardware_metadata_analysis_pass,
    report_node_type_analysis_pass,
    test_verilog_analysis_pass,
)

from chop.passes.graph.transforms import (
    emit_verilog_top_transform_pass,
    emit_internal_rtl_transform_pass,
    emit_bram_transform_pass,
    emit_cocotb_transform_pass,
    quantize_transform_pass,
)

from chop.tools.logger import set_logging_verbosity

set_logging_verbosity("debug")

import toml
import torch
import torch.nn as nn

class MLP(torch.nn.Module):
    def __init__(self) -> None:
        super().__init__()

        self.fc1 = nn.Linear(4, 10)

    def forward(self, x):
        x = torch.flatten(x, start_dim=1, end_dim=-1)
        x = torch.nn.functional.relu(self.fc1(x))
        return x

mlp = MLP()
mg = MaseGraph(model=mlp)

batch_size = 1
x = torch.randn((batch_size, 2, 2))
dummy_in = {"x": x}

mg, _ = init_metadata_analysis_pass(mg, None)
mg, _ = add_common_metadata_analysis_pass(
    mg, {"dummy_in": dummy_in, "add_value": False}
)

config_file = os.path.join(
    os.path.abspath(""),
    #"..",
    "..",
    "machop",
    "configs",
    "tests",
    "quantize",
    "fixed.toml",
)
with open(config_file, "r") as f:
    quan_args = toml.load(f)["passes"]["quantize"]
print("QUAN ARGS.....")
print(quan_args)
mg, _ = quantize_transform_pass(mg, quan_args)

_ = report_node_type_analysis_pass(mg)

for node in mg.fx_graph.nodes:
    for arg, arg_info in node.meta["mase"]["common"]["args"].items():
        if isinstance(arg_info, dict):
            arg_info["type"] = "fixed"
            arg_info["precision"] = [8, 3]
    for result, result_info in node.meta["mase"]["common"]["results"].items():
        if isinstance(result_info, dict):
            result_info["type"] = "fixed"
            result_info["precision"] = [8, 3]


mg, _ = add_hardware_metadata_analysis_pass(mg, None)
mg, _ = emit_verilog_top_transform_pass(mg)
mg, _ = emit_internal_rtl_transform_pass(mg)

mg, _ = emit_bram_transform_pass(mg)
mg, _ = test_verilog_analysis_pass(mg)

  1. python my.py

Error when running search from command line

Commit hash: 6a7f1cd

Trying to run the search space from command line as indicated in the in lab 3 doc

Had to add --load-type pl as the default option is mz

!./ch search --config configs/examples/jsc_toy_by_type.toml --load-type pl --load "/content/drive/MyDrive/mase_outputs/batch_size_256/software/training_ckpts/best.ckpt"

INFO     Initialising model 'jsc-tiny'...\
INFO     Initialising dataset 'jsc'...\
INFO     Project will be created at /content/mase/mase_output/jsc-tiny\
INFO     Loaded pytorch lightning checkpoint from /content/drive/MyDrive/mase_outputs/batch_size_128/software/training_ckpts/best.ckpt
INFO     Loaded model from /content/drive/MyDrive/mase_outputs/batch_size_128/software/training_ckpts/best.ckpt.
INFO     Building search space...
INFO     Search started...
100% 20/20 [00:03<00:00,  6.26it/s, 3.19/20000 seconds]
Traceback (most recent call last):
  File "/content/mase/machop/./ch", line 6, in <module>
    ChopCLI().run()
  File "/content/mase/machop/chop/cli.py", line 270, in run
    run_action_fn()
  File "/content/mase/machop/chop/cli.py", line 395, in _run_search
    search(**search_params)
  File "/content/mase/machop/chop/actions/search/search.py", line 92, in search
    strategy.search(search_space)
  File "/content/mase/machop/chop/actions/search/strategies/optuna.py", line 153, in search
    self._save_best(study, self.save_dir / "best.json")
  File "/content/mase/machop/chop/actions/search/strategies/optuna.py", line 234, in _save_best
    ].map(
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/generic.py", line 5902, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'map'. Did you mean: 'mad'?`

Error in lab 2 - transform command

I am trying to run the provided code to run the transform command in mase for lab 2:

./ch transform --config configs/examples/jsc_toy_by_type.toml --task cls --cpu=0

I am getting the following error:

 Traceback (most recent call last):
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/./ch", line 6, in <module>
    ChopCLI().run()
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/cli.py", line 270, in run
    run_action_fn()
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/cli.py", line 371, in _run_transform
    transform(**transform_params)
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/actions/transform.py", line 70, in transform
    if len(graph.model.additional_inputs) > 0:
AttributeError: 'tuple' object has no attribute 'model'

I have pulled from the upstream and installed all packages.

Example of a looking-for-help issue

This issue provides an example of a looking-for-help issue. This helps us to efficiently reproduce your problem on our end and help you to find solutions.


Question: It seems the current commen_meta_layers raises an error when analysing resnet18's BatchNorm layer?

Commit hash: 98cf7a6

Command to reproduce:

./ch transform --config configs/by_model/resnet18/resnet18.toml

Error message or full log:

Traceback (most recent call last):
  File "/data/zz7522/Projects/mase-tools/machop/./ch", line 4, in <module>
    ChopCLI().run()
  File "/data/zz7522/Projects/mase-tools/machop/chop/cli.py", line 195, in run
    self._run_transform()
  File "/data/zz7522/Projects/mase-tools/machop/chop/cli.py", line 302, in _run_transform
    transform(**transform_params)
  File "/data/zz7522/Projects/mase-tools/machop/chop/actions/transform.py", line 61, in transform
    graph = add_common_metadata_analysis_pass(graph, pass_args=dummy_in)
  File "/data/zz7522/Projects/mase-tools/machop/chop/passes/analysis/add_metadata/add_common_metadata.py", line 260, in add_common_metadata_analysis_pass
    graph = graph_iterator_for_metadata(graph, pass_args)
  File "/data/zz7522/Projects/mase-tools/machop/chop/passes/analysis/add_metadata/add_common_metadata.py", line 218, in graph_iterator_for_metadata
    analysis_common_parameters(node, dummy_in)
  File "/data/zz7522/Projects/mase-tools/machop/chop/passes/analysis/add_metadata/add_common_metadata.py", line 155, in analysis_common_parameters
    node.meta["mase"] = analyse_common_parameters_module(node.meta["mase"])
  File "/data/zz7522/Projects/mase-tools/machop/chop/passes/analysis/add_metadata/common_metadata_layers.py", line 295, in analyse_common_parameters_module
    size = _get_size_by_module_simulation(meta)
  File "/data/zz7522/Projects/mase-tools/machop/chop/passes/analysis/add_metadata/common_metadata_layers.py", line 282, in _get_size_by_module_simulation
    result = meta.module(dummy_data, *args, **kwargs)
  File "/home/zz7522/anaconda3/envs/mase-sw/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/zz7522/anaconda3/envs/mase-sw/lib/python3.10/site-packages/torch/nn/modules/batchnorm.py", line 171, in forward
    return F.batch_norm(
  File "/home/zz7522/anaconda3/envs/mase-sw/lib/python3.10/site-packages/torch/nn/functional.py", line 2448, in batch_norm
    _verify_batch_size(input.size())
  File "/home/zz7522/anaconda3/envs/mase-sw/lib/python3.10/site-packages/torch/nn/functional.py", line 2416, in _verify_batch_size
    raise ValueError("Expected more than 1 value per channel when training, got input size {}".format(size))
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 512, 1, 1])

torch version

HI, could you please tell me what version of the torch you are using? And could you please also tell me details of the environment you are using like cuda version etc.? Thank you

Error when running transform: Expected all tensors to be on the same device

Question: Expected all tensors to be on the same device when running

Commit hash: 6e0304d

Command to reproduce:

./ch transform --config configs/examples/jsc_toy_by_type.toml --task cls --accelerator=cpu

Error message or full log:

Seed set to 0
+-------------------------+--------------------------+--------------+-----------------+--------------------------+
| Name | Default | Config. File | Manual Override | Effective |
+-------------------------+--------------------------+--------------+-----------------+--------------------------+
| task | classification | cls | cls | cls |
| load_name | None | | | None |
| load_type | mz | | | mz |
| batch_size | 128 | 512 | | 512 |
| to_debug | False | | | False |
| log_level | info | | | info |
| report_to | tensorboard | | | tensorboard |
| seed | 0 | 42 | | 42 |
| quant_config | None | | | None |
| training_optimizer | adam | | | adam |
| trainer_precision | 16-mixed | | | 16-mixed |
| learning_rate | 1e-05 | 0.01 | | 0.01 |
| weight_decay | 0 | | | 0 |
| max_epochs | 20 | 5 | | 5 |
| max_steps | -1 | | | -1 |
| accumulate_grad_batches | 1 | | | 1 |
| log_every_n_steps | 50 | 5 | | 5 |
| num_workers | 8 | | | 8 |
| num_devices | 1 | | | 1 |
| num_nodes | 1 | | | 1 |
| accelerator | auto | cpu | cpu | cpu |
| strategy | auto | | | auto |
| is_to_auto_requeue | False | | | False |
| github_ci | False | | | False |
| disable_dataset_cache | False | | | False |
| target | xcu250-figd2104-2L-e | | | xcu250-figd2104-2L-e |
| num_targets | 100 | | | 100 |
| is_pretrained | False | | | False |
| max_token_len | 512 | | | 512 |
| project_dir | /home/laurie2905/mase/ma | | | /home/laurie2905/mase/ma |
| | se_output | | | se_output |
| project | None | jsc-tiny | | jsc-tiny |
| model | None | jsc-tiny | | jsc-tiny |
| dataset | None | jsc | | jsc |
+-------------------------+--------------------------+--------------+-----------------+--------------------------+
INFO Initialising model 'jsc-tiny'...
INFO Initialising dataset 'jsc'...
INFO Project will be created at /home/laurie2905/mase/mase_output/jsc-tiny
INFO Transforming model 'jsc-tiny'...
Traceback (most recent call last):
File "/home/laurie2905/mase/machop/./ch", line 6, in
ChopCLI().run()
File "/home/laurie2905/mase/machop/chop/cli.py", line 243, in run
self._run_transform()
File "/home/laurie2905/mase/machop/chop/cli.py", line 350, in _run_transform
transform(**transform_params)
File "/home/laurie2905/mase/machop/chop/actions/transform.py", line 74, in transform
graph, _ = add_common_metadata_analysis_pass(
File "/home/laurie2905/mase/machop/chop/passes/graph/analysis/add_metadata/add_common_metadata.py", line 382, in add_common_metadata_analysis_pass
graph = graph_iterator_for_metadata(graph, **pass_args)
File "/home/laurie2905/mase/machop/chop/passes/graph/analysis/add_metadata/add_common_metadata.py", line 203, in graph_iterator_for_metadata
result = modules[node.target](*args, **kwargs)
File "/home/laurie2905/anaconda3/envs/mase/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/laurie2905/anaconda3/envs/mase/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/laurie2905/anaconda3/envs/mase/lib/python3.10/site-packages/torch/nn/modules/batchnorm.py", line 171, in forward
return F.batch_norm(
File "/home/laurie2905/anaconda3/envs/mase/lib/python3.10/site-packages/torch/nn/functional.py", line 2478, in batch_norm
return torch.batch_norm(
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument weight in method wrapper_CUDA__native_batch_norm)

CLI Transform Command not working

To replicate:

Train a small network
./ch train jsc-tiny jsc --max-epochs 1

Quantise it
./ch transform jsc-tiny jsc --config configs/archive/test/integer.toml --load {YOUR_CKPT_DIR} --load-type -pl

PR #12 addresses some of the issues and explains the current error output

Hardware Regression Test

We are refactoring the regression tests under the fix/tests branch. On the hardware side, we observed the following errors. Due to the large number of failed test cases, it is too challenging for us to fix them in a single PR. Here we listed the observed errors below and plan progressive fixes in the future:

ERRORS:

  • FAILED src/mase_components/activations/test/fixed_gelu_tb.py::test_fixed_gelu -SystemExit: Process 'perl' terminated with error 1
  • FAILED src/mase_components/activations/test/fixed_selu_tb.py::test_fixed_selu -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/activations/test/build/fixed_selu/test_0/test_fixed_selu.results.xml not found.
  • FAILED src/mase_components/activations/test/fixed_softermax_1d_tb.py::test_fixed_softermax_1d_smoke -KeyError: 'activations/fixed_softermax_1d'
  • FAILED src/mase_components/activations/test/fixed_softermax_tb.py::test_fixed_softermax_smoke -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/activations/test/build/fixed_softermax/test_0/test_fixed_softermax_smoke.results.xml not found.
  • FAILED src/mase_components/activations/test/fixed_softplus_tb.py::test_fixed_softplus -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/activations/test/build/fixed_softplus/test_0/test_fixed_softplus.results.xml not found.
  • FAILED src/mase_components/activations/test/fixed_softsign_tb.py::test_fixed_softsign -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/activations/test/build/fixed_softsign/test_0/test_fixed_softsign.results.xml not found.
  • FAILED src/mase_components/activations/test/fixed_tanh_tb.py::test_fixed_tanh -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/activations/test/build/fixed_tanh/test_0/test_fixed_tanh.results.xml not found.
  • FAILED src/mase_components/activations/test/test_lint_activations.py::test_lint_activations -SystemExit: 1
  • FAILED src/mase_components/attention/test/test_lint_attention.py::test_lint_attention -SystemExit: 1
  • FAILED src/mase_components/cast/test/fixed_cast_tb.py::test_fixed_cast -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/cast/test/build/fixed_cast/test_0/test_fixed_cast.results.xml not found.
  • FAILED src/mase_components/cast/test/fixed_rounding_tb.py::test_fixed_rounding -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/cast/test/build/fixed_roundin$/test_0/test_fixed_rounding.results.xml not found.
  • FAILED src/mase_components/common/test/cut_data_tb.py::test_cut_data -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/common/test/build/cut_data/test_0/test_cut_data.results.xml not found.
  • FAILED src/mase_components/common/test/fifo_tb.py::test_fifo -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/common/test/build/fifo/test_0/test_fifo.results.xml not found.
  • FAILED src/mase_components/common/test/input_buffer_tb.py::test_input_buffer -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/common/test/build/input_buffer/test_0/test_input_buffer.results.xml not found.
  • FAILED src/mase_components/common/test/lut_tb.py::test_lut -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/common/test/build/lut/test_0/test_lut.results.xml not found.
  • FAILED src/mase_components/common/test/repeat_circular_buffer_tb.py::test_repeat_circular_buffer -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/common/test/build/repeat_circular_buffer/test_3/test_repeat_circular_buffer.results.xml not found.
  • FAILED src/mase_components/common/test/skid_buffer_tb.py::test_skid_buffer -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/common/test/build/skid_buffer/test_0/test_skid_buffer.results.xml not found.
  • FAILED src/mase_components/common/test/wrap_data_tb.py::test_wrap_data -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/common/test/build/wrap_data/test_0/test_wrap_data.results.xml not found.
  • FAILED src/mase_components/conv/test/sliding_window_tb.py::test_sliding_window -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/conv/test/build/sliding_window/test_0/test_sliding_window.results.xml not found.
  • FAILED src/mase_components/fixed_arithmetic/test/fixed_accumulator_tb.py::test_fixed_accumulator -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/fixed_arithmetic/test/build/fixed_accumulator/test_0/test_fixed_accumulator.results.xml not found.
  • FAILED src/mase_components/fixed_arithmetic/test/fixed_adder_tree_layer_tb.py::test_fixed_adder_tree_layer -KeyError: 'fixed_arithmetic/fixed_adder_tree_layer'
  • FAILED src/mase_components/fixed_arithmetic/test/fixed_adder_tree_tb.py::test_fixed_adder_tree -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/fixed_arithmetic/test/build/fixed_adder_tree/test_0/test_fixed_adder_tree.results.xml not found.
  • FAILED src/mase_components/fixed_arithmetic/test/fixed_mult_tb.py::test_fixed_mult -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/fixed_arithmetic/test/build/fixed_mult/test_0/test_fixed_mult.results.xml not found.
  • FAILED src/mase_components/fixed_arithmetic/test/fixed_nr_stage_tb.py::test_fixed_nr_stage
  • FAILED src/mase_components/fixed_arithmetic/test/fixed_vector_mult_tb.py::test_fixed_vector_mult -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/fixed_arithmetic/test/build/fixed_vector_mult/test_0/test_fixed_vector_mult.results.xml not found.
  • FAILED src/mase_components/fixed_arithmetic/test/test_lint_fixed_arithmetic.py::test_lint_fixed_arithmetic -SystemExit: 1
  • FAILED src/mase_components/fixed_math/test/test_lint_fixed_math.py::test_lint_fixed_math -SystemExit: 1
  • FAILED src/mase_components/linear/test/fixed_linear_tb.py::test_fixed_linear_smoke -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/linear/test/build/fixed_linear/test_0/test_fixed_linear_smoke.results.xml not found.
  • FAILED src/mase_components/linear/test/fixed_linear_tb.py::test_fixed_linear_regression -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/linear/test/build/fixed_linear/test_0/test_fixed_linear_regression.results.xml not found.
  • FAILED src/mase_components/llm/test/find_max_tb.py::test_find_max -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/llm/test/build/find_max/test_0/results.xml not found.
  • FAILED src/mase_components/llm/test/fixed_comparator_tree_layer_tb.py::test_fixed_comparator_tree_layer -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/llm/test/build/fixed_comparator_tree_layer/test_0/results.xml not found.
  • FAILED src/mase_components/llm/test/quantized_matmul_tb.py::test_quantized_matmul -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/llm/test/build/quantized_matmul/test_0/results.xml not found.
  • FAILED src/mase_components/llm/test/quantizer_top_tb.py::test_quantizer_top -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/llm/test/build/quantizer_top/test_0/results.xml not found.
  • FAILED src/mase_components/llm/test/scatter_tb.py::test_scatter -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/llm/test/build/scatter/test_0/results.xml not found.
  • FAILED src/mase_components/llm/test/test_lint_llm.py::test_lint_llm -SystemExit: 1
  • FAILED src/mase_components/matmul/test/matmul_tb.py::test_matmul -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/matmul/test/build/matmul/test_2/test_matmul.results.xml not found.
  • FAILED src/mase_components/matmul/test/simple_matmul_tb.py::test_simple_matmul -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/matmul/test/build/simple_matmul/test_0/test_simple_matmul.results.xml not found.
  • FAILED src/mase_components/matmul/test/test_lint_matmul.py::test_lint_matmul -SystemExit: 1
  • FAILED src/mase_components/matmul/test/transpose_tb.py::test_transpose -SystemExit: ERROR: Simulation terminated abnormally. Results file /workspace/src/mase_components/matmul/test/build/transpose/test_0/test_transpose.results.xml not found.
  • FAILED src/mase_components/ViT/test/affine_layernorm_tb.py
  • FAILED src/mase_components/ViT/test/fixed_block_tb.py
  • FAILED src/mase_components/ViT/test/fixed_mlp_tb.py
  • FAILED src/mase_components/ViT/test/fixed_msa_tb.py
  • FAILED src/mase_components/ViT/test/fixed_patch_embed_tb.py
  • FAILED src/mase_components/ViT/test/fixed_pvt_tb.py
  • FAILED src/mase_components/ViT/test/hash_softmax_tb.py
  • FAILED src/mase_components/activations/test/fixed_elu_tb.py
  • FAILED src/mase_components/activations/test/fixed_hardshrink_tb.py
  • FAILED src/mase_components/activations/test/fixed_hardswish_tb.py
  • FAILED src/mase_components/activations/test/fixed_leaky_relu_tb.py
  • FAILED src/mase_components/activations/test/fixed_logsigmoid_tb.py
  • FAILED src/mase_components/activations/test/fixed_sigmoid_tb.py
  • FAILED src/mase_components/activations/test/fixed_silu_tb.py
  • FAILED src/mase_components/activations/test/fixed_softmax_tb.py
  • FAILED src/mase_components/activations/test/fixed_softshrink_tb.py
  • FAILED src/mase_components/activations/test/softermax_global_norm_tb.py
  • FAILED src/mase_components/activations/test/softermax_local_window_tb.py
  • FAILED src/mase_components/activations/test/softermax_lpw_pow2_tb.py
  • FAILED src/mase_components/activations/test/softermax_lpw_reciprocal_tb.py
  • FAILED src/mase_components/attention/test/fixed_gqa_head_tb.py
  • FAILED src/mase_components/attention/test/fixed_self_attention_head_tb.py
  • FAILED src/mase_components/attention/test/fixed_self_attention_tb.py
  • FAILED src/mase_components/cast/test/fixed_signed_cast_tb.py
  • FAILED src/mase_components/conv/test/convolution_tb.py
  • FAILED src/mase_components/norm/test/batch_norm_2d_tb.py
  • FAILED src/mase_components/norm/test/group_norm_2d_tb.py
  • FAILED src/mase_components/norm/test/rms_norm_2d_tb.py

Failed Tests:

  • src/mase_components/activations/test/fixed_gelu_tb.py:68 test_fixed_gelu
  • src/mase_components/activations/test/fixed_selu_tb.py:68 test_fixed_selu
  • src/mase_components/activations/test/fixed_softermax_1d_tb.py:183 test_fixed_softermax_1d_smoke
  • src/mase_components/activations/test/fixed_softermax_tb.py:128 test_fixed_softermax_smoke
  • src/mase_components/activations/test/fixed_softplus_tb.py:68 test_fixed_softplus
  • src/mase_components/activations/test/fixed_softsign_tb.py:68 test_fixed_softsign
  • src/mase_components/activations/test/fixed_tanh_tb.py:68 test_fixed_tanh
  • src/mase_components/activations/test/test_lint_activations.py:6 test_lint_activations
  • src/mase_components/attention/test/test_lint_attention.py:6 test_lint_attention
  • src/mase_components/cast/test/fixed_cast_tb.py:109 test_fixed_cast
  • src/mase_components/cast/test/fixed_rounding_tb.py:95 test_fixed_rounding
  • src/mase_components/common/test/cut_data_tb.py:149 test_cut_data
  • src/mase_components/common/test/fifo_tb.py:120 test_fifo
  • src/mase_components/common/test/input_buffer_tb.py:161 test_input_buffer
  • src/mase_components/common/test/lut_tb.py:74 test_lut
  • src/mase_components/common/test/repeat_circular_buffer_tb.py:146 test_repeat_circular_buffer
  • src/mase_components/common/test/skid_buffer_tb.py:137 test_skid_buffer
  • src/mase_components/common/test/wrap_data_tb.py:178 test_wrap_data
  • src/mase_components/conv/test/sliding_window_tb.py:266 test_sliding_window
  • src/mase_components/fixed_arithmetic/test/fixed_accumulator_tb.py:125 test_fixed_accumulator
  • src/mase_components/fixed_arithmetic/test/fixed_adder_tree_layer_tb.py:84 test_fixed_adder_tree_layer
  • src/mase_components/fixed_arithmetic/test/fixed_adder_tree_tb.py:156 test_fixed_adder_tree
  • src/mase_components/fixed_arithmetic/test/fixed_mult_tb.py:38 test_fixed_mult
  • src/mase_components/fixed_arithmetic/test/fixed_vector_mult_tb.py:234 test_fixed_vector_mult
  • src/mase_components/fixed_arithmetic/test/test_lint_fixed_arithmetic.py:4 test_lint_fixed_arithmetic
  • src/mase_components/fixed_math/test/test_lint_fixed_math.py:4 test_lint_fixed_math
  • src/mase_components/linear/test/fixed_linear_tb.py:216 test_fixed_linear_smoke
  • src/mase_components/linear/test/fixed_linear_tb.py:231 test_fixed_linear_regression
  • src/mase_components/llm/test/find_max_tb.py:202 test_find_max
  • src/mase_components/llm/test/fixed_comparator_tree_layer_tb.py:81 test_fixed_comparator_tree_layer
  • src/mase_components/llm/test/quantized_matmul_tb.py:229 test_quantized_matmul
  • src/mase_components/llm/test/quantizer_top_tb.py:206 test_quantizer_top
  • src/mase_components/llm/test/scatter_tb.py:179 test_scatter
  • src/mase_components/llm/test/test_lint_llm.py:4 test_lint_llm
  • src/mase_components/matmul/test/matmul_tb.py:183 test_matmul
  • src/mase_components/matmul/test/simple_matmul_tb.py:250 test_simple_matmul
  • src/mase_components/matmul/test/test_lint_matmul.py:4 test_lint_matmul
  • src/mase_components/matmul/test/transpose_tb.py:68 test_transpose

These test cases are considered WIP and skipped in the CI at moment. We may assign group members to fix a group of these test cases and also hope users who need them can help fixing these tests and add them back to the CI (by marking it as normal). We will soon add a doc about these test categories under the test folder.

Open file issue caused by incomplete dataset installation

The terminal has been killed accidentally by an external interrupt when running code:
./ch train jsc-tiny jsc --max-epochs 10 --batch-size 256

After that the code will have following issues:

INFO Initialising model 'jsc-tiny'...
INFO Initialising dataset 'jsc'...
INFO Project will be created at /home/super_monkey/mase/mase_output/jsc-tiny_classification_jsc_2024-01-27
INFO Training model 'jsc-tiny'...
Using 16bit Automatic Mixed Precision (AMP)
GPU available: True (cuda), used: True
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
HPU available: False, using: 0 HPUs
Traceback (most recent call last):
Traceback (most recent call last):
File "/home/super_monkey/mase/machop/./ch", line 6, in
ChopCLI().run()
File "/home/super_monkey/mase/machop/chop/cli.py", line 245, in run
self._run_train()
File "/home/super_monkey/mase/machop/chop/cli.py", line 291, in _run_train
train(**train_params)
File "/home/super_monkey/mase/machop/chop/actions/train.py", line 109, in train
trainer.fit(
File "/home/super_monkey/anaconda3/envs/mase/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 544, in fit
call._call_and_handle_interrupt(
File "/home/super_monkey/anaconda3/envs/mase/lib/python3.10/site-packages/pytorch_lightning/trainer/call.py", line 44, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/home/super_monkey/anaconda3/envs/mase/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 580, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/home/super_monkey/anaconda3/envs/mase/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 941, in _run
self._data_connector.prepare_data()
File "/home/super_monkey/anaconda3/envs/mase/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/data_connector.py", line 94, in prepare_data
call._call_lightning_datamodule_hook(trainer, "prepare_data")
File "/home/super_monkey/anaconda3/envs/mase/lib/python3.10/site-packages/pytorch_lightning/trainer/call.py", line 179, in _call_lightning_datamodule_hook
return fn(*args, **kwargs)
File "/home/super_monkey/mase/machop/chop/dataset/init.py", line 191, in prepare_data
train_dataset.prepare_data()
File "/home/super_monkey/mase/machop/chop/dataset/physical/jsc.py", line 167, in prepare_data
_preprocess_jsc_dataset(self.h5py_file_path, self.config)
File "/home/super_monkey/mase/machop/chop/dataset/physical/jsc.py", line 82, in _preprocess_jsc_dataset
with h5py.File(path, "r") as h5py_file:
File "/home/super_monkey/anaconda3/envs/mase/lib/python3.10/site-packages/h5py/_hl/files.py", line 562, in init
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
File "/home/super_monkey/anaconda3/envs/mase/lib/python3.10/site-packages/h5py/_hl/files.py", line 235, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 102, in h5py.h5f.open
<

This can be fixed manually by removing the file inside a hidden folder './.machop_cache/dataset', the programme didn't report any issue about the incompleteness. Maybe it will be a good idea to check the integrity of the dataset before open files.

Vision models unable to run on MNIST dataset

I'm Mauro Marino from Group 0 (Mauro Marino, William Powell) working on Project 1 (TensorRT integration in MASE).

This issue describes a problem found when coupling vision models with MNIST dataset; a pull request has been opened with a proposed solution.

Question: Most vision models appear to be unable to train on MNIST dataset.

First Example:

Command to reproduce:
./ch train toy_convnet mnist --max-epochs 5 --accelerator cpu

Error message or full log:

  File "/root/mase-1/machop/./ch", line 6, in <module>
    ChopCLI().run()
  File "/root/mase-1/machop/chop/cli.py", line 270, in run
    run_action_fn()
  File "/root/mase-1/machop/chop/cli.py", line 314, in _run_train
    train(**train_params)
  File "/root/mase-1/machop/chop/actions/train.py", line 109, in train
    trainer.fit(
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 544, in fit
    call._call_and_handle_interrupt(
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/call.py", line 44, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 580, in _fit_impl
    self._run(model, ckpt_path=ckpt_path)
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 987, in _run
    results = self._run_stage()
              ^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 1031, in _run_stage
    self._run_sanity_check()
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 1060, in _run_sanity_check
    val_loop.run()
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/loops/utilities.py", line 182, in _decorator
    return loop_run(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 135, in run
    self._evaluation_step(batch, batch_idx, dataloader_idx, dataloader_iter)
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 396, in _evaluation_step
    output = call._call_strategy_hook(trainer, hook_name, *step_args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/call.py", line 309, in _call_strategy_hook
    output = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/strategies/strategy.py", line 412, in validation_step
    return self.lightning_module.validation_step(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/mase-1/machop/chop/plt_wrapper/base.py", line 54, in validation_step
    y_hat = self.forward(x)
            ^^^^^^^^^^^^^^^
  File "/root/mase-1/machop/chop/plt_wrapper/base.py", line 39, in forward
    return self.model(x)
           ^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/mase-1/machop/chop/models/toys/toy.py", line 110, in forward
    x = self.block_1(x)
        ^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/container.py", line 217, in forward
    input = module(input)
            ^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/conv.py", line 460, in forward
    return self._conv_forward(input, self.weight, self.bias)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/conv.py", line 456, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Given groups=1, weight of size [8, 3, 3, 3], expected input[128, 1, 28, 28] to have 3 channels, but got 1 channels instead

Second Example:
./ch train mobilenetv3_small mnist --max-epochs 5 --accelerator cpu

Error message or full log:

  File "/root/mase-1/machop/./ch", line 6, in <module>
    ChopCLI().run()
  File "/root/mase-1/machop/chop/cli.py", line 270, in run
    run_action_fn()
  File "/root/mase-1/machop/chop/cli.py", line 314, in _run_train
    train(**train_params)
  File "/root/mase-1/machop/chop/actions/train.py", line 109, in train
    trainer.fit(
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 544, in fit
    call._call_and_handle_interrupt(
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/call.py", line 44, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 580, in _fit_impl
    self._run(model, ckpt_path=ckpt_path)
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 987, in _run
    results = self._run_stage()
              ^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 1031, in _run_stage
    self._run_sanity_check()
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 1060, in _run_sanity_check
    val_loop.run()
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/loops/utilities.py", line 182, in _decorator
    return loop_run(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 135, in run
    self._evaluation_step(batch, batch_idx, dataloader_idx, dataloader_iter)
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 396, in _evaluation_step
    output = call._call_strategy_hook(trainer, hook_name, *step_args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/trainer/call.py", line 309, in _call_strategy_hook
    output = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/pytorch_lightning/strategies/strategy.py", line 412, in validation_step
    return self.lightning_module.validation_step(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/mase-1/machop/chop/plt_wrapper/base.py", line 54, in validation_step
    y_hat = self.forward(x)
            ^^^^^^^^^^^^^^^
  File "/root/mase-1/machop/chop/plt_wrapper/base.py", line 39, in forward
    return self.model(x)
           ^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/mase-1/machop/chop/models/vision/mobilenet_v3/mobilenetv3.py", line 374, in forward
    return self._forward_impl(x)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/mase-1/machop/chop/models/vision/mobilenet_v3/mobilenetv3.py", line 364, in _forward_impl
    x = self.features(x)
        ^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/container.py", line 217, in forward
    input = module(input)
            ^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/container.py", line 217, in forward
    input = module(input)
            ^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/conv.py", line 460, in forward
    return self._conv_forward(input, self.weight, self.bias)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mase/lib/python3.11/site-packages/torch/nn/modules/conv.py", line 456, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Given groups=1, weight of size [16, 3, 3, 3], expected input[128, 1, 28, 28] to have 3 channels, but got 1 channels instead

Errors in auto generated Verilog code in Lab4_hardware

  • Lots of error raised when try to run top/hardware/sim/build.sh following the instruction in lab4_hardware.
  • Detail of error message is below, seems there are conflicts in auto generated .sv files.
%Warning-MODDUP: top/hardware/sim/verilog/fc1_bias.sv:9:8: Duplicate declaration of module: 'fc1_bias_rom'
    9 | module fc1_bias_rom #(
      |        ^~~~~~~~~~~~
                 top/hardware/rtl/fc1_bias.sv:9:8: ... Location of original declaration
    9 | module fc1_bias_rom #(
      |        ^~~~~~~~~~~~
                 ... For warning description see https://verilator.org/warn/MODDUP?v=5.020
                 ... Use "/* verilator lint_off MODDUP */" and lint_on around source to disable this message.
%Warning-MODDUP: top/hardware/sim/verilog/fc1_bias.sv:36:8: Duplicate declaration of module: 'fc1_bias'
   36 | module fc1_bias #(
      |        ^~~~~~~~
                 top/hardware/rtl/fc1_bias.sv:36:8: ... Location of original declaration
   36 | module fc1_bias #(
      |        ^~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc1_bias.sv:59:8: Duplicate declaration of module: 'fc1_bias_source'
   59 | module fc1_bias_source #(
      |        ^~~~~~~~~~~~~~~
                 top/hardware/rtl/fc1_bias.sv:59:8: ... Location of original declaration
   59 | module fc1_bias_source #(
      |        ^~~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc1_weight.sv:9:8: Duplicate declaration of module: 'fc1_weight_rom'
    9 | module fc1_weight_rom #(
      |        ^~~~~~~~~~~~~~
                 top/hardware/rtl/fc1_weight.sv:9:8: ... Location of original declaration
    9 | module fc1_weight_rom #(
      |        ^~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc1_weight.sv:36:8: Duplicate declaration of module: 'fc1_weight'
   36 | module fc1_weight #(
      |        ^~~~~~~~~~
                 top/hardware/rtl/fc1_weight.sv:36:8: ... Location of original declaration
   36 | module fc1_weight #(
      |        ^~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc1_weight.sv:59:8: Duplicate declaration of module: 'fc1_weight_source'
   59 | module fc1_weight_source #(
      |        ^~~~~~~~~~~~~~~~~
                 top/hardware/rtl/fc1_weight.sv:59:8: ... Location of original declaration
   59 | module fc1_weight_source #(
      |        ^~~~~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc2_bias.sv:9:8: Duplicate declaration of module: 'fc2_bias_rom'
    9 | module fc2_bias_rom #(
      |        ^~~~~~~~~~~~
                 top/hardware/rtl/fc2_bias.sv:9:8: ... Location of original declaration
    9 | module fc2_bias_rom #(
      |        ^~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc2_bias.sv:36:8: Duplicate declaration of module: 'fc2_bias'
   36 | module fc2_bias #(
      |        ^~~~~~~~
                 top/hardware/rtl/fc2_bias.sv:36:8: ... Location of original declaration
   36 | module fc2_bias #(
      |        ^~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc2_bias.sv:59:8: Duplicate declaration of module: 'fc2_bias_source'
   59 | module fc2_bias_source #(
      |        ^~~~~~~~~~~~~~~
                 top/hardware/rtl/fc2_bias.sv:59:8: ... Location of original declaration
   59 | module fc2_bias_source #(
      |        ^~~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc2_weight.sv:9:8: Duplicate declaration of module: 'fc2_weight_rom'
    9 | module fc2_weight_rom #(
      |        ^~~~~~~~~~~~~~
                 top/hardware/rtl/fc2_weight.sv:9:8: ... Location of original declaration
    9 | module fc2_weight_rom #(
      |        ^~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc2_weight.sv:36:8: Duplicate declaration of module: 'fc2_weight'
   36 | module fc2_weight #(
      |        ^~~~~~~~~~
                 top/hardware/rtl/fc2_weight.sv:36:8: ... Location of original declaration
   36 | module fc2_weight #(
      |        ^~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc2_weight.sv:59:8: Duplicate declaration of module: 'fc2_weight_source'
   59 | module fc2_weight_source #(
      |        ^~~~~~~~~~~~~~~~~
                 top/hardware/rtl/fc2_weight.sv:59:8: ... Location of original declaration
   59 | module fc2_weight_source #(
      |        ^~~~~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc3_bias.sv:9:8: Duplicate declaration of module: 'fc3_bias_rom'
    9 | module fc3_bias_rom #(
      |        ^~~~~~~~~~~~
                 top/hardware/rtl/fc3_bias.sv:9:8: ... Location of original declaration
    9 | module fc3_bias_rom #(
      |        ^~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc3_bias.sv:36:8: Duplicate declaration of module: 'fc3_bias'
   36 | module fc3_bias #(
      |        ^~~~~~~~
                 top/hardware/rtl/fc3_bias.sv:36:8: ... Location of original declaration
   36 | module fc3_bias #(
      |        ^~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc3_bias.sv:59:8: Duplicate declaration of module: 'fc3_bias_source'
   59 | module fc3_bias_source #(
      |        ^~~~~~~~~~~~~~~
                 top/hardware/rtl/fc3_bias.sv:59:8: ... Location of original declaration
   59 | module fc3_bias_source #(
      |        ^~~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc3_weight.sv:9:8: Duplicate declaration of module: 'fc3_weight_rom'
    9 | module fc3_weight_rom #(
      |        ^~~~~~~~~~~~~~
                 top/hardware/rtl/fc3_weight.sv:9:8: ... Location of original declaration
    9 | module fc3_weight_rom #(
      |        ^~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc3_weight.sv:36:8: Duplicate declaration of module: 'fc3_weight'
   36 | module fc3_weight #(
      |        ^~~~~~~~~~
                 top/hardware/rtl/fc3_weight.sv:36:8: ... Location of original declaration
   36 | module fc3_weight #(
      |        ^~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/fc3_weight.sv:59:8: Duplicate declaration of module: 'fc3_weight_source'
   59 | module fc3_weight_source #(
      |        ^~~~~~~~~~~~~~~~~
                 top/hardware/rtl/fc3_weight.sv:59:8: ... Location of original declaration
   59 | module fc3_weight_source #(
      |        ^~~~~~~~~~~~~~~~~
%Warning-MODDUP: top/hardware/sim/verilog/top.sv:8:8: Duplicate declaration of module: 'top'
    8 | module top #(
      |        ^~~
                 top/hardware/rtl/top.sv:8:8: ... Location of original declaration
    8 | module top #(
      |        ^~~
%Warning-PINMISSING: top/hardware/sim/verilog/top_tb.sv:148:7: Cell has missing pin: 'data_in_0'
  148 |   top AESL_inst_top(
      |       ^~~~~~~~~~~~~
%Warning-PINMISSING: top/hardware/sim/verilog/top_tb.sv:148:7: Cell has missing pin: 'data_in_0_valid'
  148 |   top AESL_inst_top(
      |       ^~~~~~~~~~~~~
%Warning-PINMISSING: top/hardware/sim/verilog/top_tb.sv:148:7: Cell has missing pin: 'data_in_0_ready'
  148 |   top AESL_inst_top(
      |       ^~~~~~~~~~~~~
%Warning-PINMISSING: top/hardware/sim/verilog/top_tb.sv:148:7: Cell has missing pin: 'data_out_0'
  148 |   top AESL_inst_top(
      |       ^~~~~~~~~~~~~
%Warning-PINMISSING: top/hardware/sim/verilog/top_tb.sv:148:7: Cell has missing pin: 'data_out_0_valid'
  148 |   top AESL_inst_top(
      |       ^~~~~~~~~~~~~
%Warning-PINMISSING: top/hardware/sim/verilog/top_tb.sv:148:7: Cell has missing pin: 'data_out_0_ready'
  148 |   top AESL_inst_top(
      |       ^~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:44:30: Can't find definition of variable: 'False'
   44 |     parameter relu_INPLACE = False,
      |                              ^~~~~
%Error: top/hardware/rtl/top.sv:130:58: Can't find definition of variable: 'fc3_DATA_OUT_0_PARALLELISM_DIM_2'
                                      : ... Suggested alternative: 'fc3_DATA_OUT_0_PARALLELISM_0_DIM_2'
  130 |     output  [fc3_DATA_OUT_0_PRECISION_0-1:0] data_out_0 [fc3_DATA_OUT_0_PARALLELISM_DIM_2*fc3_DATA_OUT_0_PARALLELISM_DIM_1*fc3_DATA_OUT_0_PARALLELISM_DIM_0-1:0],
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:130:91: Can't find definition of variable: 'fc3_DATA_OUT_0_PARALLELISM_DIM_1'
                                      : ... Suggested alternative: 'fc3_DATA_OUT_0_PARALLELISM_DIM_2'
  130 |     output  [fc3_DATA_OUT_0_PRECISION_0-1:0] data_out_0 [fc3_DATA_OUT_0_PARALLELISM_DIM_2*fc3_DATA_OUT_0_PARALLELISM_DIM_1*fc3_DATA_OUT_0_PARALLELISM_DIM_0-1:0],
      |                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:130:124: Can't find definition of variable: 'fc3_DATA_OUT_0_PARALLELISM_DIM_0'
                                       : ... Suggested alternative: 'fc3_DATA_OUT_0_PARALLELISM_DIM_1'
  130 |     output  [fc3_DATA_OUT_0_PRECISION_0-1:0] data_out_0 [fc3_DATA_OUT_0_PARALLELISM_DIM_2*fc3_DATA_OUT_0_PARALLELISM_DIM_1*fc3_DATA_OUT_0_PARALLELISM_DIM_0-1:0],
      |                                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:138:8: Can't find definition of variable: 'fc1_IN_0_PRECISION_0'
                                     : ... Suggested alternative: 'fc1_BIAS_PRECISION_0'
  138 | logic [fc1_IN_0_PRECISION_0-1:0]  fc1_data_in_0        [fc1_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:138:57: Can't find definition of variable: 'fc1_IN_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'fc1_BIAS_TENSOR_SIZE_DIM_0'
  138 | logic [fc1_IN_0_PRECISION_0-1:0]  fc1_data_in_0        [fc1_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:147:8: Can't find definition of variable: 'fc1_OUT_0_PRECISION_0'
                                     : ... Suggested alternative: 'fc1_IN_0_PRECISION_0'
  147 | logic [fc1_OUT_0_PRECISION_0-1:0]  fc1_data_out_0        [fc1_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:147:59: Can't find definition of variable: 'fc1_OUT_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'fc1_IN_0_TENSOR_SIZE_DIM_0'
  147 | logic [fc1_OUT_0_PRECISION_0-1:0]  fc1_data_out_0        [fc1_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:153:8: Can't find definition of variable: 'relu_IN_0_PRECISION_0'
                                     : ... Suggested alternative: 'fc1_IN_0_PRECISION_0'
  153 | logic [relu_IN_0_PRECISION_0-1:0]  relu_data_in_0        [relu_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:153:59: Can't find definition of variable: 'relu_IN_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'fc1_IN_0_TENSOR_SIZE_DIM_0'
  153 | logic [relu_IN_0_PRECISION_0-1:0]  relu_data_in_0        [relu_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:156:8: Can't find definition of variable: 'relu_OUT_0_PRECISION_0'
                                     : ... Suggested alternative: 'relu_IN_0_PRECISION_0'
  156 | logic [relu_OUT_0_PRECISION_0-1:0]  relu_data_out_0        [relu_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:156:61: Can't find definition of variable: 'relu_OUT_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'relu_IN_0_TENSOR_SIZE_DIM_0'
  156 | logic [relu_OUT_0_PRECISION_0-1:0]  relu_data_out_0        [relu_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:162:8: Can't find definition of variable: 'fc2_IN_0_PRECISION_0'
                                     : ... Suggested alternative: 'fc1_IN_0_PRECISION_0'
  162 | logic [fc2_IN_0_PRECISION_0-1:0]  fc2_data_in_0        [fc2_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:162:57: Can't find definition of variable: 'fc2_IN_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'fc1_IN_0_TENSOR_SIZE_DIM_0'
  162 | logic [fc2_IN_0_PRECISION_0-1:0]  fc2_data_in_0        [fc2_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:171:8: Can't find definition of variable: 'fc2_OUT_0_PRECISION_0'
                                     : ... Suggested alternative: 'fc1_OUT_0_PRECISION_0'
  171 | logic [fc2_OUT_0_PRECISION_0-1:0]  fc2_data_out_0        [fc2_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:171:59: Can't find definition of variable: 'fc2_OUT_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'fc1_OUT_0_TENSOR_SIZE_DIM_0'
  171 | logic [fc2_OUT_0_PRECISION_0-1:0]  fc2_data_out_0        [fc2_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:177:8: Can't find definition of variable: 'relu_1_IN_0_PRECISION_0'
                                     : ... Suggested alternative: 'relu_IN_0_PRECISION_0'
  177 | logic [relu_1_IN_0_PRECISION_0-1:0]  relu_1_data_in_0        [relu_1_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:177:63: Can't find definition of variable: 'relu_1_IN_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'relu_IN_0_TENSOR_SIZE_DIM_0'
  177 | logic [relu_1_IN_0_PRECISION_0-1:0]  relu_1_data_in_0        [relu_1_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:180:8: Can't find definition of variable: 'relu_1_OUT_0_PRECISION_0'
                                     : ... Suggested alternative: 'relu_OUT_0_PRECISION_0'
  180 | logic [relu_1_OUT_0_PRECISION_0-1:0]  relu_1_data_out_0        [relu_1_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:180:65: Can't find definition of variable: 'relu_1_OUT_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'relu_OUT_0_TENSOR_SIZE_DIM_0'
  180 | logic [relu_1_OUT_0_PRECISION_0-1:0]  relu_1_data_out_0        [relu_1_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:186:8: Can't find definition of variable: 'fc3_IN_0_PRECISION_0'
                                     : ... Suggested alternative: 'fc1_IN_0_PRECISION_0'
  186 | logic [fc3_IN_0_PRECISION_0-1:0]  fc3_data_in_0        [fc3_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:186:57: Can't find definition of variable: 'fc3_IN_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'fc1_IN_0_TENSOR_SIZE_DIM_0'
  186 | logic [fc3_IN_0_PRECISION_0-1:0]  fc3_data_in_0        [fc3_IN_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:195:8: Can't find definition of variable: 'fc3_OUT_0_PRECISION_0'
                                     : ... Suggested alternative: 'fc1_OUT_0_PRECISION_0'
  195 | logic [fc3_OUT_0_PRECISION_0-1:0]  fc3_data_out_0        [fc3_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |        ^~~~~~~~~~~~~~~~~~~~~
%Error: top/hardware/rtl/top.sv:195:59: Can't find definition of variable: 'fc3_OUT_0_TENSOR_SIZE_DIM_0'
                                      : ... Suggested alternative: 'fc1_OUT_0_TENSOR_SIZE_DIM_0'
  195 | logic [fc3_OUT_0_PRECISION_0-1:0]  fc3_data_out_0        [fc3_OUT_0_TENSOR_SIZE_DIM_0-1:0];
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:255:2: Parameter not found: 'WEIGHT_PRECISION_0'
  255 | .WEIGHT_PRECISION_0(fc1_WEIGHT_PRECISION_0),
      |  ^~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:256:2: Parameter not found: 'WEIGHT_TENSOR_SIZE_DIM_0'
  256 | .WEIGHT_TENSOR_SIZE_DIM_0(fc1_WEIGHT_TENSOR_SIZE_DIM_0),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:257:2: Parameter not found: 'WEIGHT_PARALLELISM_DIM_0'
  257 | .WEIGHT_PARALLELISM_DIM_0(fc1_WEIGHT_PARALLELISM_DIM_0),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:258:2: Parameter not found: 'WEIGHT_TENSOR_SIZE_DIM_1'
  258 | .WEIGHT_TENSOR_SIZE_DIM_1(fc1_WEIGHT_TENSOR_SIZE_DIM_1),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:259:2: Parameter not found: 'WEIGHT_PARALLELISM_DIM_1'
  259 | .WEIGHT_PARALLELISM_DIM_1(fc1_WEIGHT_PARALLELISM_DIM_1),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:260:2: Parameter not found: 'WEIGHT_TENSOR_SIZE_DIM_2'
  260 | .WEIGHT_TENSOR_SIZE_DIM_2(fc1_WEIGHT_TENSOR_SIZE_DIM_2),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:261:2: Parameter not found: 'WEIGHT_PARALLELISM_DIM_2'
  261 | .WEIGHT_PARALLELISM_DIM_2(fc1_WEIGHT_PARALLELISM_DIM_2)
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:271:2: Parameter not found: 'BIAS_PRECISION_0'
  271 | .BIAS_PRECISION_0(fc1_BIAS_PRECISION_0),
      |  ^~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:272:2: Parameter not found: 'BIAS_TENSOR_SIZE_DIM_0'
  272 | .BIAS_TENSOR_SIZE_DIM_0(fc1_BIAS_TENSOR_SIZE_DIM_0),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:273:2: Parameter not found: 'BIAS_PARALLELISM_DIM_0'
  273 | .BIAS_PARALLELISM_DIM_0(fc1_BIAS_PARALLELISM_DIM_0),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:274:2: Parameter not found: 'BIAS_TENSOR_SIZE_DIM_1'
  274 | .BIAS_TENSOR_SIZE_DIM_1(fc1_BIAS_TENSOR_SIZE_DIM_1),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:275:2: Parameter not found: 'BIAS_PARALLELISM_DIM_1'
  275 | .BIAS_PARALLELISM_DIM_1(fc1_BIAS_PARALLELISM_DIM_1),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:276:2: Parameter not found: 'BIAS_TENSOR_SIZE_DIM_2'
  276 | .BIAS_TENSOR_SIZE_DIM_2(fc1_BIAS_TENSOR_SIZE_DIM_2),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:277:2: Parameter not found: 'BIAS_PARALLELISM_DIM_2'
  277 | .BIAS_PARALLELISM_DIM_2(fc1_BIAS_PARALLELISM_DIM_2)
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:372:2: Parameter not found: 'WEIGHT_PRECISION_0'
  372 | .WEIGHT_PRECISION_0(fc2_WEIGHT_PRECISION_0),
      |  ^~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:373:2: Parameter not found: 'WEIGHT_TENSOR_SIZE_DIM_0'
  373 | .WEIGHT_TENSOR_SIZE_DIM_0(fc2_WEIGHT_TENSOR_SIZE_DIM_0),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:374:2: Parameter not found: 'WEIGHT_PARALLELISM_DIM_0'
  374 | .WEIGHT_PARALLELISM_DIM_0(fc2_WEIGHT_PARALLELISM_DIM_0),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:375:2: Parameter not found: 'WEIGHT_TENSOR_SIZE_DIM_1'
  375 | .WEIGHT_TENSOR_SIZE_DIM_1(fc2_WEIGHT_TENSOR_SIZE_DIM_1),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:388:2: Parameter not found: 'BIAS_PRECISION_0'
  388 | .BIAS_PRECISION_0(fc2_BIAS_PRECISION_0),
      |  ^~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:389:2: Parameter not found: 'BIAS_TENSOR_SIZE_DIM_0'
  389 | .BIAS_TENSOR_SIZE_DIM_0(fc2_BIAS_TENSOR_SIZE_DIM_0),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:390:2: Parameter not found: 'BIAS_PARALLELISM_DIM_0'
  390 | .BIAS_PARALLELISM_DIM_0(fc2_BIAS_PARALLELISM_DIM_0),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:391:2: Parameter not found: 'BIAS_TENSOR_SIZE_DIM_1'
  391 | .BIAS_TENSOR_SIZE_DIM_1(fc2_BIAS_TENSOR_SIZE_DIM_1),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error-PINNOTFOUND: top/hardware/rtl/top.sv:392:2: Parameter not found: 'BIAS_PARALLELISM_DIM_1'
  392 | .BIAS_PARALLELISM_DIM_1(fc2_BIAS_PARALLELISM_DIM_1),
      |  ^~~~~~~~~~~~~~~~~~~~~~
%Error: Exiting due to too many errors encountered; --error-limit=50

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.