Code Monkey home page Code Monkey logo

distributed-pipeline's Introduction

Pytorch pipeline with torch.distributed

utils.trainer.TrainLoop will run training loop - compatible with torch.distributed.run

All you need to do

  • Complete config/train.py's TrainSettings(or YourSettings) class.
    • this setting class is compatible with argparse and json.
  • Complete data/__init__.py's load_data_from_args function.
  • Complete model package.
  • Complete utils/initialization.py's create_model_from_config function.
  • Complete some method of utils/trainer.py's TrainLoop class.
    • log_loss_dict method: logging function of loss values dict.
    • compute_losses method: calculate losses from micro_batch and TrainLoop vars
    • backward_from_losses method: make single loss from losses, and run loss.backward()
    • __init__ method: add your extra values to TrainLoop vars if needed.
  • Complete run/train.py to make sense with all code signatures you modified.
  • Modify setting json file, after copying default train settings with command,
    python3 -c "from config;train import TrainSettings as T; print(T.json(indent=2))" >> train_config.json
    

How to run

after completion, you can run train script with

python3 -m run.train --distributed --config_json train_config.json

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.