Skip to content

kali20gakki/msAgent / skills/profiler/ascend-profiler-data-validation

ascend-profiler-data-validation

Verified

当用户提供 MindStudio profiler 采集的性能数据(框架 profiler、msprof 命令行)时,对数据完整性、采集状态及关键配置进行校验,确保后续分析工具能正常运行。

FileKindSize
SKILL.mdskill md5.0 KB
scripts/offline_parse_mindspore.pyscript2.2 KB
scripts/offline_parse_pytorch.pyscript2.2 KB

scripts/offline_parse_mindspore.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.
# -------------------------------------------------------------------------

"""Offline parser for MindSpore Profiler data (_ascend_ms)."""
import argparse
import os
import shutil
import sys


def _check_msprof() -> None:
    """Ensure msprof is in PATH; required by CANN/profiler analyse."""
    if shutil.which("msprof") is None:
        print(
            "Error: msprof command not found. Please source the correct CANN environment, e.g.:\n"
            "  source /usr/local/Ascend/ascend-toolkit/set_env.sh"
        )
        sys.exit(1)


def main() -> None:
    parser = argparse.ArgumentParser(
        description="Offline parser for MindSpore Profiler data (_ascend_ms)."
    )
    parser.add_argument(
        "profiler_path",
        type=str,
        help="Path to the profiler result directory (e.g., ./result_data)",
    )
    args = parser.parse_args()

    profiler_path = args.profiler_path
    if not os.path.exists(profiler_path):
        print(f"Error: Profiler path '{profiler_path}' does not exist.")
        sys.exit(1)

    _check_msprof()

    try:
        from mindspore.profiler.profiler import analyse
    except ImportError as e:
        print(f"Error: MindSpore not installed or analyse unavailable: {e}")
        sys.exit(1)

    print(f"Starting offline analysis for: {profiler_path}")
    try:
        analyse(profiler_path=profiler_path)
        print("Analysis completed successfully.")
    except Exception as e:
        print(f"Error during analysis: {e}")
        sys.exit(1)


if __name__ == "__main__":
    main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall