homericintelligence/scylla/analyze-simd-usage
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Analyze SIMD usage opportunities in Mojo code. Use to find performance optimization opportunities.
Install
npx vskill@latest install homericintelligence/scylla/analyze-simd-usageSKILL.md
Analyze SIMD Usage Opportunities
Identify where SIMD (Single Instruction Multiple Data) can improve performance.
When to Use
- Performance-critical tensor operations
- Element-wise operations on large arrays
- Vectorization of loops processing multiple elements
- Optimizing matrix/vector operations
- Finding performance bottlenecks in ML code
Quick Reference
SIMD Optimization Opportunities
Vectorizable Patterns:
- ✅ Element-wise addition:
a[i] + b[i]for all i - ✅ Scalar multiplication:
a[i] * scalarfor all i - ✅ Unary operations:
sin(a[i]),exp(a[i])for all i - ✅ Reduction operations: sum, max, min over array
- ❌ Dependent iterations:
a[i] = a[i-1] + value(sequential) - ❌ Conditional branches:
if a[i] > threshold:(hard to vectorize) - ❌ Function calls: unpredictable latency (avoid in tight loops)
SIMD Width Selection:
@parameter fn[simd_width: Int]- Generic SIMD widthsimd_width=4- Typically good for float32simd_width=8- Optimal for many operationssimd_width=16+- For int32 or specialized ops- Match hardware capabilities (AVX2=4-8, AVX512=8-16)
Vectorization Patterns:
- ✅
@vectorizedecorator for simple loops - ✅
@unrollfor small loops (2-4 iterations) - ✅ Manual SIMD with
.load[]and.store[] - ✅ Tensor operations with SIMD dimensions
Analysis Workflow
- Profile code: Identify bottlenecks using time/memory metrics
- Find loops: Locate loops processing large amounts of data
- Check vectorizability: Verify no loop-carried dependencies
- Estimate speedup: SIMD could provide 4-16x improvement
- Implement SIMD: Use @vectorize, @unroll, or manual SIMD
- Measure performance: Verify improvement with benchmarks
- Document changes: Note what was optimized and why
Output Format
Report SIMD analysis with:
- Hotspots - Functions/loops using most CPU time
- Vectorization Potential - Operations that could use SIMD
- Estimated Speedup - Expected performance improvement
- Implementation Priority - High/medium/low impact
- Technical Approach - How to implement SIMD
- Risks - Potential issues with vectorization
- Recommendations - Which optimizations to pursue first
Optimization Examples
Example 1: Element-wise Addition
Example 2: Reduction (Sum)
Error Handling
| Problem | Solution | |
|---|---|---|
| Vectorization causes wrong results | Check for loop-carried dependencies | |
| Segment fault with SIMD | Verify alignment and bounds | |
| Minimal speedup | May not be vectorizable, profile to confirm | |
| Complex logic | Break into simpler vectorizable operations | |
| Type mismatches | Ensure SIMD width compatible with element type |
SIMD Decision Tree
- Does loop process large arrays? → YES → Check vectorizability
- Loop-carried dependencies? → YES → Can't vectorize, optimize differently
- Simple operations on many elements? → YES → Use @vectorize or @unroll
- Critical path (hot loop)? → YES → Worth optimizing
- Implement → Measure → Iterate
References
- See mojo-simd-optimize for implementation guidance
- See CLAUDE.md for SIMD code patterns
- See performance section in module documentation
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdocs/arxiv/dryrun/raw/T6/01/run_01/workspace/.claude/skills/analyze-simd-usage/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/homericintelligence/scylla/analyze-simd-usage)