如何解决Catboost使用gpu内存,但gpu-util不会增加
我正在使用catboost来解决多类分类。
当我使用catboost拟合模型时,gpu util不会增加。但是我的gpu内存使用率显然上升了。
我发现我的模型适合使用cpu,因为与gpu运行时的colab显示训练时间短得多。
我的gpu比colab更好。
我附上代码和nvidia-smi结果。
model = CatBoostClassifier(
custom_metric=['TotalF1'],random_seed=42,logging_level='Silent',task_type='GPU'
)
get_gpu_device_count()
3
model.fit(
X_train,y_train,cat_features=categorical_features_indices,eval_set=(X_validation,y_validation),logging_level='Verbose',# you can uncomment this for text output
plot=True
);
Warning: less than 75% gpu memory available for training. Free: 23583.5625 Total: 32480.5
Warning: less than 75% gpu memory available for training. Free: 5569.5625 Total: 32480.5
0: learn: 0.9920891 test: 0.9923071 best: 0.9923071 (0) total: 2.54s remaining: 42m 15s
1: learn: 0.9280651 test: 0.9282007 best: 0.9282007 (1) total: 5.01s remaining: 41m 40s
2: learn: 0.8778390 test: 0.8781491 best: 0.8781491 (2) total: 7.45s remaining: 41m 15s
3: learn: 0.8469168 test: 0.8473046 best: 0.8473046 (3) total: 9.9s remaining: 41m 5s
....
请忽略其他用户正在使用的GPU设备1和2。我确定当我适合我的模型时,内核会尝试使用设备0。如您所见,gpu devcie 0不会显示gpu-util。当我杀死catboost内核时,gpu的内存使用量会归零。当我拟合模型时,只会增加gpu内存使用率,而gpu util不会增加。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。