Parallelize cpu map reduce

From XuShuwenn/RedAct · View interactive version

Parallelize cpu map reduce is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Design and implement deterministic, multiprocessing-based speedups for CPU-bound pipelines with independent per-item work and global aggregation, while preserving identical outputs.

How to use this skill

Skill file

Parallelizing CPU-Bound Map-Reduce Pipelines (Deterministic, Result-Identical)

This skill teaches a reusable workflow for accelerating CPU-bound data pipelines (e.g., text indexing and batch scoring) using Python multiprocessing. It focuses on splitting work into independent map phases with a central reduce/aggregation step, minimizing inter-process communication, and preserving exact output equivalence to a sequential baseline.

When to Use

Activate this skill when the task:

Core Workflow

1) Understand the Baseline

2) Design a Multi-Phase Parallel Plan

3) Worker and IPC Strategy

4) Chunking, Sizing, and Concurrency

5) Deterministic Merge and Ordering

6) Search/Batched Scoring Pattern (if applicable)

7) Measurement and Validation

Verification

Perform these checks before finalizing:

Common Pitfalls and How to Avoid Them

Optional Script Usage

This skill includes a generic helper script at scripts/parallel_utils.py:

Example usage pattern:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.