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

[Bug]: cannot import name 'switch_rng_state_tracker' from 'paddle.distributed.fleet.recompute.recompute' #9564

Open
1 task done
moyanxinxu opened this issue Dec 4, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@moyanxinxu
Copy link

软件环境

paddle2onnx               1.3.1
paddlefsl                 1.1.0
paddlenlp                 2.8.1
paddlepaddle              2.6.2
paddlepaddle-gpu          2.6.2

重复问题

  • I have searched the existing issues

错误描述

https://github.com/PaddlePaddle/PaddleNLP/blob/a5ec6bf623ce8e68ce84e0620d1e195072b25643/paddlenlp/transformers/refined_recompute.py#L33


这个代码好像写错了

应该是
from paddle.distributed.fleet.recompute.recompute import swith_rng_state_tracker
而不是
from paddle.distributed.fleet.recompute.recompute import switch_rng_state_tracker

稳定复现步骤 & 代码

from paddlenlp import Taskflow

导包即错误

@moyanxinxu moyanxinxu added the bug Something isn't working label Dec 4, 2024
@DesmonDay
Copy link
Contributor

有报错信息么?我看了下代码这个写法是正确的

@yes-github
Copy link

Z:>paddlespeech tts --input "你好,欢迎使用百度飞桨深度学习框架!" --output output.wav
C:\ProgramData\Anaconda3\lib\site-packages\paramiko\transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,
C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages_distutils_hack_init_.py:36: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 197, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\Scripts\paddlespeech.exe_main
.py", line 7, in
File "C:\ProgramData\Anaconda3\lib\site-packages\paddlespeech\cli\entry.py", line 40, in execute
exec("from {} import {}".format(module, cls))
File "", line 1, in
File "C:\ProgramData\Anaconda3\lib\site-packages\paddlespeech\cli\tts_init
.py", line 14, in
from .infer import TTSExecutor
File "C:\ProgramData\Anaconda3\lib\site-packages\paddlespeech\cli\tts\infer.py", line 33, in
from paddlespeech.t2s.exps.syn_utils import get_am_inference
File "C:\ProgramData\Anaconda3\lib\site-packages\paddlespeech\t2s\exps\syn_utils.py", line 35, in
from paddlespeech.t2s.frontend.mix_frontend import MixFrontend
File "C:\ProgramData\Anaconda3\lib\site-packages\paddlespeech\t2s\frontend\mix_frontend.py", line 22, in
from paddlespeech.t2s.frontend.zh_frontend import Frontend
File "C:\ProgramData\Anaconda3\lib\site-packages\paddlespeech\t2s\frontend\zh_frontend.py", line 31, in
from paddlespeech.t2s.frontend.g2pw import G2PWOnnxConverter
File "C:\ProgramData\Anaconda3\lib\site-packages\paddlespeech\t2s\frontend\g2pw_init
.py", line 1, in
from .onnx_api import G2PWOnnxConverter
File "C:\ProgramData\Anaconda3\lib\site-packages\paddlespeech\t2s\frontend\g2pw\onnx_api.py", line 28, in
from paddlenlp.transformers import BertTokenizer
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp_init.py", line 46, in
from . import (
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp\data_init_.py", line 18, in
from .data_collator import *
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp\data\data_collator.py", line 26, in
from ..transformers import BertTokenizer
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp\transformers_init_.py", line 99, in
from .deepseek_v2.modeling import *
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp\transformers\deepseek_v2_init_.py", line 17, in
from .tokenizer_fast import *
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp\transformers\deepseek_v2\tokenizer_fast.py", line 16, in
from ..llama import LlamaTokenizerFast
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp\transformers\llama_init_.py", line 16, in
from .modeling import *
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp\transformers\llama\modeling.py", line 33, in
from paddlenlp.transformers.refined_recompute import (
File "C:\Users\Yes\AppData\Roaming\Python\Python39\site-packages\paddlenlp\transformers\refined_recompute.py", line 33, in
from paddle.distributed.fleet.recompute.recompute import switch_rng_state_tracker
ImportError: cannot import name 'switch_rng_state_tracker' from 'paddle.distributed.fleet.recompute.recompute' (C:\ProgramData\Anaconda3\lib\site-packages\paddle\distributed\fleet\recompute\recompute.py)

@moyanxinxu
Copy link
Author

moyanxinxu commented Dec 17, 2024

把源码改成这个swith_rng_state_tracker之后呢 @yes-github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants