diff --git a/ci/.travis.yml b/ci/.travis.yml deleted file mode 100644 index c3595efb35..0000000000 --- a/ci/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -env: - - ARCH=x86 -dist: bionic -os: - - linux -language: python -sudo: false -python: - - "3.7.4" -install: - - "bash CI-INSTALL-CONDA.md" -script: - - "bash CI-script-framework.sh" - - "bash CI-script-fedavg.sh" - - "bash CI-script-fednas.sh" - - "bash CI-script-fedavg-robust.sh" diff --git a/ci/CI-install.sh b/ci/CI-install.sh deleted file mode 100644 index 632d8c0547..0000000000 --- a/ci/CI-install.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash -set -ex - -# install pyflakes to do code error checking -echo "pip3 install pyflakes --cache-dir $HOME/.pip-cache" -pip3 install pyflakes --cache-dir $HOME/.pip-cache - -# Conda Installation -wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh -bash miniconda.sh -b -p $HOME/miniconda -source "$HOME/miniconda/etc/profile.d/conda.sh" -hash -r -conda config --set always_yes yes --set changeps1 no -conda update -q conda -conda info -a - -echo "conda create -n fedml python=3.7.4" -conda create -n fedml python=3.7.4 - -echo "conda activate fedml" -conda activate fedml - -# Install PyTorch (please visit pytorch.org to check your version according to your physical machines -conda install pytorch torchvision cudatoolkit=10.2 -c pytorch - -# Install MPI -conda install -c anaconda mpi4py - -# Install Wandb -pip install --upgrade wandb - -# Install other required package -conda install scikit-learn -conda install numpy -conda install h5py -conda install setproctitle -conda install networkx -conda install tqdm -pip install -U MNN -pip install -r requirements.txt - -# install the dataset -# 1. MNIST -cd ./data/MNIST -sh download_and_unzip.sh -cd ../../ - -# 2. FederatedEMNIST -cd ./data/FederatedEMNIST -sh download_federatedEMNIST.sh -cd ../../ - -# 3. shakespeare -cd ./data/shakespeare -sh download_shakespeare.sh -cd ../../ - - -# 4. fed_shakespeare -cd ./data/fed_shakespeare -sh download_shakespeare.sh -cd ../../ - -# 5. fed_cifar100 -cd ./data/fed_cifar100 -sh download_fedcifar100.sh -cd ../../ - -# 6. stackoverflow -# cd ./data/stackoverflow -# sh download_stackoverflow.sh -# cd ../../ - -# 7. CIFAR10 -cd ./data/cifar10 -sh download_cifar10.sh -cd ../../ - -# 8. CIFAR100 -cd ./data/cifar100 -sh download_cifar100.sh -cd ../../ - -# 9. CINIC10 -cd ./data/cinic10 -sh download_cinic10.sh > cinic10_downloading_log.txt -cd ../../ diff --git a/ci/CI-script-fedavg-robust.sh b/ci/CI-script-fedavg-robust.sh deleted file mode 100644 index 66bbff49a6..0000000000 --- a/ci/CI-script-fedavg-robust.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -ex - -# code checking -pyflakes . - -# activate the fedml environment -source "$HOME/miniconda/etc/profile.d/conda.sh" -conda activate fedml - -wandb login ee0b5f53d949c84cee7decbe7a629e63fb2f8408 -wandb off - -# 1. CIFAR10 FedAvg-Robust -cd ./fedml_experiments/distributed/fedavg_robust -sh run_fedavg_robust_distributed_pytorch.sh 10 10 1 8 resnet56 homo 2 1 64 0.001 cifar10 "./../../../data/cifar10" weak-dp 5.0 0.025 & -cd ./../../../ \ No newline at end of file diff --git a/ci/CI-script-fedavg.sh b/ci/CI-script-fedavg.sh deleted file mode 100644 index a8b3b359a7..0000000000 --- a/ci/CI-script-fedavg.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash - -set -ex - -# code checking -pyflakes . - -# activate the fedml environment -source "$HOME/miniconda/etc/profile.d/conda.sh" -conda activate fedml - -wandb login ee0b5f53d949c84cee7decbe7a629e63fb2f8408 -wandb off - -assert_eq() { - local expected="$1" - local actual="$2" - local msg - - if [ "$expected" == "$actual" ]; then - return 0 - else - echo "$expected != $actual" - return 1 - fi -} - -round() { - printf "%.${2}f" "${1}" -} - -# 1. MNIST standalone FedAvg -cd ./fedml_experiments/standalone/fedavg -sh run_fedavg_standalone_pytorch.sh 0 2 2 4 mnist ./../../../data/mnist lr hetero 1 1 0.03 sgd 1 -sh run_fedavg_standalone_pytorch.sh 0 2 2 4 shakespeare ./../../../data/shakespeare rnn hetero 1 1 0.8 sgd 1 -sh run_fedavg_standalone_pytorch.sh 0 2 2 4 femnist ./../../../data/FederatedEMNIST/datasets cnn hetero 1 1 0.03 sgd 1 -sh run_fedavg_standalone_pytorch.sh 0 2 2 4 fed_shakespeare ./../../../data/fed_shakespeare/datasets rnn hetero 1 1 0.8 sgd 1 -sh run_fedavg_standalone_pytorch.sh 0 2 2 4 fed_cifar100 ./../../../data/fed_cifar100/datasets resnet18_gn hetero 1 1 0.03 adam 1 -#sh run_fedavg_standalone_pytorch.sh 0 1 1 4 stackoverflow_lr ./../../../data/stackoverflow/datasets lr hetero 1 1 0.03 sgd 1 -#sh run_fedavg_standalone_pytorch.sh 0 1 1 4 stackoverflow_nwp ./../../../data/stackoverflow/datasets cnn hetero 1 1 0.03 sgd 1 - -# assert that, for full batch and epochs=1, the accuracy of federated training(FedAvg) is equal to that of centralized training -sh run_fedavg_standalone_pytorch.sh 0 1 1 -1 mnist ./../../../data/mnist lr hetero 10 1 0.03 sgd 0 -centralized_full_train_acc=$(cat wandb/latest-run/files/wandb-summary.json | python -c "import sys, json; print(json.load(sys.stdin)['Train/Acc'])") -sh run_fedavg_standalone_pytorch.sh 0 1000 1000 -1 mnist ./../../../data/mnist lr hetero 10 1 0.03 sgd 0 -federated_full_train_acc=$(cat wandb/latest-run/files/wandb-summary.json | python -c "import sys, json; print(json.load(sys.stdin)['Train/Acc'])") -assert_eq $(round $centralized_full_train_acc 3) $(round $federated_full_train_acc 3) -cd ./../../../ - -# assert that, for full batch and epochs=1 and when the product of global and group comm. round is fixed, -# the accuracy of hierarchical federated learning is equal to that of centralized training, regardless of the number of groups -cd ./fedml_experiments/standalone/hierarchical_fl -sh run_standalone_pytorch.sh 0 1000 1000 -1 mnist ./../../../data/mnist lr hetero 0.03 sgd random 2 5 2 1 -hierarchical_fl_full_train_acc=$(cat wandb/latest-run/files/wandb-summary.json | python -c "import sys, json; print(json.load(sys.stdin)['Train/Acc'])") -assert_eq $(round $centralized_full_train_acc 3) $(round $hierarchical_fl_full_train_acc 3) -sh run_standalone_pytorch.sh 0 1000 1000 -1 mnist ./../../../data/mnist lr hetero 0.03 sgd random 2 2 5 1 -hierarchical_fl_full_train_acc=$(cat wandb/latest-run/files/wandb-summary.json | python -c "import sys, json; print(json.load(sys.stdin)['Train/Acc'])") -assert_eq $(round $centralized_full_train_acc 3) $(round $hierarchical_fl_full_train_acc 3) -cd ./../../../ - - -# 2. MNIST distributed FedAvg -#cd ./fedml_experiments/distributed/fedavg -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 lr hetero 1 1 2 0.03 mnist "./../../../data/mnist" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 cnn hetero 1 1 10 0.8 femnist "./../../../data/FederatedEMNIST/datasets" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 resnet18_gn hetero 1 1 10 0.8 fed_cifar100 "./../../../data/fed_cifar100/datasets" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 rnn hetero 1 1 10 0.8 shakespeare "./../../../data/shakespeare" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 rnn hetero 1 1 10 0.8 fed_shakespeare "./../../../data/fed_shakespeare/datasets" 1 - -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 resnet56 homo 1 1 64 0.001 cifar10 "./../../../data/cifar10" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 resnet56 hetero 1 1 64 0.001 cifar10 "./../../../data/cifar10" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 resnet56 homo 1 1 64 0.001 cifar100 "./../../../data/cifar100" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 resnet56 hetero 1 1 64 0.001 cifar100 "./../../../data/cifar100" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 resnet56 homo 1 1 64 0.001 cinic10 "./../../../data/cinic10" 1 -#sh run_fedavg_distributed_pytorch.sh 2 2 1 4 resnet56 hetero 1 1 64 0.001 cinic10 "./../../../data/cinic10" 1 -#cd ./../../../ - -# 3. MNIST mobile FedAvg -#cd ./fedml_mobile/server/executor/ -#python3 app.py & -#bg_pid_server=$! -#echo "pid="$bg_pid_server -# -#sleep 30 -#python3 ./mobile_client_simulator.py --client_uuid '0' & -#bg_pid_client0=$! -#echo $bg_pid_client0 -# -#python3 ./mobile_client_simulator.py --client_uuid '1' & -#bg_pid_client1=$! -#echo $bg_pid_client1 -# -#sleep 80 -#kill $bg_pid_server -#kill $bg_pid_client0 -#kill $bg_pid_client1 - -#cd ./../../../ diff --git a/ci/CI-script-fednas.sh b/ci/CI-script-fednas.sh deleted file mode 100644 index 58ade04a07..0000000000 --- a/ci/CI-script-fednas.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -ex - -# code checking -pyflakes . - -# activate the fedml environment -source "$HOME/miniconda/etc/profile.d/conda.sh" -conda activate fedml - -wandb login ee0b5f53d949c84cee7decbe7a629e63fb2f8408 -wandb off - -# 1. search -cd ./fedml_experiments/distributed/fednas/ -sh run_fednas_search.sh 1 4 darts homo 2 1 2 & -cd ./../../../ - -# 2. train -cd ./fedml_experiments/distributed/fednas/ -sh run_fednas_train.sh 1 4 darts homo 2 1 2 & -cd ./../../../ \ No newline at end of file diff --git a/ci/CI-script-framework.sh b/ci/CI-script-framework.sh deleted file mode 100644 index 842c3f5a59..0000000000 --- a/ci/CI-script-framework.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -ex - -# code checking -pyflakes . - -# activate the fedml environment -source "$HOME/miniconda/etc/profile.d/conda.sh" -conda activate fedml - -wandb login ee0b5f53d949c84cee7decbe7a629e63fb2f8408 -wandb off - -# 1. distributed base framework -cd ./fedml_experiments/distributed/base -sh run_base_distributed_pytorch.sh & -cd ./../../../ - -# 2. decentralized base framework -cd ./fedml_experiments/distributed/decentralized_demo -sh run_decentralized_demo_distributed_pytorch.sh & -cd ./../../../