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

Transformer API新增参数,导致不兼容问题 #62860

Closed
ZHUI opened this issue Mar 19, 2024 · 1 comment
Closed

Transformer API新增参数,导致不兼容问题 #62860

ZHUI opened this issue Mar 19, 2024 · 1 comment
Assignees
Labels

Comments

@ZHUI
Copy link
Collaborator

ZHUI commented Mar 19, 2024

bug描述 Describe the Bug

#60084 此PR新增了layer_norm_eps参数,对于PaddleNLP重载了这个TransformerLayer的模型,之前没有这个参数,会报错。

https://github.com/PaddlePaddle/PaddleNLP/blob/99802de4ee334864453fd55bf35c2a5ab279aacb/paddlenlp/transformers/blenderbot_small/modeling.py#L111-L141

(base) root@bddwd-inf-hic-k8s-a100-a12ni6-0070.bddwd.baidu.com PaddleNLP $ NVIDIA_TF32_OVERRIDE=0 FLAGS_cudnn_deterministic=1 python3.10 -m pytest -svv tests/transformers/blenderbot_small/test_modeling.py::BlenderbotSmallModelTest::test_causal_lm_model
============================================================================== test session starts ==============================================================================
platform linux -- Python 3.10.10, pytest-7.2.2, pluggy-1.0.0 -- /usr/bin/python3.10
cachedir: .pytest_cache
rootdir: /root/paddlejob/workspace/env_run/zhonghui03/CI/PaddleNLP, configfile: pyproject.toml
plugins: xdist-3.5.0, anyio-4.3.0, timeout-2.3.1, cov-4.1.0
collected 1 item                                                                                                                                                                

tests/transformers/blenderbot_small/test_modeling.py::BlenderbotSmallModelTest::test_causal_lm_model W0319 20:24:36.310734 26640 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.0, Driver API Version: 12.0, Runtime API Version: 11.8
W0319 20:24:36.338734 26640 gpu_resources.cc:164] device: 0, cuDNN Version: 8.6.
FAILED

=================================================================================== FAILURES ====================================================================================
_________________________________________________________________ BlenderbotSmallModelTest.test_causal_lm_model _________________________________________________________________

self = <tests.transformers.blenderbot_small.test_modeling.BlenderbotSmallModelTest testMethod=test_causal_lm_model>

    def test_causal_lm_model(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
>       self.model_tester.create_and_check_causal_lm_model(*config_and_inputs)

tests/transformers/blenderbot_small/test_modeling.py:202: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/transformers/blenderbot_small/test_modeling.py:168: in create_and_check_causal_lm_model
    model = BlenderbotSmallForCausalLM(config)
paddlenlp/transformers/utils.py:256: in __impl__
    init_func(self, *args, **kwargs)
paddlenlp/transformers/blenderbot_small/modeling.py:651: in __init__
    self.blenderbot_small = BlenderbotSmallModel(config)
paddlenlp/transformers/utils.py:256: in __impl__
    init_func(self, *args, **kwargs)
paddlenlp/transformers/blenderbot_small/modeling.py:397: in __init__
    self.decoder = BlenderbotSmallDecoder(config, embed_tokens=self.shared)
paddlenlp/transformers/utils.py:256: in __impl__
    init_func(self, *args, **kwargs)
paddlenlp/transformers/blenderbot_small/modeling.py:322: in __init__
    self.decoder = TransformerDecoder(decoder_layer=decoder_layer, num_layers=config.num_decoder_layers)
paddlenlp/transformers/blenderbot_small/modeling.py:194: in __init__
    super(TransformerDecoder, self).__init__(decoder_layer=decoder_layer, num_layers=num_layers, norm=norm)
paddlenlp/transformers/model_outputs.py:65: in _impl
    func(self, *args, **kwargs)
/usr/local/lib/python3.10/dist-packages/paddle/nn/layer/transformer.py:1060: in __init__
    [
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

.0 = <range_iterator object at 0x7fcc45ffb0c0>

        [
            (
                decoder_layer
                if i == 0
>               else type(decoder_layer)(**decoder_layer._config)
            )
            for i in range(num_layers)
        ]
    )
E   TypeError: BlenderbotSmallDecoderLayer.__init__() got an unexpected keyword argument 'layer_norm_eps'

/usr/local/lib/python3.10/dist-packages/paddle/nn/layer/transformer.py:1064: TypeError
============================================================================ short test summary info ============================================================================
FAILED tests/transformers/blenderbot_small/test_modeling.py::BlenderbotSmallModelTest::test_causal_lm_model - TypeError: BlenderbotSmallDecoderLayer.__init__() got an unexpected keyword argument 'layer_norm_eps'
=============================================================================== 1 failed in 6.79s ===============================================================================
(base) root@bddwd-inf-hic-k8s-a100-a12ni6-0070.bddwd.baidu.com PaddleNLP $ 

其他补充信息 Additional Supplementary Information

No response

DesmonDay pushed a commit to PaddlePaddle/PaddleNLP that referenced this issue Mar 19, 2024
@ZHUI
Copy link
Collaborator Author

ZHUI commented Mar 19, 2024

Fix in PaddlePaddle/PaddleNLP#8150

DesmonDay pushed a commit to PaddlePaddle/PaddleNLP that referenced this issue Mar 20, 2024
    Merge remote-tracking branch 'origin/develop' into bugfix/sample_generate
    Update Makefile
    Update Makefile
    remove paddle as require.
    fix  PaddlePaddle/Paddle#62860
    fix test_sample_generate bug.
@paddle-bot paddle-bot bot added status/close 已关闭 and removed status/new-issue 新建 labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants