Skip to content

How to correctly config BF16-Datatype in Gemmini #357

@haoywu-intel

Description

@haoywu-intel

Hello, I have built this system with chipyard 1.9.1 and gemmini v0.7.1, the example simulations (both spike and verilator) in README work well on my machine.

Now, I'm trying to modify the datatypes. I've tried the default int_8 (GemminiConfigs.defaultConfig) and FP32 (GemminiFPConfigs.FP32DefaultConfig) configs. With tiny modifications on tiled_matmul_ws.c, I can get correct matrix multiplication results for both.

However, when I set the datatype to BF16 (GemminiFPConfigs.BF16Default8Config), the gemmini seems using the uint16 type to calculate the matrix instead of BF16 type. and I noticed the following typedef in gemmini_params.h:
typedef uint16_t elem_t;

Anyone has any comments? What else I need to do to support BF16 type matrix multiplication?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions