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

Revised PoSE #8822

Merged
merged 31 commits into from
Nov 21, 2024
Merged

Revised PoSE #8822

merged 31 commits into from
Nov 21, 2024

Conversation

whf313
Copy link
Contributor

@whf313 whf313 commented Jul 29, 2024

PR types

PR changes

Description

Pose + Yarn Algorithm

Copy link

paddle-bot bot commented Jul 29, 2024

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Jul 29, 2024

CLA assistant check
All committers have signed the CLA.

model_config.long_sequence_init_args = {
"dim": int(model_config.hidden_size / model_config.num_attention_heads),
"max_position_embeddings": data_args.scaled_max_length, # extended context window
"base": 10000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base建议从model config中读取

if ptq_ds is not None
else None
)
train_ds = train_ds.map(partial(trans_func)) if train_ds is not None else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恢复一下这块,不改变原生代码的逻辑

return features


def test_preprocess_function(example, tokenizer, inference_length):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数没用的话删除

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 85.24590% with 9 lines in your changes missing coverage. Please review.

Project coverage is 52.91%. Comparing base (d5a90f7) to head (0d11641).
Report is 231 commits behind head on develop.

Files with missing lines Patch % Lines
...s/long_sequence_strategies/embedding_strategies.py 85.24% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8822      +/-   ##
===========================================
+ Coverage    52.81%   52.91%   +0.10%     
===========================================
  Files          677      679       +2     
  Lines       107943   108403     +460     
===========================================
+ Hits         57010    57365     +355     
- Misses       50933    51038     +105     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

from utils.data import convert_example_common

trans_func = partial(convert_example_common, tokenizer=tokenizer, data_args=data_args)
else:
trans_func = partial(get_convert_example(model), tokenizer=tokenizer, data_args=data_args)

if data_args.zero_padding:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除这段

if dev_ds is not None
else None
)
dev_ds = dev_ds.map(partial(trans_func)) if dev_ds is not None else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?为什么修改这段

rope_scaling_type: str = field(default=None, metadata={"help": "Rope extension strategy"})
rope_scaling_factor: float = field(default=None, metadata={"help": "Rope extension scaling factor"})
strategy_type: str = field(default=None, metadata={"help": "Long sequence strategy type"})
strategy_name: str = field(default=None, metadata={"help": "Long sequence strategy name"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


def get_example_pose(example, tokenizer, data_args):
if "src" in example:
source = example["src"]
Copy link
Contributor

@lugimzzz lugimzzz Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以和写longlora的同学https://github.com/PaddlePaddle/PaddleNLP/pull/8798/files

一起商量一下你们的数据格式到底叫src还是text,并且可以把get_example_pose写成tokenize_autogressive函数里一个分支if pose:return get_example_pose()
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@lugimzzz
Copy link
Contributor

image
image
PaddleNLP-CI 有报错看一下

@lugimzzz
Copy link
Contributor

image
license签署

Copy link
Contributor

@lugimzzz lugimzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lugimzzz lugimzzz merged commit 6813e40 into PaddlePaddle:develop Nov 21, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants