Skip to content

matint/matfp vs mac16/fma*/fms*, and how to do multiply-only (without accumulating/subtracting) using matint #8

@dgazzoni

Description

@dgazzoni

This is a question rather than an issue.

First of all, thanks for the huge effort spent on reverse engineering AMX and documenting it. It is really appreciated. I've been able to try out AMX for an application of mine and that would have been impossible without your extensive documentation.

I just wanted to confirm a few things, and I was hoping with the experience acquired with your reverse engineering effort, you could confirm a few things. Perhaps even add some pointers to enhance your already excellent documentation.

  1. Am I understanding correctly that there is some redundancy between matint/matfp and mac16/fm[as][16,32,64] when you only need to do outer products? Essentially, by choosing ALU mode 0 or 1 in matint/matfp, it appears to me you can emulate almost all functionality of mac16/fm[as][16,32,64]. Is that right or do you see any particular advantage to mac16/fm[as][16,32,64] vs matint/matfp? I'm just trying to understand the thought process of the AMX designers, and why would they have separate instructions when they could just merge them together.
  2. With that said, one functionality I was unable to find in matint/matfp was the ability to do a multiply-only operation x*y rather than accumulating/subtracting with z. With mac16/fm[as][16,32,64] this can be done by setting bit 27 to 1. This is important e.g. for the first loop iteration in a matrix multiply, when z may already have non-zero values. Is there a combination of bits I can use to do an outer product without accumulating/subtracting from z?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions