musify
Convert CUDA code to MUSA (Moore Threads GPU) using the musify tool. Use when migrating CUDA codebases to MUSA platform, converting CUDA kernels/APIs to MUSA equivalents, or porting NVIDIA GPU code to Moore Threads GPUs. Supports batch conversion of .cu, .cuh, .cpp, .h files with text-based API mapping.
Why use this skill?
Automate the migration of CUDA GPU code to MUSA architecture using the Musify skill. Efficient batch conversion for C++ and CUDA source files.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/dongyang-mt/musifyWhat This Skill Does
Musify is a specialized code transformation utility designed to bridge the gap between NVIDIA CUDA and the MUSA (Moore Threads Unified System Architecture) ecosystem. It functions primarily as a text-based search-and-replace engine optimized for GPU kernel code. By mapping CUDA-specific API calls, prefixes, and keywords to their MUSA counterparts, Musify automates the most tedious aspects of porting legacy CUDA codebases to Moore Threads hardware. It supports in-place modifications and bulk file processing, enabling developers to handle large-scale projects with minimal manual intervention.
Installation
To use Musify, ensure you have the MUSA toolkit installed on your system. You will need to install the primary dependency via pip:
pip install ahocorapy
Once the dependency is satisfied, the musify-text command-line interface becomes available. It is recommended to run this in a virtual environment to prevent dependency conflicts with other system-level development tools.
Use Cases
- Legacy Migration: Moving existing high-performance computing (HPC) projects from NVIDIA hardware to MUSA-compatible accelerators.
- Multi-Platform Support: Maintaining dual-target codebases where code needs to be adapted for different hardware backends.
- Prototyping: Quickly testing CUDA-based algorithms on MUSA architecture without rewriting core logic.
- Batch Refactoring: Applying naming convention changes across thousands of source files in a single pass.
Example Prompts
- "Musify all CUDA files in the current directory and its subdirectories, modifying them in-place."
- "Run musify-text on model_kernels.cu and validation_utils.cpp, outputting the result to new files to compare against the originals."
- "Can you help me identify if any functions in my project are using CUDA APIs that aren't yet mapped to MUSA?"
Tips & Limitations
Musify is a text-based replacement tool, not a full semantic compiler. While it handles API mappings like cudaMalloc to musaMalloc effectively, it cannot resolve complex architecture-specific hardware differences that might lead to kernel panic or performance bottlenecks. Always perform a backup of your source directory before running in-place conversion. Use the provided exclusion markers (// MUSIFY_EXCL_LINE) for sensitive code paths that should not be automatically altered. After conversion, expect to perform manual debugging and utilize the mcc compiler to verify the syntax and semantic correctness of the translated output.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-dongyang-mt-musify": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read