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 type annotation and checkpoint conversion script #1344

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion megatron/core/extensions/transformer_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ class TEDelayedScaling(te.common.recipe.DelayedScaling):

def __init__(
self,
config: ModelParallelConfig,
config: TransformerConfig,
fp8_format: int,
override_linear_precision: tuple = (False, False, False),
):
Expand Down
5 changes: 5 additions & 0 deletions tools/checkpoint/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import importlib
import torch
import torch.multiprocessing as mp
import sys

Expand Down Expand Up @@ -107,6 +108,9 @@ def load_plugin(plugin_type, name):
return plugin

def main():
if not torch.cuda.is_initialized():
torch.cuda.init()

import argparse
parser = argparse.ArgumentParser(description="Megatron Checkpoint Converter Arguments",
allow_abbrev=False, conflict_handler='resolve')
Expand Down Expand Up @@ -151,4 +155,5 @@ def main():


if __name__ == '__main__':
mp.set_start_method(method='spawn')
main()