xlearn icon indicating copy to clipboard operation
xlearn copied to clipboard

Multi-threading not working on multi-core servers

Open maye9999 opened this issue 6 years ago • 3 comments

Hi, I'm following the issue #53 and setting the nthread parameter to 20. However, when I use the top command to check CPU usage, I find that there are 20 processes but only two cores are running. I'm using Python API so maybe the problem is about python GIL?

Here is my code snippet

    def train(exp_name, k, lr=0.2, _lambda=0.002):
        ffm_model = xl.create_ffm()
        ffm_model.setTrain("../data/train.ffm")
        ffm_model.setValidate("../data/val.ffm")
        param = {'task': 'binary', 'lr': lr, 'k': k, 'lambda': _lambda, 'metric': 'auc', 'epoch': 10, 'stop_window': 2,
                 'nthread': 20}
        ffm_model.fit(param, "../data/%s/%s.model" % (exp_name, exp_name))

maye9999 avatar May 21 '18 12:05 maye9999

@purkyston Can you please check this issue?

aksnzhy avatar May 23 '18 06:05 aksnzhy

@aksnzhy ok~

pkwv2012 avatar May 23 '18 06:05 pkwv2012

Any conclusion on this? thanks!

mqwu avatar Jul 11 '19 17:07 mqwu