Skip to content

Setting num_threads for lightgbm seems broken #105

Description

@hoangtt1989

It seems like the function process_parallelism sets the num_threads argument to NULL if there is a non-NULL input. This causes train_lightgbm to default to all available cores.

process_parallelism <- function(args) {
  if (!is.null(args["num_threads"])) {
    args$num_threads <- args[names(args) == "num_threads"]
    args[names(args) == "num_threads"] <- NULL
  }

  args
}

test_arg <- list(num_threads = 2)
process_arg <- process_parallelism(test_arg)
process_arg
# named list()

Metadata

Metadata

Assignees

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions