Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generate_text.sh Megatron text-generation example working w/ DS inference #99

Merged
merged 3 commits into from
Dec 7, 2022

Conversation

lekurile
Copy link

@lekurile lekurile commented Dec 5, 2022

This PR gets text-generation working in the examples/generate_text.sh example working w/ DS inference enabled. For the main fix, the sample_sequence_batch function has been updated to perform the softmax when calculating log_probs, instead of setting it to 1's using torch.ones_like(...), although a few minor fixes were applied as well. Extra whitespace is also removed.

Currently, the examples/generate_text.sh example produces the same nonsensical output irrespective of input context or whether DS inference is enabled or not:

Oz jewelry Hod BombCook hiber csivalry Consumptionysics discipline wholesale aversionwic authoritativeduct...

This PR gets the example working w/o DS inference, e.g.:

Context: Hiking in nature is

Megatron-LM:  a far cry from schooldays, when a mountaineer would rely on...

In conjunction with PR #2579 in the DeepSpeed repo, the example also works w/ DS inference enabled e.g.:

Context: Hiking in nature is

Megatron-LM:  a far cry from schooldays, when a mountaineer would rely on...
Context: The engine of a car

Megatron-LM:  , after the oil is drained, oil is piped out of the engine...

@lekurile lekurile marked this pull request as ready for review December 7, 2022 01:14
@lekurile lekurile changed the title Get text-gen w/o DS working as a baseline Fix generate_text.sh Megatron text-generation example working w/ DS inference Dec 7, 2022
Copy link

@RezaYazdaniAminabadi RezaYazdaniAminabadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants