wrong args for environment subassignment
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
Start with the _targets.R example, process_chunks(), and the MulticoreParam/bplapply() call, then run tar_make() under the shown memory limits. Trace how the failure is reported after the parallel workers exit; done means the OOM case produces a meaningful memory-related error instead of wrong args for environment subassignment.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi,
I had the following error when trying to use MulticoreParam with R targets pipeline. Debugging doesn't reproduce the error. I later figured out it was OOM as it needed more than 2GB to process the data on HPC, while my local R session used to debug had more than 20GB memory allocations.
It would be ideal the print the more meaningful error message.
# _targets.R
library(targets)
library(crew)
library(crew.cluster)
library(BiocParallel)
controller_default <- crew_controller_slurm(
name = "slurm_default",
workers = 4,
seconds_idle = 30,
slurm_memory_gigabytes_per_cpu = 2,
slurm_cpus_per_task = 4
)
tar_option_set(
controller = controller_default,
resources = tar_resources(
crew = tar_resources_crew(controller = "slurm_default")
)
)
process_chunks <- function() {
cores <- as.numeric(Sys.getenv("SLURM_CPUS_PER_TASK", unset = 1)) - 1L
if (nzchar(Sys.getenv("_R_CHECK_LIMIT_CORES_")))
cores <- min(cores, 2L)
bp <- MulticoreParam(workers = cores, progressbar = TRUE)
bplapply(
seq_len(cores + 1L),
FUN = function(i) {
message(sprintf("[bpworker PID %d] task %d: allocating ~4 GB",
Sys.getpid(), i))
n <- as.integer(2000 * 1024^2 / 8)
x <- rnorm(n)
y <- rnorm(n)
sum(x * y)
},
BPPARAM = bp
)
}
# ── pipeline ──────────────────────────────────────────────────────────────────
list(
tar_target(
oom_bp,
process_chunks() # crew worker (2 GB) + forked bplapply children → OOM
)
)
> library(targets)
> tar_make(store = "~", script = "~/_targets.R")
+ oom_bp dispatched
✖ oom_bp errored
✖ errored pipeline [50.9s, 0 completed, 0 skipped]
Warning messages:
1: script_lines was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument.
2: slurm_memory_gigabytes_per_cpu was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument.
3: slurm_cpus_per_task was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument.
4: 1 targets produced warnings. Run targets::tar_meta(fields = warnings, complete_only = TRUE) for the messages.
Error:
! Error in tar_make():
wrong args for environment subassignment
See https://books.ropensci.org/targets/debugging.html
Debug:
> tar_workspace(oom_bp, store = "~", script = "~/_targets.R")
Warning messages:
1: In readLines(script) : incomplete final line found on '~/_targets.R'
2: slurm_memory_gigabytes_per_cpu was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument.
3: slurm_cpus_per_task was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument.
> process_chunks()
| | 0%
[bpworker PID 1690242] task 4: allocating ~4 GB
|================ | 12%
[bpworker PID 1690239] task 1: allocating ~4 GB
|================================ | 25%
[bpworker PID 1690240] task 2: allocating ~4 GB
|================================================ | 38%
[bpworker PID 1690245] task 7: allocating ~4 GB
|================================================================ | 50%
[bpworker PID 1690241] task 3: allocating ~4 GB
|=============================================================================== | 62%
[bpworker PID 1690244] task 6: allocating ~4 GB
|=============================================================================================== | 75%
[bpworker PID 1690243] task 5: allocating ~4 GB
|=============================================================================================================== | 88%
[bpworker PID 1690270] task 8: allocating ~4 GB
|===============================================================================================================================| 100%
[[1]]
[1] 4439.251
[[2]]
[1] 14078.1
[[3]]
[1] -2978.421
[[4]]
[1] -35503.84
[[5]]
[1] -7880.825
[[6]]
[1] -3674.885
[[7]]
[1] 9433.41
[[8]]
[1] -9041.888
- Ngôn ngữ chính
- R
- Star
- 69
- Fork
- 32
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Bioconductor/BiocParallel
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
Bioconductor/BiocParallel#286 · 1 bình luận ·
-
Bioconductor/BiocParallel#284 · 2 bình luận · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Bioconductor/BiocParallel#283 · 2 bình luận ·
-
DoparParam: Captured stdout is relayed to stdout for some foreach adapters and stderr for others Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Bioconductor/BiocParallel#277 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Bioconductor/BiocParallel#276 ·
Tất cả issue của Bioconductor/BiocParallel
Issue tương tự
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 78/100
ThinkR-open/datadiff#59 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tidymodels/parsnip#1444 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
priority: should UX
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100