ascendc-mssanitizer

Analyze Ascend C operators for memory errors and generate reports.

31|1|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/Ascend/agent-skills --skill ascendc-mssanitizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ascendc-mssanitizer
Source: https://github.com/Ascend/agent-skills/tree/main/skills/ascendc-operator-mssanitizer
Command: npx skills add https://github.com/Ascend/agent-skills --skill ascendc-mssanitizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, torch_npu, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides automated memory-safety analysis for Ascend C operators, generating detailed reports that help identify illegal memory accesses, illegal frees, memory leaks, and UB issues.

Core Features & Use Cases

  • Memory safety checks using mssanitizer across host, AscendCL, and device layers.
  • Dual-mode operation: Python mode for custom operators and GE IR/C++ mode for OPS repos; auto-detection of mode.
  • Generates structured reports and parseable logs to guide fixes.
  • Trigger keywords: mssanitizer, memory safety, memory error, illegal access, memory leak.

Quick Start

Run the mssanitizer workflow on your Ascend C operator project to produce memory-analysis reports.

Frequently Asked Questions about ascendc-mssanitizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check Ascend C operators for memory leaks and illegal memory access?

You can run memory safety analysis on Ascend C operators to identify illegal memory accesses, illegal frees, memory leaks, and UB issues. The tool checks host, AscendCL, and device layers to generate detailed reports.

How does memory safety analysis work for custom operators in Python mode?

Memory safety analysis auto-detects Python mode for custom operators and GE IR/C++ mode for OPS repos. It applies mssanitizer checks across host, AscendCL, and device layers, producing structured reports and parseable logs.

Do I need the Ascend toolchain to run mssanitizer memory safety checks?

Yes, you need the ASCEND toolchain with mssanitizer installed. The analysis requires torch and torch_npu dependencies to execute built-in scripts that run five memory safety checks and parse logs for custom operators.

What is the best way to generate memory analysis reports for Ascend C operators?

Running the mssanitizer workflow on your Ascend C operator project is the best way to generate memory analysis reports. It supports Python-based test script generation and built-in scripts to run five checks across device and runtime scenarios.

Can I use mssanitizer for both GE IR-based OPS repos and Python-mode custom operators?

Yes, mssanitizer memory safety analysis applies to both GE IR-based OPS repos and Python-mode custom operators. It features auto-detection of the operating mode to analyze device, runtime, and memory-safety scenarios.

Why does my Ascend C operator have undefined behavior issues during testing?

Undefined behavior issues in Ascend C operators often stem from illegal memory accesses or memory leaks. Running a memory safety analysis identifies these UB issues across host and device layers, generating parseable logs to guide fixes.