You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to fit CTGANSynthesizer or CopulaGANSynthesizer in Google Colab with a T4 (GPU) runtime, the following warning is displayed the first time only:
/usr/local/lib/python3.10/dist-packages/torch/autograd/graph.py:744: UserWarning: Attempting to run cuBLAS, but there was no current CUDA context! Attempting to set the primary context... (Triggered internally at ../aten/src/ATen/cuda/CublasHandlePool.cpp:135.)
return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
We've ruled out CUDA not being available by running torch.cuda.is_available(), which returns True.
This warning might be displayed because the CUDA state / context isn't initialized. But we do end up initializing the CUDA context in our code somewhere (which is why running it twice doesn't throw this warning).
So the warning is technically true, but is confusing to users because they may think that the GPU isn't being used.
Steps to reproduce
To reproduce warning, change the Colab runtime to T4 (Runtime > Change runtime type, from Colab menu bar) then run this code:
from sdv.datasets.demo import download_demo
from sdv.single_table import CTGANSynthesizer
data, metadata = download_demo(
modality='single_table',
dataset_name='fake_hotel_guests'
)
c = CTGANSynthesizer(metadata, cuda=True)
c.fit(data)
To reproduce CopulaGANSynthesizer, delete / restart your runtime:
from sdv.datasets.demo import download_demo
from sdv.single_table import CopulaGANynthesizer
data, metadata = download_demo(
modality='single_table',
dataset_name='fake_hotel_guests'
)
c = CopulaGANynthesizer(metadata, cuda=True)
c.fit(data)
srinify
changed the title
UserWarning when using CTGAN caused by potentially uninitialized CUDA context
UserWarning when using CTGAN is confusing
Jun 11, 2024
srinify
changed the title
UserWarning when using CTGAN is confusing
Confusing warning raised when using CTGAN suggests that CUDA isn't being used
Jun 11, 2024
srinify
changed the title
Confusing warning raised when using CTGAN suggests that CUDA isn't being used
Confusing warning raised when using CTGAN or CopulaGAN suggests that CUDA isn't being used
Jun 11, 2024
srinify
changed the title
Confusing warning raised when using CTGAN or CopulaGAN suggests that CUDA isn't being used
Confusing warning raised when using GANs that suggests that CUDA isn't being used
Jun 11, 2024
srinify
changed the title
Confusing warning raised when using GANs that suggests that CUDA isn't being used
Confusing warning when using GANs that suggests that CUDA isn't being used
Jun 11, 2024
Environment Details
Warning
If you try to fit CTGANSynthesizer or CopulaGANSynthesizer in Google Colab with a T4 (GPU) runtime, the following warning is displayed the first time only:
torch.cuda.is_available()
, which returnsTrue
.So the warning is technically true, but is confusing to users because they may think that the GPU isn't being used.
Steps to reproduce
To reproduce warning, change the Colab runtime to T4 (Runtime > Change runtime type, from Colab menu bar) then run this code:
To reproduce CopulaGANSynthesizer, delete / restart your runtime:
Internal Colab Notebook
The text was updated successfully, but these errors were encountered: