-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement Request] Integrate Plato into Sedna as a backend for supporting federated learning - Phase one #116
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
apiVersion: sedna.io/v1alpha1 | ||
kind: FederatedLearningJob | ||
metadata: | ||
name: yolo-v5 | ||
spec: | ||
pretrainedModel: # option | ||
name: "yolo-v5-pretrained-model" | ||
transmitter: # option | ||
ws: { } # option, by default | ||
s3: # option, but at least one | ||
aggDataPath: "s3://sedna/fl/aggregation_data" | ||
credentialName: mysecret | ||
aggregationWorker: | ||
model: | ||
name: "yolo-v5-model" | ||
template: | ||
spec: | ||
nodeName: "sedna-control-plane" | ||
containers: | ||
- image: kubeedge/sedna-example-federated-learning-mistnet-yolo-aggregator:v0.4.0 | ||
name: agg-worker | ||
imagePullPolicy: IfNotPresent | ||
env: # user defined environments | ||
- name: "cut_layer" | ||
value: "4" | ||
- name: "epsilon" | ||
value: "100" | ||
- name: "aggregation_algorithm" | ||
value: "mistnet" | ||
- name: "batch_size" | ||
value: "32" | ||
resources: # user defined resources | ||
limits: | ||
memory: 8Gi | ||
trainingWorkers: | ||
- dataset: | ||
name: "coco-dataset-1" | ||
template: | ||
spec: | ||
nodeName: "edge-node" | ||
containers: | ||
- image: kubeedge/sedna-example-federated-learning-mistnet-yolo-client:v0.4.0 | ||
name: train-worker | ||
imagePullPolicy: IfNotPresent | ||
args: [ "-i", "1" ] | ||
env: # user defined environments | ||
- name: "cut_layer" | ||
value: "4" | ||
- name: "epsilon" | ||
value: "100" | ||
- name: "aggregation_algorithm" | ||
value: "mistnet" | ||
- name: "batch_size" | ||
value: "32" | ||
- name: "learning_rate" | ||
value: "0.001" | ||
- name: "epochs" | ||
value: "1" | ||
resources: # user defined resources | ||
limits: | ||
memory: 2Gi | ||
- dataset: | ||
name: "coco-dataset-2" | ||
template: | ||
spec: | ||
nodeName: "edge-node" | ||
containers: | ||
- image: kubeedge/sedna-example-federated-learning-mistnet-yolo-client:v0.4.0 | ||
name: train-worker | ||
imagePullPolicy: IfNotPresent | ||
args: [ "-i", "2" ] | ||
env: # user defined environments | ||
- name: "cut_layer" | ||
value: "4" | ||
- name: "epsilon" | ||
value: "100" | ||
- name: "aggregation_algorithm" | ||
value: "mistnet" | ||
- name: "batch_size" | ||
value: "32" | ||
- name: "learning_rate" | ||
value: "0.001" | ||
- name: "epochs" | ||
value: "1" | ||
resources: # user defined resources | ||
limits: | ||
memory: 2Gi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM tensorflow/tensorflow:1.15.4 | ||
|
||
RUN apt update \ | ||
&& apt install -y libgl1-mesa-glx git | ||
|
||
COPY ./lib/requirements.txt /home | ||
|
||
RUN python -m pip install --upgrade pip | ||
|
||
RUN pip install -r /home/requirements.txt | ||
|
||
ENV PYTHONPATH "/home/lib:/home/plato:/home/plato/packages/yolov5" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more advised to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
+1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Due to the large package issue, we currently add Plato as third-party lib. |
||
COPY ./lib /home/lib | ||
RUN git clone https://github.com/TL-System/plato.git /home/plato | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
|
||
RUN pip install -r /home/plato/requirements.txt | ||
RUN pip install -r /home/plato/packages/yolov5/requirements.txt | ||
|
||
WORKDIR /home/work | ||
COPY examples/federated_learning/yolov5_coco128_mistnet /home/work/ | ||
|
||
CMD ["/bin/sh", "-c", "ulimit -n 50000; python aggregate.py"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM tensorflow/tensorflow:1.15.4 | ||
|
||
RUN apt update \ | ||
&& apt install -y libgl1-mesa-glx git | ||
|
||
COPY ./lib/requirements.txt /home | ||
|
||
RUN python -m pip install --upgrade pip | ||
|
||
RUN pip install -r /home/requirements.txt | ||
|
||
ENV PYTHONPATH "/home/lib:/home/plato:/home/plato/packages/yolov5" | ||
|
||
COPY ./lib /home/lib | ||
RUN git clone https://github.com/TL-System/plato.git /home/plato | ||
|
||
RUN pip install -r /home/plato/requirements.txt | ||
RUN pip install -r /home/plato/packages/yolov5/requirements.txt | ||
|
||
WORKDIR /home/work | ||
COPY examples/federated_learning/yolov5_coco128_mistnet /home/work/ | ||
|
||
ENTRYPOINT ["python", "train.py"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be more appropriate to use a
PyTorch
orpython-slim
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start from
Python-slim
needs to install extra libs, which may lead to larger image size.