Skip to content

Question: Does this project support bf16 or fp16 data types? #223

Closed

Description

@hanm2019

Hi, thanks for open-sourcing this project. It is very helpful for exploring DNN workloads on the NPU stack.

I am currently trying to evaluate reduced-precision workloads, especially torch.bfloat16 and torch.float16, for matmul-heavy models.

I would like to ask whether this project currently supports bf16 or fp16 data types end-to-end.

More specifically:

  1. Does the current PyTorchSim / TOGSim stack support torch.bfloat16 or torch.float16 tensors?
  2. If reduced precision is supported, is the intended behavior:
    • bf16/fp16 storage with bf16/fp16 compute, or
    • bf16/fp16 storage with fp32 accumulation?
  3. Are there any specific configs, compiler flags, or codegen options required to enable bf16/fp16 matmul?
  4. If bf16/fp16 is not currently supported, could you suggest where the support should be added first?

For context, the fp32 matmul path works on my side using the existing tests/test_matmul.py. When I changed the inputs to bf16 in a small matmul test, I encountered lowering/backend issues during compilation, so I wanted to confirm the intended support status before digging further.

Thanks again for the project. Any guidance would be appreciated.

Activity

  1. YWHyuk commented on Apr 15, 2026

    @YWHyuk
    Collaborator

    Hi @hanm2019! Thanks for reaching out and for your interest in the project.

    We are actually in the middle of updating the repository to support these data types! The PR is currently undergoing final review (#221), and we expect to release it to the master branch within this week.

    In the upcoming version, you can simply set your PyTorch tensors to torch.float16, which will be stored as FP16 in DRAM and vector registers while the Systolic Array performs FP32 accumulation for numerical stability.

  2. hanm2019 commented on Apr 15, 2026

    @hanm2019
    Author

    Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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