MilaNLProc / contextualized-topic-models

A python package to run contextualized topic modeling. CTMs combine contextualized embeddings (e.g., BERT) with topic models to get coherent topics. Published at EACL and ACL 2021 (Bianchi et al.).
MIT License
1.2k stars 145 forks source link

Parallel GPU training #6

Open james-daily opened 4 years ago

james-daily commented 4 years ago

Is parallel GPU training support possible? We would like to try this with a fairly large (multi-GB) dataset, but to make training time reasonable it would need to be done in parallel. Single node parallelism with DataParallel() would probably work for our use case, although the PyTorch documentation suggests that DistributedDataParallel() is preferred even for a single node.

Part of the motivation for this is that a large dataset needs a lot of memory, which in a cloud environment means a large, multi-GPU instance. It is very expensive to run such a large instance for weeks with all but one of the GPUs idle.

vinid commented 4 years ago

Hi!

Currently, we do not support parallel GPU training, I'm sorry. DataParallel shouldn't be too difficult to setup, but I have to explore better the thing since I do not have much experience in writing multi-gpus pytorch programs.

I'll give it a try next week, and see if (and how) it works.