review-pr
GitHub用于 AutoRound 项目的 Pull Request 审查工作流,涵盖代码质量、量化数值稳定性、注册点审计、测试验证及文档翻译检查,确保贡献符合规范。
Trigger Scenarios
Install
npx skills add intel/auto-round --skill review-pr -g -y
SKILL.md
Frontmatter
{
"name": "review-pr",
"description": "Review or prepare a pull request for the AutoRound repository — checks registration points for new data types\/backends\/VLMs, validates Chinese translation parity for modified markdown files, verifies quantization numerical stability (scale overflow, STE gradient flow, group_size padding), confirms test placement and fixture usage, and enforces Apache 2.0 headers and DCO sign-off. Use when performing a code review, running a PR checklist, preparing a merge request, or auditing a contribution before submit."
}
Pull Request Review Workflow for AutoRound
Review Sequence
Follow these steps in order. Stop and request changes at any gate that fails.
- Scope check — read the PR description and diff summary. Confirm the PR does one thing and unrelated changes are absent. If scope is unclear, request changes before proceeding.
- Code quality gate — run through the Code Quality checklist below. Any failure → request changes.
- Quantization review — if the PR touches
auto_round/quantization logic, run the Quantization-Specific checklist. Any numerical stability concern → request changes. - Registration audit — if the PR adds a new feature type (data type, export format, VLM, backend, dataset, scheme), verify every registration point in the table below is updated. Missing registration → request changes.
- Test verification — confirm new functionality has tests in the correct backend directory with minimal iterations. Missing or misplaced tests → request changes.
- Documentation & translation — check README/docs updates and run the Chinese Translation Verification procedure below. Missing
_CN.mdupdates for modified markdown → request changes. - Contributing requirements — verify DCO sign-off, clean commits, and clear PR description.
- Decision — if all gates pass, approve. Otherwise, summarize all findings in a single review comment with specific file:line references.
Review Checklist
1. Code Quality
- Code follows existing patterns in the codebase (decorator registration, factory patterns, etc.)
- No hardcoded paths or credentials
- Proper error handling at system boundaries
- No unnecessary abstractions or over-engineering
- Import organization follows existing conventions
- Apache 2.0 license header present on new files:
# Copyright (c) 2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # ...
2. Quantization-Specific Concerns
- Numerical stability: scale computation avoids division by zero
- Gradient flow: uses
round_ste()or equivalent STE for differentiable rounding - Tensor shapes: group_size reshaping handles padding correctly
- dtype consistency: scale_dtype, compute_dtype used properly
- Memory efficiency: no unnecessary tensor copies on GPU
- Device handling: tensors moved to correct device before operations
3. Registration Points
When the PR adds new functionality, verify all registration points are updated:
| Feature | Registration Location |
|---|---|
| Data type | auto_round/data_type/__init__.py import + @register_dtype |
| Export format | auto_round/formats.py @OutputFormat.register() |
| VLM model | special_model_handler.py SPECIAL_MULTIMODAL_BLOCK + lists |
| Backend | auto_round/inference/backend.py BackendInfos dict |
| Dataset | auto_round/calib_dataset.py @register_dataset |
| Scheme preset | auto_round/schemes.py PRESET_SCHEMES dict |
4. Test Coverage
- New functionality has corresponding tests
- Tests use existing fixtures (
tiny_opt_model_path,dataloader, etc.) - Tests are placed in the correct backend directory (
test_cpu/,test_cuda/, etc.) - Tests use minimal iterations (
iters=2, nsamples=2) for speed - No flaky assertions (avoid exact float comparisons)
5. Documentation
- README.md updated if user-facing features change
- Chinese translation updated: Any changes to
*.mdfiles must have corresponding updates in their*_CN.mdcounterparts:README.md→README_CN.mddocs/step_by_step.md→docs/step_by_step_CN.mddocs/environments.md→docs/environments_CN.md
- Translation maintains equivalent content and structure (not just copied English text)
- Docstrings added for new public APIs
6. Contributing Requirements
- Commits are signed off (
git commit -s) per DCO - No unrelated changes mixed in
- PR description clearly explains the motivation and changes
- Breaking changes are called out explicitly
Chinese Translation Verification
This is a hard requirement for the AutoRound project. Use this procedure:
-
Identify modified markdown files:
git diff --name-only HEAD~1 -- '*.md' -
Check for corresponding CN files: For each modified
.mdfile, verify a_CN.mdcounterpart exists and is also modified:README.md→README_CN.mddocs/step_by_step.md→docs/step_by_step_CN.mddocs/environments.md→docs/environments_CN.md
-
Compare structure:
- Same number of sections/headings
- Same tables, code blocks, and links
- Equivalent content (not machine-translated gibberish)
-
Files that do NOT need CN translation (no
_CNcounterpart exists):CONTRIBUTING.md,CODE_OF_CONDUCT.md,SECURITY.mdtest/README.mddocs/publication_list.md,docs/tips_and_tricks.md, accuracy result docs
Common Issues to Watch For
Quantization Bugs
- Scale overflow: Large models with small group_size can produce FP16 overflow
in scales. Check for
torch.clamportorch.finfoguards. - Asymmetric zero-point drift: Zero-points must be integer-rounded for INT quantization.
- GGUF super-block alignment: GGUF formats require specific block sizes (typically 256 elements). Verify padding/alignment logic.
Export Compatibility
- Format detection: Verify
quantize_config.jsonor equivalent metadata is saved correctly for the target framework to detect. - Weight name mapping: Ensure packed weight names match what the inference framework expects.
- Mixed-precision layers: Layers excluded from quantization (e.g.,
lm_head) must be saved in their original format.
Backend Selection
- Priority conflicts: New backends should not override existing backends unless
intentional. Check
priorityvalues. - Feature checker coverage: Ensure checkers don't silently reject valid layers (test with real model shapes).
Version History
- 3cae4b6 Current 2026-07-25 10:12


