Skip to content

[BUG] Module names GPT2ModelPipe & ParallelTransformerLayerPipe is hardcoded in deepspeed #1347

Description

@DanielHesslow

In multiple places in the deepspeed code there exist hardcoded checks such as:
if self.module.__class__.__name__ == 'GPT2ModelPipe':
or
all('ParallelTransformerLayerPipe' in f.__class__.__name__ for f in funcs)
In order to make the examples work.

This means that it is not possible to integrate deepspeed into an existing codebase by looking at the examples or documentation, one needs to thoroughly read the deepspeed code and then name the modules exactly as stated above to get the desired behavior.
To my knowledge this peculiarity is not documented anywhere.

This has been previously noted for checkpointing here: #688

But it is also necessary in order to send the boolean attention masks across pipeline stages. If one attempts to send the attention masks as described in the tutorial but having the wrong module name, deepspeed will deadlock on the backward pass. I believe this is due to NACL not correctly handing boolean tensor but such workaround should happen in deepspeed, or in the very least there should be warnings.

This should either be clearly documented, especially in the examples, or better yet, fixed.

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions