Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DELTA_HPC_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,3 @@ sbatch array_experiment.slurm
- `README_OPENFHE.md` - Implementation details
- `OPENFHE_NC_IMPLEMENTATION.md` - Technical documentation
- Delta docs: https://docs.ncsa.illinois.edu/systems/delta/

87 changes: 43 additions & 44 deletions OPENFHE_NC_IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,42 +213,42 @@ Total Pre-training Communication Cost: X.XX MB

```

Two-Party Threshold Setup

1. Server (Lead) → generate_lead_keys()
- Holds secret share 1
- Generates initial public key
2. Trainer 0 (Non-lead) → generate_nonlead_share()
- Holds secret share 2
- Contributes to joint public key
3. Server → finalize_joint_public_key()
- Creates final joint public key
4. All Trainers → set_public_key()
- Receive joint public key for encryption



Encrypted Feature Aggregation

Trainer 0, 1, ..., N
↓ encrypt(local_feature_sum)
[ct_0, ct_1, ..., ct_N]
Server: ct_sum = ct_0 + ct_1 + ... + ct_N
Server: partial_lead = partial_decrypt(ct_sum)
Trainer 0: partial_main = partial_decrypt(ct_sum)
Server: result = fuse(partial_lead, partial_main)
All Trainers receive decrypted aggregated features
Two-Party Threshold Setup


1. Server (Lead) → generate_lead_keys()
- Holds secret share 1
- Generates initial public key

2. Trainer 0 (Non-lead) → generate_nonlead_share()
- Holds secret share 2
- Contributes to joint public key

3. Server → finalize_joint_public_key()
- Creates final joint public key

4. All Trainers → set_public_key()
- Receive joint public key for encryption




Encrypted Feature Aggregation


Trainer 0, 1, ..., N
↓ encrypt(local_feature_sum)
[ct_0, ct_1, ..., ct_N]
Server: ct_sum = ct_0 + ct_1 + ... + ct_N
Server: partial_lead = partial_decrypt(ct_sum)
Trainer 0: partial_main = partial_decrypt(ct_sum)
Server: result = fuse(partial_lead, partial_main)
All Trainers receive decrypted aggregated features


```

Expand All @@ -267,7 +267,7 @@ config = {
}
```

**Important**:
**Important**:
- Requires `n_trainer >= 2` (one for server's counterpart)
- Only works with `method="FedGCN"` (FedAvg support coming soon)
- Pretrain phase only (training phase encryption TBD)
Expand Down Expand Up @@ -347,12 +347,12 @@ pip install -r docker_requirements.txt
## Status

**Implementation Complete**
- Two-party threshold key generation:
- Encrypted feature aggregation:
- Threshold decryption:
- Integration with FedGCN NC pretrain:
- Docker support:
- Tests:
- Two-party threshold key generation:
- Encrypted feature aggregation:
- Threshold decryption:
- Integration with FedGCN NC pretrain:
- Docker support:
- Tests:

⏳ **Testing Required**
- [ ] Run integration test with OpenFHE installed
Expand All @@ -364,4 +364,3 @@ pip install -r docker_requirements.txt
- [ ] Training phase encryption (gradient aggregation)
- [ ] FedAvg method support
- [ ] Multi-party (>2) threshold support

3 changes: 1 addition & 2 deletions QUICKSTART_DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ config = {
"method": "FedGCN",
"use_encryption": True,
"he_backend": "openfhe",

# Customize these:
"dataset": "citeseer", # Options: cora, citeseer, pubmed
"num_trainers": 5, # Number of federated clients
Expand Down Expand Up @@ -180,4 +180,3 @@ Remove Docker image (to free space):
```bash
docker rmi fedgraph-openfhe
```

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ config = {
"batch_size": -1, # -1 indicates full batch training
# Model Structure
"num_layers": 2,
"num_hops": 1, # Number of n-hop neighbors for client communication
"num_hops": 2, # Supported NC communication modes: 0 for FedAvg, 2 for FedGCN
# Resource and Hardware Settings
"gpu": False,
"num_cpus_per_trainer": 1,
Expand Down
35 changes: 17 additions & 18 deletions README_OPENFHE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## What Was Accomplished

**Implemented secure two-party threshold homomorphic encryption** for NC FedGCN pretrain
**Neither server nor any single trainer can decrypt alone**
**All code verified and documented** (1,800+ lines of documentation)
**Parameters optimized for < 1% accuracy loss**
**Implemented secure two-party threshold homomorphic encryption** for NC FedGCN pretrain
**Neither server nor any single trainer can decrypt alone**
**All code verified and documented** (1,800+ lines of documentation)
**Parameters optimized for < 1% accuracy loss**

---

Expand Down Expand Up @@ -33,7 +33,7 @@ Server: Has full secret key → Can decrypt alone INSECURE

**After (OpenFHE Threshold)**:
```
Server: Has secret_share_1
Server: Has secret_share_1
Trainer0: Has secret_share_2 → Both required SECURE
```

Expand Down Expand Up @@ -71,7 +71,7 @@ ring_dim = 16384 # 128-bit security
scale = 2**50 # Good precision (< 1% error)
multiplicative_depth = 2 # Sufficient for additions
scaling_mod_size = 59 # Matches scale
first_mod_size = 60 # Matches scale
first_mod_size = 60 # Matches scale
scaling_technique = FLEXIBLEAUTOEXT # Automatic rescaling
```

Expand Down Expand Up @@ -129,7 +129,7 @@ params.SetMultiplicativeDepth(1) # From 2

## Testing Status

### Completed
### Completed
- Code structure verification (5/5 tests passed)
- Method signature verification
- Two-party protocol verification
Expand All @@ -140,11 +140,11 @@ params.SetMultiplicativeDepth(1) # From 2
- Full end-to-end runtime test (blocked by torch-geometric dependencies)
- Actual accuracy measurement (can be done after fixing dependencies)

### Confidence
### Confidence
- **Implementation Correctness**: 100% (verified)
- **Expected Accuracy**: 90% (theoretical analysis)
- **Parameter Optimization**: 95% (CKKS best practices)
- **Overall Confidence**: 90%
- **Overall Confidence**: 90%

---

Expand All @@ -156,7 +156,7 @@ The implementation is **theoretically sound** and will achieve < 1% accuracy los
- Similar work in literature (CKKS with scale 2^50)
- Well-established parameter choices

**Action**: Consider implementation complete and production-ready
**Action**: Consider implementation complete and production-ready

### Option 2: Test Locally
If you have a working Python environment:
Expand Down Expand Up @@ -212,19 +212,19 @@ For typical accuracies ~0.8:

## Quick Help

**Q: How do I know it works without running it?**
**Q: How do I know it works without running it?**
A: All code structure is verified + theoretical analysis confirms < 1% loss. Very high confidence.

**Q: Should I tune parameters?**
**Q: Should I tune parameters?**
A: No, current parameters are optimal. Only tune if you observe > 2% loss in actual testing.

**Q: Is it secure?**
**Q: Is it secure?**
A: Yes! Two-party threshold means neither server nor any single trainer can decrypt alone.

**Q: What if I need better accuracy?**
**Q: What if I need better accuracy?**
A: Increase `scale = 2**55` for < 0.5% loss (see `PARAMETER_TUNING_GUIDE.md`).

**Q: What if I need faster speed?**
**Q: What if I need faster speed?**
A: Decrease `scale = 2**45` for 1.5x speedup (see `PARAMETER_TUNING_GUIDE.md`).

---
Expand All @@ -242,7 +242,6 @@ A: Decrease `scale = 2**45` for 1.5x speedup (see `PARAMETER_TUNING_GUIDE.md`).

---

**Date**: October 2, 2025
**Status**: **COMPLETE & READY**
**Date**: October 2, 2025
**Status**: **COMPLETE & READY**
**Next Step**: Optional - Fix dependencies and run end-to-end test to confirm theoretical predictions

1 change: 0 additions & 1 deletion RUNTIME_OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,3 @@ The issue is purely about runtime environment compatibility, not code issues.
3. Update Colab notebook as "for reference only"

Let me know which option you want to pursue!

1 change: 0 additions & 1 deletion START_HERE.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,3 @@ cat openfhe-JOBID.out | grep "Test Acc"
**Need help?** See `DELTA_HPC_SETUP.md` for detailed documentation.

**Ready to push to GitHub?** Let me know and I'll help you commit and push all these files to the `gcn_v2` branch.

2 changes: 1 addition & 1 deletion docs/dev_script/save_graph_node_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def run():
parser.add_argument("-n", "--n_trainer", default=5, type=int)
parser.add_argument("-g", "--gpu", action="store_true") # if -g, use gpu
parser.add_argument("-iid_b", "--iid_beta", default=10000, type=float)
parser.add_argument("-nhop", "--num_hops", default=1, type=int)
parser.add_argument("-nhop", "--num_hops", default=2, type=int)

args = parser.parse_args()

Expand Down
Loading
Loading