Skip to content

Compatibility with gradient accumulation #426

@quasimik

Description

@quasimik

I'm bringing my own PyTorch training script, and I'm interested in using SM Debugger to profile function calls in my training jobs. The API Glossary states:

Step: Step means one the work done by the training job for one batch (i.e. forward and backward pass).

I assume I will have to register my module with hook.register_module(module) in the training script for SM Debugger to work at all. I further assume that SM Debugger then registers its own hooks into the module's forward() and/or backward() passes to track when a "step" happens.

However, my training script accumulates gradients from several forward() passes before running a single backward() pass.

My questions:

  1. Will this interfere with the functionality of SM Debugger?
  2. Assuming this is okay, does SM Debugger consider the forward() or the backward() pass to be one "step"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions