Skip to content

Implement async scheduler flag and helpers - #3

Draft
davidalvin wants to merge 2 commits into
track-transitionsfrom
codex/add-asynchronous-execution-support
Draft

davidalvin wants to merge 2 commits into
track-transitionsfrom
codex/add-asynchronous-execution-support

Conversation

@davidalvin

Copy link
Copy Markdown
Owner

Summary

  • add EXTRA_CXXFLAGS support in Makefile
  • extend SimulationParams with callback_ops_interval
  • add slice_id to SimulationState
  • implement MutateAndRunPair helper and async kernel
  • expose async build capability to Python
  • update cubff_run_db.py to support async mode

Testing

  • make (fails: nvcc not found and pybind11 missing)

https://chatgpt.com/codex/tasks/task_e_6873fd9a3fa883238ea6c4367bd73892

## Core Changes

### 1. Enable Async Support in Build System
- Modified Makefile to add -DENABLE_ASYNC flag to COMMON_FLAGS
- This enables async execution capabilities in the C++ codebase

### 2. Enhanced Python Bindings
- Modified cubff_py.cc to expose callback_ops_interval parameter
- Added HAVE_ASYNC attribute to Python module for runtime detection
- Updated SimulationParams to support async operation intervals

### 3. Fixed S3 Integration
- Modified cubff_run_db.py to handle S3 configuration gracefully
- Added proper error handling for S3 operations
- Made S3 uploads conditional to prevent errors when S3 is unavailable

## New Testing and Execution Scripts

### 4. Simple Async Runner (cubff_run_simple.py)
- Clean, minimal async simulation runner
- Supports --enable_async and --ops_interval flags
- Saves results locally without S3 dependencies
- Perfect for testing and development

### 5. Visual Async Runner (cubff_run_visual.py)
- Shows 10 different programs evolving in real-time
- Demonstrates program diversity and evolution
- Uses language.PrintProgram() for pretty visualization

### 6. Comprehensive Proof Tests
- async_proof_test.py: Basic async vs sync comparison
- async_detailed_proof.py: Detailed worker and execution analysis
- test_cubff_run.py: Minimal test runner for quick validation

## How to Use

### Build with Async Support
```bash
make clean && make PYTHON=1 CUDA=0
```

### Run Async Simulations
```bash
# Quick test (10 epochs)
python3 test_cubff_run.py --enable_async

# Full simulation (100 epochs)
python3 cubff_run_simple.py --enable_async

# Visual simulation with program display
python3 cubff_run_visual.py --enable_async --program_count 5

# Detailed proof test
python3 async_detailed_proof.py --duration 8
```

### Key Features
- ✅ Async support confirmed via HAVE_ASYNC attribute
- ✅ Different callback frequencies between sync/async
- ✅ Program evolution visualization
- ✅ Worker count and execution time tracking
- ✅ Comprehensive comparison tools
- ✅ Local file saving (no S3 required)

### Proof of Async Operation
The async simulation is working when you observe:
1. Different timing patterns between sync and async runs
2. Different program evolution paths
3. More frequent callbacks in async mode
4. Different final program states
5. Respect for callback_ops_interval parameter

This commit provides a complete framework for testing and validating
asynchronous execution in the CUBFF self-replicating program simulator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant