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

Conversation

okoge-kaz
Copy link

What is the issue

I have found that if you are using TransformerEngine v1.10 or later, CUDA error: initialization error will occur in the following location in saver_mcore.py.

models[pp_rank][ep_rank][tp_rank] = model_provider(pre_process, post_process).to(md.params_dtype)

If the version of TransformerEngine is 1.10 or later, torch.cuda.Stream() is called in the following places. This causes an initialization error.

if is_te_min_version("1.10.0.dev0"):
context, sync_func = _get_cpu_offload_context(
enabled, num_layers, model_layers, activation_offloading, weight_offloading
)

https://github.com/NVIDIA/TransformerEngine/blob/c9ea6be92948e1ec553037f1a04900617b9f7f6b/transformer_engine/pytorch/cpu_offload.py#L314-L315

How to solve the issue

Add mp.set_start_method(method='spawn') and torch.cuda.init()

@okoge-kaz okoge-kaz closed this by deleting the head repository Feb 5, 2025
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.

1 participant