Skip to content

Fix NC metadata, training flow, encrypted aggregation, and smoke test compatibility#44

Merged
yh-yao merged 6 commits into
mainfrom
update_hc
Jun 23, 2026
Merged

Fix NC metadata, training flow, encrypted aggregation, and smoke test compatibility#44
yh-yao merged 6 commits into
mainfrom
update_hc

Conversation

@Pulserius

@Pulserius Pulserius commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes several NC workflow and test issues:

  • Makes NC metadata handling more robust for Hugging Face-loaded trainer data:
    • preserves/saves global_node_num and class_num
    • handles empty train/test label tensors safely
    • avoids recomputing class_num from partial trainer labels when authoritative metadata is available
  • Moves NC federated round execution into Server.train() and has run_NC() reuse that path.
  • Fixes encrypted parameter aggregation metadata handling across model layers.
  • Removes unused server-side encryption helpers and unused get_local_feature_sum_og().
  • Restricts NC num_hops to the currently supported modes: 0 and 2.
  • Masks encrypted feature sums per trainer before sending them back.
  • Fixes duplicate trainer test metric appends.
  • Updates smoke/OpenFHE tests for the merged main branch compatibility.

Validation

Ran focused regression tests for:

  • NC metadata fixes
  • NC server training flow and encrypted aggregation
  • NC hop validation, encrypted feature masking, and unused helper removal
  • duplicate test metric append fix
  • merged-main smoke tests and OpenFHE smoke tests on EC2 Linux

Key test groups passed:

python -m pytest -q tests/unit/test_federated_methods.py::TestResolveNCClassNum tests/unit/test_federated_methods.py::TestResolveNCGlobalNodeNum

python -m pytest -q tests/unit/test_trainer_class.py::TestLoadTrainerDataFromHuggingFace tests/unit/test_trainer_class.py::TestTrainerGeneral::test_get_info tests/unit/test_trainer_class.py::TestTrainerGeneral::test_get_info_handles_empty_labels

python -m pytest -q tests/unit/test_utils_nc.py::TestSaveTrainerDataToHuggingFace

python -m pytest -q tests/test_smoke_unit.py

python -m pytest -q tests/test_smoke_e2e.py::test_smoke_plaintext_default_norm_none tests/test_smoke_e2e.py::test_smoke_plaintext_norm_sym_opt_in

python -m pytest -q test_openfhe_smoke.py tests/test_threshold_ckks_min.py

@Pulserius Pulserius requested review from cyfan11 and yh-yao June 23, 2026 22:52

@yh-yao yh-yao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@yh-yao yh-yao merged commit fb5002c into main Jun 23, 2026
0 of 2 checks passed
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.

2 participants