xlearn
xlearn copied to clipboard
Multi-threading not working on multi-core servers
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))
@purkyston Can you please check this issue?
@aksnzhy ok~
Any conclusion on this? thanks!