Giter Site home page Giter Site logo

Comments (3)

mcarilli avatar mcarilli commented on August 27, 2024 4

Right now, I'd recommend torch.nn.parallel.DistributedDataParallel for all practical purposes. It's pretty darn good (fast and robust).

from apex.

mcarilli avatar mcarilli commented on August 27, 2024 2

apex.parallel.DistributedDataParallel and torch.nn.parallel.DistributedDataParallel have the same purpose. They are model wrappers that automatically take care of gradient allreduces during the backward pass. Their usage is almost identical. The Apex version offers some features that the torch version does not, but we plan to merge Apex features into upstream eventually, so for forward compatibility, you may as well just use the torch version.
apex.parallel.DistributedDataParallel example
torch.nn.parallel.DistributedDataParallel example (note the slightly different constructor arguments)
FP16_Optimizer happens to be used in these examples, but its presence is unrelated to the DistributedDataParallel wrappers. You can ignore it.

torch.distributed.launch is a wrapper script intended to spawn multiple processes, and supply them with the arguments and the environment necessary to set up distributed training within each process. torch.distributed.launch can be used with either apex.parallel.DistributedDataParallel or torch.nn.parallel.DistributedDataParallel.

from apex.

gbrow004 avatar gbrow004 commented on August 27, 2024

I understand that they both have the same purposes, but are there any potential/theoretical advantages to using the apex vs torch, aside from extra options? Performance/speed?

from apex.

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.