Skip to content

Commit

Permalink
feat(sgx): get taskset parameters from env
Browse files Browse the repository at this point in the history
  • Loading branch information
Gezq committed Mar 6, 2024
1 parent 7dd7a64 commit 1733328
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
9 changes: 8 additions & 1 deletion deploy/scripts/sgx/run_trainer_master_sgx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ fi

server_port=$(normalize_env_to_args "--server-port" "$PORT1")

taskset -c 0-3 stdbuf -o0 gramine-sgx python main.py --master \
if [[ -z "${START_CPU_SN}" ]]; then
START_CPU_SN=0
fi
if [[ -z "${END_CPU_SN}" ]]; then
END_CPU_SN=3
fi

taskset -c $START_CPU_SN-$END_CPU_SN stdbuf -o0 gramine-sgx python main.py --master \
--application-id=$APPLICATION_ID \
--data-source=$DATA_SOURCE \
--data-path=$DATA_PATH \
Expand Down
9 changes: 8 additions & 1 deletion deploy/scripts/sgx/run_trainer_ps_sgx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ unset HTTPS_PROXY https_proxy http_proxy ftp_proxy
make_custom_env 4
source /root/start_aesm_service.sh

taskset -c 0-3 stdbuf -o0 gramine-sgx python -m fedlearner.trainer.parameter_server $POD_IP:${LISTEN_PORT}
if [[ -z "${START_CPU_SN}" ]]; then
START_CPU_SN=0
fi
if [[ -z "${END_CPU_SN}" ]]; then
END_CPU_SN=3
fi

taskset -c $START_CPU_SN-$END_CPU_SN stdbuf -o0 gramine-sgx python -m fedlearner.trainer.parameter_server $POD_IP:${LISTEN_PORT}
9 changes: 8 additions & 1 deletion deploy/scripts/sgx/run_trainer_worker_sgx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ source /root/start_aesm_service.sh

server_port=$(normalize_env_to_args "--server-port" "$PORT1")

taskset -c 0-3 stdbuf -o0 gramine-sgx python main.py --worker \
if [[ -z "${START_CPU_SN}" ]]; then
START_CPU_SN=0
fi
if [[ -z "${END_CPU_SN}" ]]; then
END_CPU_SN=3
fi

taskset -c $START_CPU_SN-$END_CPU_SN stdbuf -o0 gramine-sgx python main.py --worker \
--application-id="$APPLICATION_ID" \
--master-addr="$MASTER_HOST:50051" \
--cluster-spec="$CLUSTER_SPEC" \
Expand Down

0 comments on commit 1733328

Please sign in to comment.