Vidar Ingason
08/20/2024, 10:40 AMError in `httr2::req_perform()`:
! Failed to perform HTTP request.
Caused by error in `curl::curl_fetch_memory()`:
! Timeout was reached: [<http://dashboard.nixtla.io|dashboard.nixtla.io>] SSL/TLS connection timeout
The dataset is 462.000 rows and around 11.000 time series.
I've seen blog posts by someone from the team and you talk about forecasting millions of time series using TimeGPT. I always seem to have trouble with dataset of several thousands time series.Vidar Ingason
08/20/2024, 11:08 AMMariana Menchero
08/20/2024, 7:21 PMVidar Ingason
08/20/2024, 7:39 PMMariana Menchero
08/20/2024, 7:46 PMVidar Ingason
08/20/2024, 8:02 PMMariana Menchero
08/23/2024, 7:09 AMnixtlar
. It should be ready early next week. As soon as it has been merged to main, I'll let you know here. Regards.Vidar Ingason
08/23/2024, 8:36 AMMariana Menchero
08/23/2024, 8:57 PMVidar Ingason
08/28/2024, 10:21 AMMariana Menchero
08/28/2024, 11:22 PMVidar Ingason
08/29/2024, 9:57 AMnum_partitions
argument. If I do not use the argument then everything runs fine.Vidar Ingason
08/29/2024, 9:03 PMnixtla_set_api_key
somehow within future_lapply?Vidar Ingason
08/29/2024, 9:10 PMrun_parallel_forecasts <- function(data_tbl, M, h = 12, id_col = "unique_id", time_col = "ds", target_col = "y") {
# Split the data into M partitions
unique_ids <- unique(data_tbl[[id_col]])
ids_per_partition <- ceiling(length(unique_ids) / M)
split_ids <- split(unique_ids, rep(1:M, each = ids_per_partition, length.out = length(unique_ids)))
# Define a helper function to filter the data based on unique IDs
filter_data <- function(ids, data) {
data %>% filter(!!sym(id_col) %in% ids)
}
# Plan for parallel processing
plan(multisession)
# Run the forecasts in parallel
forecasts <- future_lapply(split_ids, function(ids) {
# Ensure the API key is set inside each worker
nixtla_set_api_key(Sys.getenv("TIMEGPT")) # <- ONLY WORKS IF I ADD THIS TO MY CODE
partition_data <- filter_data(ids, data_tbl)
nixtla_client_forecast(
df = partition_data,
h = h,
id_col = id_col,
time_col = time_col,
target_col = target_col
)
})
# Combine the results into a single data frame
result <- bind_rows(forecasts)
return(result)
}
I get the same error with my code above unless include nixtla_set_api_key
within future_lapply
Mariana Menchero
08/29/2024, 9:29 PMMariana Menchero
08/29/2024, 9:30 PMMariana Menchero
08/29/2024, 9:30 PMVidar Ingason
08/29/2024, 9:37 PMMariana Menchero
08/29/2024, 9:42 PMVidar Ingason
08/30/2024, 12:41 PMError in getGlobalsAndPackages(expr, envir = envir, globals = globals) :
The total size of the 4 globals exported for future expression ('FUN()') is 12.31 GiB.. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). The three largest globals are 'FUN' (12.31 GiB of class 'function'), '.get_api_key' (1.96 KiB of class 'function') and '.transient_errors' (1.30 KiB of class 'function')
Should I set it to some high value like:
options(future.globals.maxSize = 20 * 1024^3)
Or is there a better way to avoid this error?Vidar Ingason
08/30/2024, 3:04 PM