From 136315f29787f982e7ae96fed8f50d528c8101fb Mon Sep 17 00:00:00 2001 From: alonamid Date: Wed, 27 May 2020 23:58:06 -0700 Subject: [PATCH 1/5] bump esp-isa-sim to gemmini v0.3 --- toolchains/esp-tools/riscv-isa-sim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/esp-tools/riscv-isa-sim b/toolchains/esp-tools/riscv-isa-sim index 3c930b40..13384cac 160000 --- a/toolchains/esp-tools/riscv-isa-sim +++ b/toolchains/esp-tools/riscv-isa-sim @@ -1 +1 @@ -Subproject commit 3c930b403140ac0cd1fc5578a21998f6875459c6 +Subproject commit 13384cac1e54828200067ff890f564a505a4ebb3 From 9fad8aa8ba090c22c85dbf6cefcd1ceb190984b8 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 28 May 2020 00:09:11 -0700 Subject: [PATCH 2/5] bump gemmini v0.3 --- docs/Generators/Gemmini.rst | 10 +++++++++- generators/gemmini | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/Generators/Gemmini.rst b/docs/Generators/Gemmini.rst index b2257b1f..c8618d4e 100644 --- a/docs/Generators/Gemmini.rst +++ b/docs/Generators/Gemmini.rst @@ -36,12 +36,18 @@ Major parameters of interest include: * Scratchpad and accumulator memory parameters (``sp_banks``, ``sp_capacity``, ``acc_capacity``): Determine the properties of the Gemmini scratchpad memory: overall capacity of the scratchpad or accumulators (in KiB), and the number of banks the scratchpad is divided into. -* Type parameters (``inputType``, ``outputType``, ``accType``): Determine the data-types flowing through different parts of a Gemmini accelerator. For example, ``inputType`` may be an 8-bit fixed-point number, while ``accType``, which determines the type of partial accumulations in a matrix multiplication, may be a 32-bit integer. ``outputType`` only determines the type of the data passed between two processing elements (PEs); for example, an 8-bit multiplication may produce a 16-bit result which must be shared between PEs in a systolic array. +* Type parameters (``inputType``, ``outputType``, ``accType``): Determine the data-types flowing through different parts of a Gemmini accelerator. For example, ``inputType`` may be an 8-bit fixed-point number, while ``accType``, which determines the type of partial accumulations in a matrix multiplication, may be a 32-bit integer. ``outputType`` only determines the type of the data passed between two processing elements (PEs); for example, an 8-bit multiplication may produce a 16-bit result which must be shared between PEs in a systolic array. If your datatype is a floating-point number, then you might also want to change the ``pe_latency`` parameter, which specifies how many shift registers to add inside the PEs. This might be necessary if your datatype cannot complete a multiply-accumulate operation within a single cycle. * Access-execute queue parameters (``ld_queue_length``, ``st_queue_length``, ``ex_queue_length``, ``rob_entries``): To implement access-execute decoupling, a Gemmini accelerator has a load instruction queue, a store instruction queue, and an execute instruction queue. The relative sizes of these queue determine the level of access-execute decoupling. Gemmini also implements a reorder buffer (ROB) - the number of entries in the ROB determines possible dependency management limitations. * DMA parameters (``dma_maxbytes``, ``dma_buswidth``, ``mem_pipeline``): Gemmini implements a DMA to move data from main memory to the Gemmini scratchpad, and from the Gemmini accumulators to main memory. The size of these DMA transactions is determined by the DMA parameters. These DMA parameters are tightly coupled with Rocket Chip SoC system parameters: in particular ``dma_buswidth`` is associated with the ``SystemBusKey`` ``beatBytes`` parameter, and ``dma_maxbytes`` is associated with ``cacheblockbytes`` Rocket Chip parameters. +There are also optional features, which can be either enabled or left out of Gemmini at elaboration-time. For example: + +Scaling during "move-in" operations (``mvin_scale_args``, ``mvin_scale_acc_args``): When data is being moved in from DRAM or main memory into Gemmini's local scratchpad memory, it can optionally be multiplied by a scaling factor. These parameters specify what the datatype of the scaling factor is, and how the scaling is actually done. If these are set to ``None``, then this optional feature will be disabled at elaboration time. If both the scratchpad inputs are accumulator inputs are to be scaled in the same say, then the ``mvin_scale_shared`` parameter can be set to ``true`` so that the multipliers and functional units are shared. + + + Gemmini Software ------------------ @@ -55,6 +61,8 @@ The ``software`` directory of the generator includes the aforementioned library The Gemmini generator generates a C header file based on the generator parameters. This header files gets compiled together with the matrix multiplication library to tune library performance. The generated header file can be found under ``software/gemmini-rocc-tests/include/gemmini_params.h`` +Gemmini can also be used to run ONNX-specified neural-networks through a port of Microsoft's ONNX-Runtime framework. The port is included as the `onnxruntime-riscv`__ repository submoduled in the `software` directory. The port is under development, and usage documentation can be found `within its repository `__. + Build and Run Gemmini Tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/generators/gemmini b/generators/gemmini index d6f36d37..9797e804 160000 --- a/generators/gemmini +++ b/generators/gemmini @@ -1 +1 @@ -Subproject commit d6f36d37d1e10b7fd514e6680b1eaea032cee628 +Subproject commit 9797e804044f93bb5b1f572952d1a83354701dbd From cd80c64a7270bbdf2263f41843ea88a7df1e3bc6 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 28 May 2020 00:59:19 -0700 Subject: [PATCH 3/5] abe nit --- docs/Generators/Gemmini.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Generators/Gemmini.rst b/docs/Generators/Gemmini.rst index c8618d4e..c48daeda 100644 --- a/docs/Generators/Gemmini.rst +++ b/docs/Generators/Gemmini.rst @@ -57,9 +57,9 @@ The ISA includes configuration instructions, data movement instructions (from ma Since Gemmini instructions are not exposed through the GNU binutils assembler, several C macros are provided in order to construct the instruction encodings to call these instructions. The Gemmini generator includes a C matrix multiplication library which wraps the calls to the custom Gemmini instructions. -The ``software`` directory of the generator includes the aforementioned library and macros, as well as bare-metal tests, and some FireMarshal workloads to run the tests in a Linux environment. In particular, the matrix multiplication C library can be found in the ``software/gemmini-rocc-tests/include/gemmini.h`` file. +The ``software`` directory of the generator (within the generator repository in ``generators/gemmini/software``) includes the aforementioned library and macros, as well as bare-metal tests, and some FireMarshal workloads to run the tests in a Linux environment. In particular, the matrix multiplication C library can be found in the ``generators/gemmini/software/gemmini-rocc-tests/include/gemmini.h`` file. -The Gemmini generator generates a C header file based on the generator parameters. This header files gets compiled together with the matrix multiplication library to tune library performance. The generated header file can be found under ``software/gemmini-rocc-tests/include/gemmini_params.h`` +The Gemmini generator generates a C header file based on the generator parameters. This header files gets compiled together with the matrix multiplication library to tune library performance. The generated header file can be found under ``generators/gemmini/software/gemmini-rocc-tests/include/gemmini_params.h`` Gemmini can also be used to run ONNX-specified neural-networks through a port of Microsoft's ONNX-Runtime framework. The port is included as the `onnxruntime-riscv`__ repository submoduled in the `software` directory. The port is under development, and usage documentation can be found `within its repository `__. From 930f03cf68ad66fedd7366f10c0bed3f0d84ba22 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 28 May 2020 12:54:19 -0700 Subject: [PATCH 4/5] Do not initialize gemmini's onnx-runtime --- generators/gemmini | 2 +- scripts/init-submodules-no-riscv-tools-nolog.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/generators/gemmini b/generators/gemmini index 9797e804..caaf781e 160000 --- a/generators/gemmini +++ b/generators/gemmini @@ -1 +1 @@ -Subproject commit 9797e804044f93bb5b1f572952d1a83354701dbd +Subproject commit caaf781ec9d69e45443e496046bc6ab439e3e54f diff --git a/scripts/init-submodules-no-riscv-tools-nolog.sh b/scripts/init-submodules-no-riscv-tools-nolog.sh index 70b504b4..c645b388 100755 --- a/scripts/init-submodules-no-riscv-tools-nolog.sh +++ b/scripts/init-submodules-no-riscv-tools-nolog.sh @@ -29,6 +29,7 @@ git config submodule.toolchains/qemu.update none # Don't automatically initialize generators with big submodules (e.g. linux source) git config submodule.generators/sha3.update none +git config submodule.generators/gemmini.update none # Disable updates to the FireSim submodule until explicitly requested git config submodule.sims/firesim.update none @@ -51,11 +52,16 @@ git config --unset submodule.vlsi/hammer-synopsys-plugins.update git config --unset submodule.vlsi/hammer-mentor-plugins.update git config --unset submodule.generators/sha3.update +git config --unset submodule.generators/gemmini.update git config --unset submodule.software/firemarshal.update # Non-recursive clone to exclude riscv-linux git submodule update --init generators/sha3 +# Non-recursive clone to exclude gemmini-software +git submodule update --init generators/gemmini +git submodule update --init --recursive generators/gemmini/software/gemmini-rocc-tests + git config --unset submodule.sims/firesim.update # Minimal non-recursive clone to initialize sbt dependencies git submodule update --init sims/firesim From 96e253feb51416f1365314233c6f17d8399e16d4 Mon Sep 17 00:00:00 2001 From: abejgonzalez Date: Thu, 28 May 2020 14:20:04 -0700 Subject: [PATCH 5/5] documentation fix --- docs/Generators/Gemmini.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Generators/Gemmini.rst b/docs/Generators/Gemmini.rst index c48daeda..34fc728b 100644 --- a/docs/Generators/Gemmini.rst +++ b/docs/Generators/Gemmini.rst @@ -61,7 +61,7 @@ The ``software`` directory of the generator (within the generator repository in The Gemmini generator generates a C header file based on the generator parameters. This header files gets compiled together with the matrix multiplication library to tune library performance. The generated header file can be found under ``generators/gemmini/software/gemmini-rocc-tests/include/gemmini_params.h`` -Gemmini can also be used to run ONNX-specified neural-networks through a port of Microsoft's ONNX-Runtime framework. The port is included as the `onnxruntime-riscv`__ repository submoduled in the `software` directory. The port is under development, and usage documentation can be found `within its repository `__. +Gemmini can also be used to run ONNX-specified neural-networks through a port of Microsoft's ONNX-Runtime framework. The port is included as the `onnxruntime-riscv `__ repository submoduled in the `software` directory. The port is under development, and usage documentation can be found `within its repository `__. Build and Run Gemmini Tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^