mx check: add a per-element bound like check_quant's

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Find the implementation of check_mx and the existing check_quant per-element bound, including how viol_frac handles affine quantization. Start by tracing how check_mx obtains each group’s E8M0 scale and applies its current error-ratio and rank-1 checks. Add a count for elements beyond half a step, using one step at the clipped edge, and check the affected cases against the reported clean and edited matrices.

Written by the indexing model from the issue text.

Description

From the review of https://github.com/STRML/quantdiff/pull/1 (P2). check_mx judges an mxfp8/mxfp4 tensor on its error ratio and one-direction share only. Against a bf16 upstream, a sparse edit can stay under 1.5x the error norm, and its rank-1 share fades on large matrices: on a 64x256 matrix, 1 and 8 edited elements tripped only the rank-1 test (30% and 13% against 3% clean). The mx step is known from each group's E8M0 scale, so an element past half a step (one step at the clipped edge) can be counted the way `viol_frac" does for affine quants. FP8-to-mxfp8 and FP4-to-mxfp4 are unaffected: any difference already flags.

Dominant language
Python
Stars
0
Forks
1
Avg merge
5m
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from STRML/quantdiff

All issues in STRML/quantdiff

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.