NVIDIA / Megatron-LM

Ongoing research training transformer models at scale
https://docs.nvidia.com/megatron-core/developer-guide/latest/user-guide/index.html#quick-start
Other
9.93k stars 2.24k forks source link

TypeError: get_cpu_offload_context() takes from 0 to 4 positional arguments but 5 were given #1018

Open ben-8878 opened 3 weeks ago

ben-8878 commented 3 weeks ago

te_version: 1.9.0+e79d915

Traceback (most recent call last):
  File "/home/ybZhang/miniconda3/envs/glm-m/lib/python3.8/site-packages/swift/cli/export.py", line 5, in <module>
    export_main()
  File "/home/ybZhang/miniconda3/envs/glm-m/lib/python3.8/site-packages/swift/utils/run_utils.py", line 32, in x_main
    result = llm_x(args, **kwargs)
  File "/home/ybZhang/miniconda3/envs/glm-m/lib/python3.8/site-packages/swift/llm/export.py", line 302, in llm_export
    convert_hf_to_megatron(model, extra_args, args.torch_dtype)
  File "/home/ybZhang/miniconda3/envs/glm-m/lib/python3.8/site-packages/swift/llm/megatron/convert.py", line 22, in convert_hf_to_megatron
    mg_model = model_provider()
  File "/home/ybZhang/miniconda3/envs/glm-m/lib/python3.8/site-packages/swift/llm/megatron/model.py", line 61, in model_provider
    model = gpt_model_cls(
  File "./Pai-Megatron-Patch/megatron_patch/model/qwen2/model.py", line 103, in __init__
    self.decoder = TransformerBlock(
  File "./Pai-Megatron-Patch/megatron_patch/model/qwen2/transformer_block.py", line 137, in __init__
    ) = get_cpu_offload_context(
  File "./Megatron-LM/megatron/core/transformer/custom_layers/transformer_engine.py", line 899, in get_cpu_offload_context
    context, sync_func = _get_cpu_offload_context(
TypeError: get_cpu_offload_context() takes from 0 to 4 positional arguments but 5 were given
1195343015 commented 3 weeks ago

PR #996