Skip to content

Minor refactors of requantisation code #80

@Antonio95

Description

@Antonio95

All requantisation methods have the same structure: requantisation core, then shift, then clamp. The last two steps are the same across all requantisation nodes. Furthermore, in each of the actual implementors, the core is actually deferred to a dedicated function in common/src/quantization/mod.rs. There is obvious room for refactoring.

Independently from that, the core of RequantiseBMMFloat is a mess (of my own creation, from the very early days of the project) in the sense that the node stores the three f32 scales internally and multiplies them as f64s for every requantised value inside the requantisation-core function. Instead, one should directly store the f64 product into the node and pass that (and remove the original scales, as they aren't used).

This can be done in conjunction with #75

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