Skip to content
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

[python-package] Using sparse features with CUDA is currently not supported. #6631

Open
OrangeAoo opened this issue Aug 30, 2024 · 1 comment

Comments

@OrangeAoo
Copy link

Description

I got the following warnings when setting device_type='cuda'

 [Warning] Using sparse features with CUDA is currently not supported.
 [Fatal] CUDA Tree Learner was not enabled in this build.
Please recompile with CMake option -DUSE_CUDA=1

Reproducible example

## Train-test split 
# X_train.shape==(18840083, 3), y_train.shape==(18840083,1)
# X_val.shape==(2379462, 3), y_val.shape==(2379462, 1)

## parameters 
params = {
    'learning_rate': 0.01,
    'metric':'mse',
    'max_bin':63,
    'max_depth':15,
    'num_leaves':10000,
    'gpu_use_dp':True,
    'n_estimators':750,
    'tree_type':'data_parallel',
    'device_type':'cuda',
    'n_jobs':-1,
    'verbose':1
}

## Train 
start=time.time()
LGBmodel = lgb.LGBMRegressor(**params)
LGBmodel.fit(X_train,y_train,eval_set=[(X_val,y_val)])  
print(f"Training LGBoost completed in {time.time()-start:.4f} seconds!")
@jameslamb
Copy link
Collaborator

Thanks for using LightGBM.

That warning is expected, but the error means you haven't installed a CUDA-enabled build of LightGBM. To install a CUDA-enabled build of LightGBM, follow the instructions in the docs:

@jameslamb jameslamb changed the title Using sparse features with CUDA is currently not supported. [python-package] Using sparse features with CUDA is currently not supported. Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants