Error Analyzer - Ascend NPU
A unified error analysis skill for Ascend NPU hardware scenarios. Analyzes user-provided error information to identify root causes and generate customer-friendly responses.
Skill Independence
This skill is completely self-contained and can be used independently:
- ✅ Zero dependencies: Only requires Python 3.7+, no external libraries
- ✅ Run anywhere: Works in any directory, no project structure required
- ✅ Plug and play: Unzip and use immediately, no configuration needed
- ✅ Cross-platform: Supports Linux, macOS, Windows
- ✅ Multi-repository: Can be configured to work with different codebases
When to Use This Skill
Use this skill whenever:
- User provides error logs, stack traces, or crash reports
- User describes a problem with environment or context involving Ascend NPU
- User asks "why did this fail?" or "what's wrong?" in NPU/Ascend context
- User requests debugging help or root cause analysis
- Any error-related information is present in the conversation
- Errors involve: MindSpeed, MultimodalSDK, Vision SDK, CANN, Ascend NPU
Quick Start
Input Format
Expect user to provide error information in this format:
## Error Information
[Error message / log / stack trace]
## Environment
[OS, version, library versions, NPU info, etc.]
## Context
[What were you trying to do?]
## Repository Path (optional)
[Path to repository for source code reference - if available]
Workflow
- Parse - Extract error details using the
parse_error.pyscript or manually - Match - Compare against known error patterns in references
- Analyze - Determine root cause using debugging checklist
- Research - Optionally search repository for source code context
- Respond - Generate customer-friendly response using templates
Using the Parser Script
Run the parsing script to extract structured information:
# From text
python scripts/parse_error.py "Error: Module not found"
# From file
python scripts/parse_error.py --file error.log
# Interactive mode
python scripts/parse_error.py --interactive
# Output formats
python scripts/parse_error.py --output json # JSON
python scripts/parse_error.py --output markdown # Markdown
python scripts/parse_error.py --output summary # Short summary
Multi-Repository Support
This skill can analyze errors against multiple repositories by accepting a repository path parameter:
Step 1: Identify Error Context
Determine which repository the error relates to:
- MindSpeed-RL: Reinforcement learning on Ascend NPU
- MultimodalSDK: Multimodal LLM preprocessing
- Vision SDK: Image/video processing on Ascend
- AgentSDK: Agent framework integration
Step 2: Configure Repository Path
When user provides a repository path, search for:
- Error message in source code (grep for error strings)
- Related configuration or usage patterns
- Recent changes that might cause the issue
Step 3: Cross-Reference
Use the repository path to:
- Find exact line numbers in stack traces
- Identify version-specific behaviors
- Check for known issues in the codebase
Error Pattern Matching
When analyzing errors:
- Extract the key error type and message
- Match against patterns in error-patterns.md
- For Ascend-specific errors, check sdk-knowledge.md
- Look for version mismatches, missing dependencies, NPU issues
- Check for known issues in the error domain
Ascend NPU Specific Errors
This skill specializes in Ascend NPU hardware scenarios:
CANN Errors
ascend error: CANN initialization failuresRuntimeError: CANN: NPU runtime errorsNPU error: NPU device errors
MultimodalSDK Errors
mm.: MultimodalSDK API errorsAdapterError: Preprocessor adapter failuresTensorError: Tensor handling errors
Memory Errors on NPU
NPU out of memory: NPU memory exhaustionACL error: Ascend ACL errors
Vision SDK Errors
mxvision: Vision SDK errorsImage decode error: Image processing failures
Response Generation
Always follow these templates when responding to users:
- Known Issue: Use Template 1 from response-templates.md
- Need Info: Use Template 2 - ask for missing details
- Version Issue: Use Template 3 - explain compatibility
- Config Error: Use Template 4 - provide correct settings
- Permission: Use Template 5 - explain required access
- NPU Specific: Use Ascend-specific solutions from sdk-knowledge.md
Debugging Checklist
For complex errors, follow the systematic approach in debugging-checklist.md:
- Information Gathering - extract error, env, context
- Initial Analysis - classify, check versions, analyze logs
- Root Cause Determination - form and test hypotheses
- Resolution - develop and verify solution
- Communication - prepare clear response
Output Format
For each error analysis, always include:
## Issue Analysis
**Root Cause**: [Brief explanation]
**Solution**: [Step-by-step resolution]
**Prevention**: [Tips to avoid this issue]
**NPU Context**: [If applicable, Ascend-specific considerations]
Scripts
parse_error.py
Extracts structured information from error logs.
python scripts/parse_error.py < error.log
Outputs JSON with fields: error_type, error_message, category, environment, traceback, npu_specific.
analyze_error.py (optional advanced script)
For deeper analysis with repository context:
python scripts/analyze_error.py \
--error-log error.log \
--repo-path /path/to/repo \
--output analysis.md
References
- error-patterns.md - Common error patterns (general + Ascend)
- sdk-knowledge.md - Ascend NPU/CANN specific knowledge
- response-templates.md - Response templates
- debugging-checklist.md - Debugging approach
- examples.md - Analysis examples
- solutions.md - Common solutions and workarounds
Example Usage
Example 1: NPU Memory Error
Input:
Error: RuntimeError: NPU out of memory. Tried to allocate 2.0 GB on device 0.
Environment: Ubuntu 22.04, CANN 8.5.0, Python 3.9
Context: Running MultimodalSDK preprocessing
Analysis:
- Pattern match: NPU OOM error
- Root cause: Insufficient NPU memory for batch
- Solution: Reduce batch size, enable memory optimization
Example 2: CANN Import Error
Input:
Error: ImportError: cannot import name 'acl' from 'ascend'
Environment: CentOS 7.9, CANN 8.0.0
Context: Initializing Ascend NPU
Analysis:
- Pattern match: CANN not properly installed
- Root cause: CANN environment variables not set
- Solution: Source CANN set_env.sh
Example 3: Vision SDK Configuration Error
Input:
Error: KeyError: 'device_id'
Environment: Python 3.9, Vision SDK 3.0
Context: Loading pipeline configuration
Analysis:
- Pattern match: Configuration key missing
- Root cause: Missing required configuration parameter
- Solution: Add device_id to config
Best Practices
- Always validate input completeness - Ask for missing environment info if needed
- Be specific in solutions - Provide exact commands, file paths, line numbers
- Explain the why - Don't just give fixes, explain why they work
- Acknowledge uncertainty - If the cause is unclear, say so and suggest diagnostic steps
- Keep responses actionable - Every suggestion should have a clear next step
- Consider NPU specifics - For Ascend errors, always check CANN version and NPU status
Limitations
- This skill analyzes based on provided information and known patterns
- Complex issues may require additional debugging
- Some errors may need developer investigation
- Always recommend creating an issue for persistent problems
Integration Notes
This skill is designed to work independently and can be used:
- In CI/CD pipelines for automated error triage
- In support workflows for first-line response
- In development workflows for self-service debugging
- As a standalone tool for error analysis
- With configurable repository paths for source code reference