Skip to content

[VMI] Support L=8 ui8 to ui16 widen on the fused scale path #1024

Description

@mouliangyu

Summary

The fused quant + dequant path (per_token_cast_and_cast_back) needs a compact
ui8 -> ui16 widen for an L=8 scale-factor value. When the value is represented as
the VMI group-slot layout used by the reproducer, VMI legalization leaves a residual
pto.vmi.extui instead of lowering it to VPTO.

Reproducer

Reproducer PR: #1015

The PR contains:

  • an L=256 widen that currently lowers;
  • the failing L=8 VMI fixture;
  • a working MI/CCE reference;
  • compile logs showing the residual illegal extui.

Pinned repro version: vmi-v0.1.3.

Expected behavior

For the actual layout produced by the fused quant/dequant kernel, VMI ui8 -> ui16
widen should lower to legal VPTO conversion/store operations without a residual VMI
cast. The expected physical layout must match the source value: a group-slot value and
a compact contiguous 8-lane value are different cases and should not be conflated.

Acceptance criteria

  • confirm the exact layout of the value at the per_token_cast_and_cast_back_vmi.py
    call site;
  • add a minimal PTOAS test for that layout and L=8;
  • lower it without residual pto.vmi.extui;
  • verify the generated conversion uses a legal mask/part selection and preserves the
    scale values;
  • compile the affected fused kernel path without a compose/separate-cast fallback.

Related kernel reference (if accessible):

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvmi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions