mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-06-21 13:11:27 +00:00
1st try on restore bert's cache during testing
This commit is contained in:
parent
65f8d8b5bb
commit
8b1b237a5f
14
.github/workflows/example_check_on_schedule.yml
vendored
14
.github/workflows/example_check_on_schedule.yml
vendored
@ -65,19 +65,17 @@ jobs:
|
|||||||
- name: Install Colossal-AI
|
- name: Install Colossal-AI
|
||||||
run: |
|
run: |
|
||||||
CUDA_EXT=1 pip install -v .
|
CUDA_EXT=1 pip install -v .
|
||||||
- name: Restore huggingface cache
|
|
||||||
run: |
|
|
||||||
example_dir=${{ matrix.directory }}
|
|
||||||
if [[ $example_dir == *language/bert* ]]; then
|
|
||||||
echo "restore Bert weights"
|
|
||||||
cp -p -r /home/lcsoftware/gitact/actions-runner/_work/_temp/_github_home/hf_cache "${PWD}/examples/${example_dir}"
|
|
||||||
fi
|
|
||||||
- name: Traverse all files
|
- name: Traverse all files
|
||||||
run: |
|
run: |
|
||||||
example_dir=${{ matrix.directory }}
|
example_dir=${{ matrix.directory }}
|
||||||
echo "Testing ${example_dir} now"
|
echo "Testing ${example_dir} now"
|
||||||
|
if [[ $example_dir == *language/bert* ]]; then
|
||||||
|
echo "restore Bert weights to ${PWD}/examples/${example_dir}"
|
||||||
|
cp -p -r /home/lcsoftware/gitact/actions-runner/_work/_temp/_github_home/hf_cache "${PWD}/examples/${example_dir}"
|
||||||
|
ls -A ${PWD}/examples/${example_dir} | grep *bert-base*
|
||||||
|
fi
|
||||||
cd "${PWD}/examples/${example_dir}"
|
cd "${PWD}/examples/${example_dir}"
|
||||||
ls -A | grep *bert-base*
|
|
||||||
bash test_ci.sh
|
bash test_ci.sh
|
||||||
env:
|
env:
|
||||||
NCCL_SHM_DISABLE: 1
|
NCCL_SHM_DISABLE: 1
|
||||||
|
@ -248,7 +248,7 @@ def main():
|
|||||||
cfg = AutoConfig.from_pretrained(model_name, num_labels=data_builder.num_labels)
|
cfg = AutoConfig.from_pretrained(model_name, num_labels=data_builder.num_labels)
|
||||||
|
|
||||||
if model_name == "bert-base-uncased":
|
if model_name == "bert-base-uncased":
|
||||||
model = BertForSequenceClassification.from_pretrained(model_name, config=cfg).cuda()
|
model = BertForSequenceClassification.from_pretrained(model_name, config=cfg, cache_dir="./").cuda()
|
||||||
elif model_name == "albert-xxlarge-v2":
|
elif model_name == "albert-xxlarge-v2":
|
||||||
model = AlbertForSequenceClassification.from_pretrained(model_name, config=cfg)
|
model = AlbertForSequenceClassification.from_pretrained(model_name, config=cfg)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user