-
Notifications
You must be signed in to change notification settings - Fork 214
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
add distributed mode for xgb algo #471
Changes from 2 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,46 @@ | ||
use_gpu: False | ||
device: 0 | ||
early_stop: | ||
patience: 5 | ||
seed: 12345 | ||
federate: | ||
client_num: 2 | ||
mode: 'distributed' | ||
make_global_eval: False | ||
online_aggr: False | ||
total_round_num: 20 | ||
distribute: | ||
use: True | ||
server_host: '127.0.0.1' | ||
server_port: 50051 | ||
client_host: '127.0.0.1' | ||
client_port: 50052 | ||
role: 'client' | ||
data_idx: 1 | ||
data: | ||
root: data/ | ||
type: credit | ||
splits: [0.8, 0.2] | ||
dataloader: | ||
type: raw | ||
batch_size: 2000 | ||
model: | ||
type: lr | ||
train: | ||
optimizer: | ||
bin_num: 100 | ||
lambda_: 0.1 | ||
gamma: 0 | ||
num_of_trees: 10 | ||
max_tree_depth: 3 | ||
xgb_base: | ||
use: True | ||
use_bin: True | ||
dims: [5, 10] | ||
criterion: | ||
type: CrossEntropyLoss | ||
trainer: | ||
type: none | ||
eval: | ||
freq: 3 | ||
best_res_update_round_wise_key: test_loss |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
use_gpu: False | ||
device: 0 | ||
early_stop: | ||
patience: 5 | ||
seed: 12345 | ||
federate: | ||
client_num: 2 | ||
mode: 'distributed' | ||
make_global_eval: False | ||
online_aggr: False | ||
total_round_num: 20 | ||
distribute: | ||
use: True | ||
server_host: '127.0.0.1' | ||
server_port: 50051 | ||
client_host: '127.0.0.1' | ||
client_port: 50053 | ||
role: 'client' | ||
data_idx: 2 | ||
data: | ||
root: data/ | ||
type: credit | ||
splits: [0.8, 0.2] | ||
dataloader: | ||
type: raw | ||
batch_size: 2000 | ||
model: | ||
type: lr | ||
train: | ||
optimizer: | ||
bin_num: 100 | ||
lambda_: 0.1 | ||
gamma: 0 | ||
num_of_trees: 10 | ||
max_tree_depth: 3 | ||
xgb_base: | ||
use: True | ||
use_bin: True | ||
dims: [5, 10] | ||
criterion: | ||
type: CrossEntropyLoss | ||
trainer: | ||
type: none | ||
eval: | ||
freq: 3 | ||
best_res_update_round_wise_key: test_loss |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use_gpu: False | ||
device: 0 | ||
early_stop: | ||
patience: 5 | ||
seed: 12345 | ||
federate: | ||
client_num: 2 | ||
mode: 'distributed' | ||
make_global_eval: False | ||
online_aggr: False | ||
total_round_num: 20 | ||
distribute: | ||
use: True | ||
server_host: '127.0.0.1' | ||
server_port: 50051 | ||
role: 'server' | ||
data_idx: 0 | ||
data: | ||
root: data/ | ||
type: credit | ||
splits: [0.8, 0.2] | ||
dataloader: | ||
type: raw | ||
batch_size: 2000 | ||
model: | ||
type: lr | ||
train: | ||
optimizer: | ||
bin_num: 100 | ||
lambda_: 0.1 | ||
gamma: 0 | ||
num_of_trees: 10 | ||
max_tree_depth: 3 | ||
xgb_base: | ||
use: True | ||
use_bin: True | ||
dims: [5, 10] | ||
criterion: | ||
type: CrossEntropyLoss | ||
trainer: | ||
type: none | ||
eval: | ||
freq: 3 | ||
best_res_update_round_wise_key: test_loss |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
set -e | ||
|
||
cd .. | ||
|
||
echo "Test distributed mode with XGB..." | ||
|
||
### server owns global test data | ||
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. Is it support the situation that server owns global test data? 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. So shall we remove the ''redundant'' code here? 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. Modified. |
||
# python federatedscope/main.py --cfg scripts/distributed_scripts/distributed_configs/distributed_server.yaml & | ||
### server doesn't own data | ||
python federatedscope/main.py --cfg scripts/distributed_scripts/distributed_configs/distributed_xgb_server.yaml & | ||
sleep 2 | ||
|
||
# clients | ||
python federatedscope/main.py --cfg scripts/distributed_scripts/distributed_configs/distributed_xgb_client_1.yaml & | ||
sleep 2 | ||
python federatedscope/main.py --cfg scripts/distributed_scripts/distributed_configs/distributed_xgb_client_2.yaml & | ||
sleep 2 | ||
|
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.
Maybe add some explanations here
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.
Done.