Skip to content

Conversation

@0pendansor
Copy link
Collaborator

No description provided.

…Models.apply_onnx_shape.\n\nResnet compatibility\n\nResnet\n- [ Y ] Slice\n- [ Y ] Run
…) → Mul (frequency domain) → DFT (inverse).
…lly creates metadata.json with FFT operation details and convolution replacement tracking.
…models reflecting Conv → DFT → Mul → DFT transformations
…er.py and onnx_slicer.py, preserving all shape information and batch sizes
…ments with names like segment_0_1, segment_0_2, etc. in single parent folder
- Added ezkl_conv_splitter.py for FFT-based Conv decomposition
- Added simple_multiply_circuit.py for basic multiply operations
- Added simple_multiply_segment5.py for segment_5 specific circuit
- Generated ONNX circuits for FFT, Multiply, and IFFT operations
- Compiled multiply circuit with k=22 (logrows=22)
- Setup phase in progress - VK completed, PK generation pending
- Current state: Ready to resume EZKL setup and prove/verify pipeline

Files committed:
- Python utilities for circuit generation
- EZKL settings and compiled circuit for segment_5
- Working state to resume from k=22 setup
…o parallel processing. the best outcome coming from set logrow = 20 and run in 16 chunks, NO need for rescaling, sample input should be provided.

update support:
- adoptive chunk size
- skip unnecessary chunking ( layer 5)  & recommend Proof of inference whole.
…eline_demo.py

## EZKL ResNet Integration Complete

### 🔄 Updated decomposer.py → EZKL Conv Splitter
- **Full FFT-based convolution decomposition**
- **EZKL-compatible operators only** (MatMul, Mul, Pad, opset 18)
- **Pre-computed kernel FFT** for circuit efficiency
- **3-circuit split**: FFT → MUL → IFFT
- **Metadata generation** for circuit chaining

### 🚀 Complete EZKL Workflow
1. **Run decomposer.py**:
   ```bash
   python decomposer.py
   ```
   - Decomposes all ResNet segments into EZKL circuits
   - Creates FFT, MUL, IFFT circuits per segment
   - Generates metadata for chaining

2. **Run ezkl_pipeline.py**:
   ```bash
   python src/utils/ezkl_pipeline.py
   ```
   - Parallel processing of MUL chunks (16 chunks, 4 channels each)
   - Complete EZKL proof generation pipeline
   - Witness data chaining (FFT→MUL→IFFT)

3. **Test with pipeline_demo.py**:
   ```bash
   python pipeline_demo.py
   ```
   - Inference comparison (original vs decomposed)
   - Parallel processing demonstration
   - Results summary and status

### 🎯 Key Features
- ✅ **ResNet full model support**
- ✅ **Parallel 16-chunk MUL processing**
- ✅ **EZKL proof generation pipeline**
- ✅ **Automatic circuit decomposition**
- ✅ **Metadata-driven workflow**
- ✅ **k=17 optimization for performance**

### 📋 Usage Instructions
```bash
# 1. Decompose ResNet segments
python decomposer.py

# 2. Run parallel EZKL pipeline
python src/utils/ezkl_pipeline.py

# 3. Test and verify results
python pipeline_demo.py
```

### 🔧 Technical Details
- **Input**: ResNet slices from `src/models/resnet/slices/`
- **Output**: EZKL circuits in `src/models/resnet/ezkl_circuits/`
- **MUL chunks**: 16 parallel chunks (4 channels each = 64 total)
- **Proofs**: Generated in `ezkl_circuits/segment_X/proofs/`
- **Verification**: End-to-end proof verification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants