ValueError from default configuration of joblib Parallel in DataTransformer #260
Labels
bug
Something isn't working
pending review
This issue needs to be further reviewed, so work cannot be started
Problem Description
I encountered a ValueError as I increased the number or rows in my training set and have isolated the issue down to the triggering of the automated memory mapping in the joblib Parallel class which is a dependency of CTGAN. I think the issue is caused by the write permissions on the folder where Parallel is looking by default. The problem is there does not seem to be a way, via CTGAN, to provide additional parameters to the Parallel instance to control how to manage the memory mapping.
ctgan.data_transformer uses Parallel but with only a single fixed parameter, set when the class is instantiated.
CTGAN/ctgan/data_transformer.py
Line 162 in 8bf22ef
For larger datasets, there is a threshold (Parallel default is 1M) on the size of arrays passed to the workers that triggers automated memory mapping in a temp folder. Because there is no way to set initial parameters for Parallel, CTGAN is at the mercy of how this all gets handled by default. This has all worked fine for me on my laptop, but I am now running into errors on Databricks when running my CTGAN model.
Expected behavior
The parallelization of the data transformations in CTGAN is a crucial step. Would it not be better to provide some configuration scope over this important step? I can confirm if I were able to set the Parallel instance, like the example below, then it resolves my original ValueError.
Parallel(n_jobs=-1, temp_folder="/tmp", mmap_mode="r+")(processes)
Additional context
I have also opened an issue (joblib/joblib#1373) in the joblib repo because I think there is some inconsistency, or at least further clarification is required, in the way multiple input parameters work with each other. But that does not change the need for the ability to better configure Parallel in CTGAN.
Environment Details
Please indicate the following details about the environment in which you found the bug:
The text was updated successfully, but these errors were encountered: