Skip to content

feat: int8-static export builds and gates the browser-size composition - #224

Merged
ronaldtse merged 1 commit into
mainfrom
feat/int8-static-export
Sep 29, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
feat/int8-static-export

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

What

Closes the export half of TODO.impl/11's positive branch: the browser-size static-int8 composition, built and gated on the release machinery.

  • imf.export.build_int8_static_zip: dynamic-int8 encoder + static-int8 decoder in one zip. Calibration walks the model's own fp32 decode over eval inputs across framings (prefill, single-token steps, 8-token windows) — the shapes whose activation scales must hold (the framing axis, Paper C §5.1). Metadata precision is rewritten to int8: PRECISIONS is a closed set, so the static recipe is carried by the zip name and the gate (int8's 2pp cer_delta limit) by the value.
  • modal_export::export_int8_static becomes thin orchestration over the helper plus the rebuild_int8_head32 gate stack: reference decode (resume-safe), CER parity written into the zip, margin analysis, confident-flip ≤1% budget. Lands {mid}-int8static.zip on the models volume; publication stays a separate version decision.

Specs

Fixture end-to-end over the tiny T5 (no mocks): build → parity gate (500+ samples) → write_parity → strict validation; both quant recipes present in the graphs (MatMulInteger encoder, QLinearMatMul decoder); head MatMul kept fp32 per the E1 rule.

Context

Measured: composition B 4.6045 full-set vs dynamic 4.5701 (paired CI not separated), +8% CPU decode, 491 MiB. This branch only adds the gated build path; the static entrypoint runs it for ara-diac-small-21.

build_int8_static_zip in imf.export: dynamic-int8 encoder + static-int8
decoder in one zip, calibrated on the model's own fp32 decode across
framings (prefill, single steps, 8-token windows); metadata precision
rewritten to int8 (PRECISIONS is closed — the recipe is the zip name,
the gate the value). Fixture specs cover the release sequence end to
end: build, parity gate, write_parity, strict validation, both quant
recipes present, head MatMul kept fp32.

modal_export::export_int8_static becomes thin orchestration over the
helper plus the rebuild_int8_head32 gate stack (reference decode,
parity, margin analysis, confident-flip budget), landing
{mid}-int8static.zip on the volume.
@ronaldtse
ronaldtse merged commit a55e00b into main Sep 29, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant