kali20gakki/msAgent / skills/quantizer/quantization-accuracy-tuning-orchestrator
quantization-accuracy-tuning-orchestrator
VerifiedEnd-to-end automated model quantization and accuracy tuning workflow. Use when user asks for automated model quantization and accuracy tuning, e.g. "自动量化", "量化调优", "一键量化", "精度调优", etc. 当用户给出多卡(≥2 卡)卡号时,量化阶段通过 EP 并行适配(msmodelslim-ep-parallel-adaptation)保证多卡 EP 并行,调优主流程仍在本 Skill。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 25.4 KB |
| references/background_information.md | markdown | 948 B |
| references/output_format.md | markdown | 5.0 KB |
| references/prepare_environment.md | markdown | 2.6 KB |
| references/prepare_model.md | markdown | 9.7 KB |
| references/quantization_tuning.md | markdown | 24.5 KB |
| references/routing.md | markdown | 2.6 KB |
| references/subagent_io_protocol.md | markdown | 10.3 KB |
| references/user_input.md | markdown | 5.9 KB |
| scripts/accuracy_append.py | script | 3.7 KB |
| scripts/accuracy_cleanup.py | script | 2.8 KB |
| scripts/accuracy_lookup.py | script | 3.3 KB |
| scripts/finalize_practice_repo.py | script | 3.7 KB |
| scripts/history_append.py | script | 3.1 KB |
| scripts/history_clear.py | script | 2.1 KB |
scripts/accuracy_append.py
View on GitHub# -------------------------------------------------------------------------
# This file is part of the MindStudio project.
# Copyright (c) 2026 Huawei Technologies Co.,Ltd.
#
# MindStudio is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# -------------------------------------------------------------------------
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Append accuracy cache entry (replaces MCP accuracy_append)."""
from __future__ import annotations
import argparse
import sys
from pathlib import Path
from typing import Any, Dict
# ---------------------------------------------------------------------------
# Bootstrap: add shared library to sys.path before any cross-skill imports
# ---------------------------------------------------------------------------
_common_dir = Path(__file__).resolve().parents[2] / "msmodelslim-tools-common" / "scripts"
if str(_common_dir) not in sys.path:
sys.path.insert(0, str(_common_dir))
from script_utils import emit_result, ensure_msmodelslim, parse_optional_json
def _load_practice(practice_path: str):
from msmodelslim.core.practice import PracticeConfig
from msmodelslim.utils.security import yaml_safe_load
content = yaml_safe_load(practice_path)
return PracticeConfig.model_validate(content)
def _load_evaluate_config(evaluate_config_path: str):
from msmodelslim.infra.service_oriented_evaluate_service import ServiceOrientedEvaluateServiceConfig
from msmodelslim.utils.security import yaml_safe_load
config_dict = yaml_safe_load(evaluate_config_path)
return ServiceOrientedEvaluateServiceConfig.model_validate(config_dict)
def accuracy_append(
save_path: str,
evaluate_config_path: str,
practice_path: str,
evaluate_result: Dict[str, Any],
) -> Dict[str, Any]:
from msmodelslim.core.tune_strategy import EvaluateResult
from msmodelslim.infra.yaml_practice_accuracy_manager import YamlTuningAccuracyManager
try:
history_path = str(Path(save_path) / "history")
accuracy = YamlTuningAccuracyManager().load_accuracy(history_path)
evaluate_config = _load_evaluate_config(evaluate_config_path)
practice_obj = _load_practice(practice_path)
evaluate_obj = EvaluateResult.model_validate(evaluate_result)
accuracy.append_accuracy(practice_obj, evaluate_config, evaluate_obj)
return {"ok": True, "message": "accuracy appended"}
except Exception as exc:
return {"ok": False, "error": str(exc)}
def main() -> int:
parser = argparse.ArgumentParser(description="Append accuracy cache entry.")
parser.add_argument("--save-path", required=True)
parser.add_argument("--evaluate-config-path", required=True)
parser.add_argument("--practice-path", required=True)
parser.add_argument("--evaluate-result", required=True, help="JSON object of EvaluateResult")
args = parser.parse_args()
ensure_msmodelslim()
evaluate_result = parse_optional_json(args.evaluate_result, default={})
if not isinstance(evaluate_result, dict):
return emit_result({"ok": False, "error": "evaluate-result must be a JSON object"})
return emit_result(
accuracy_append(
args.save_path,
args.evaluate_config_path,
args.practice_path,
evaluate_result,
)
)
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |