Code Monkey home page Code Monkey logo

Comments (6)

ZikangZhou avatar ZikangZhou commented on June 15, 2024

This repo uses pytorch-lightning as the trainer. It's convenient to do single-gpu or multi-gpu training by simply setting the gpu number:

python train.py --root /path/to/dataset_root/ --embed_dim 128 --gpus #YOUR_GPU_NUM

If I remember correctly, by default this will use Pytorch DDP Spawn strategy for multi-gpu training. If you want to use Pytorch DDP instead (which should be faster than DDP Spawn in general), you can add one line to train.py:

parser.add_argument('--strategy', type=str, default='ddp')

Let me know if it works.

from hivt.

ZikangZhou avatar ZikangZhou commented on June 15, 2024

@yumianhuli2 To reproduce the results in the paper when using multi-gpu training, please also make sure that the effective batch size (batch_size * gpu_num) is 32. For example, if you use 4 gpus, then the batch size per gpu should be 8:

python train.py --root /path/to/dataset_root/ --embed_dim 128 --gpus 4 --train_batch_size 8

from hivt.

yumianhuli2 avatar yumianhuli2 commented on June 15, 2024

Thank you!

from hivt.

tandangzuoren avatar tandangzuoren commented on June 15, 2024

Thank you for your outstanding work!If the batchsize is changed, does the learning rate need to be adjusted accordingly?

from hivt.

ZikangZhou avatar ZikangZhou commented on June 15, 2024

@tandangzuoren I believe the learning rate should be adjusted. The number of epochs may also need to be changed.

from hivt.

tteokl avatar tteokl commented on June 15, 2024

@ZikangZhou Thank you for your advice on this. May I know why 32 is the effective batch size?

from hivt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.