Skip to content

feat(quantization): add activation export handler hook - #81

Closed
dengqiaoyu wants to merge 1 commit into
apple:mainfrom
dengqiaoyu:u/qiaoyu_deng/activation-handler-hook
Closed

feat(quantization): add activation export handler hook#81
dengqiaoyu wants to merge 1 commit into
apple:mainfrom
dengqiaoyu:u/qiaoyu_deng/activation-handler-hook

Conversation

@dengqiaoyu

@dengqiaoyu dengqiaoyu commented Aug 29, 2026

Copy link
Copy Markdown
Contributor
  • Allow an e8m0 scale_dtype on integer dtypes, gated in QuantizationSpec.validate_scale_dtype to PerBlockGranularity + SYMMETRIC + ZP, with E8M0_TARGET_MAX_POW2 as the single source of truth for which dtypes have an e8m0 target exponent.
  • Extract the export test workflow into export_utils.run_export_test, a common function now shared by the eager-MIL, eager-MLIR and graph-mode-MLIR test files; it reads the execution mode from the config, so one helper covers both modes.
  • Also reject an e8m0 scale on integer weights in finalize, and share the qparam extraction and activation validation between the eager and graph export paths.

- Let an out-of-tree package register a per-granularity activation export handler for graph or eager mode, so a granularity the built-in Core AI path cannot express (per-block, dynamic qparams) can be exported without patching this repo.
- Allow an e8m0 `scale_dtype` on integer dtypes, gated in `QuantizationSpec.validate_scale_dtype` to `PerBlockGranularity` + `SYMMETRIC` + `ZP`, with `E8M0_TARGET_MAX_POW2` as the single source of truth for which dtypes have an e8m0 target exponent.
- Extract the export test workflow into `export_utils.run_export_test`, a common function now shared by the eager-MIL, eager-MLIR and graph-mode-MLIR test files; it reads the execution mode from the config, so one helper covers both modes.
- Also reject an e8m0 scale on integer weights in `finalize`, and share the qparam extraction and activation validation between the eager and graph export paths.
@dengqiaoyu dengqiaoyu added the enhancement New feature or request label Aug 29, 2026
@dengqiaoyu

Copy link
Copy Markdown
Contributor Author

Will create a new one after addressing some comments offline with @vineet-g

@dengqiaoyu dengqiaoyu closed this Sep 1, 2026
@dengqiaoyu
dengqiaoyu deleted the u/qiaoyu_deng/activation-handler-hook branch September 1, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants