-
Notifications
You must be signed in to change notification settings - Fork 109
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
GPT2 #205
Merged
Merged
GPT2 #205
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
79cba67
Add gpt2 model
KungYork 4493c81
Add gpt2 test case in test_conf.py
KungYork df0b1fe
refine README and python files
KungYork 0f6dfbc
Remove redundant codes and re-organize denpendency
KungYork ec4e220
remove redundancy files
KungYork b58eed2
refine gpt_dataset
KungYork 7797bcb
"Refine traing job"
KungYork d4972e2
Refine README
KungYork 837c313
fix typo in README.md
KungYork 6c7f8eb
Update README.md
KungYork 5a3f123
Add config for 1x1 2x8
KungYork 5672f50
Update README.md 1x1 config
KungYork f9bcb2c
Update README.md
KungYork File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refine README and python files
- Loading branch information
commit df0b1fede37a0b306a81482089c9b4521cfdf354
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import torch | ||
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification | ||
|
||
tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased") | ||
model = DistilBertForSequenceClassification.from_pretrained("distilbert-base-uncased") | ||
|
||
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt") | ||
with torch.no_grad(): | ||
logits = model(**inputs).logits | ||
|
||
predicted_class_id = logits.argmax().item() | ||
model.config.id2label[predicted_class_id] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
| 指标名称 | 指标值 | 特殊说明 | | ||
| -------------- | ----------------------- | ------------------------------------------- | | ||
| 任务类别 | 自然语言编码 | | | ||
| 模型 | bert-large-uncased | | | ||
| 模型 | megatron-gpt2-345m | | | ||
| 数据集 | Wikipedia | | | ||
| 数据精度 | precision,见“性能指标” | 可选fp32/amp/fp16 | | ||
| 超参修改 | fix_hp,见“性能指标” | 跑满硬件设备评测吞吐量所需特殊超参 | | ||
|
@@ -38,4 +38,4 @@ | |
|
||
| 配置 | precision | fix_hp | e2e_time | p_whole | p_train | p_core | lambada_acc | mem | | ||
| ------------------- | --------- | ---------------- | -------- | ------- | ------- | ------ | ------- | --------- | | ||
| A100单机8卡(1x8) | fp32 | bs=32,lr=0.00015 | | 2.30 | 88.36 | 89.57 | | 33.7/40.0 | | ||
| A100单机8卡(1x8) | fp32 | bs=32,lr=0.00015 | 853.75 | 2.30 | 88.36 | 89.57 | 0.7001 | 33.7/40.0 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p_whole如此低,是否考虑略微减少一些eval的频次,并增加一些train_steps,保证总时间相对不变的情况下多训练些步数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
from config_common import * | ||
|
||
dist_backend = "nccl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
vendor = 'kunlunxin' | ||
vendor = 'nvidia' | ||
|
||
# disable fp16 | ||
fp16 = False | ||
|
||
dist_backend = "nccl" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件有用吗?无用的话请删除此文件