Skip to content

Commit bac1d83

Browse files
authored
[Bug Fix] Fix benchmark caused by recently dir and requirements change (#2228)
* fix benchmark * more steps for bigru crf
1 parent 86d9837 commit bac1d83

File tree

13 files changed

+14
-12
lines changed

13 files changed

+14
-12
lines changed

examples/machine_translation/transformer/deploy/python/inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@ def do_inference(args):
281281

282282
if args.profile:
283283
import importlib
284-
import util.recorder as recorder
284+
import tls.recorder as recorder
285285
try:
286286
mod = importlib.import_module("auto_log")
287287
except ImportError:
288-
mod = importlib.import_module("util.recorder")
288+
mod = importlib.import_module("tls.recorder")
289289
args.mod = mod
290290

291291
do_inference(args)

examples/machine_translation/transformer/deploy/python/util/recorder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import paddle
1818
import psutil
1919

20-
from util.benchmark_utils import PaddleInferBenchmark
20+
from tls.benchmark_utils import PaddleInferBenchmark
2121

2222
import paddle
2323
if paddle.is_compiled_with_cuda():

examples/machine_translation/transformer/static/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
sys.path.append(
2020
os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
2121
import reader
22-
from util.record import AverageStatistical
22+
from tls.record import AverageStatistical
2323

2424
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
2525
logging.basicConfig(level=logging.INFO, format=FORMAT)
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/machine_translation/transformer/train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from paddlenlp.utils.log import logger
1717
from paddlenlp.utils import profiler
1818

19-
from util.record import AverageStatistical
20-
from util.to_static import apply_to_static
19+
from tls.record import AverageStatistical
20+
from tls.to_static import apply_to_static
2121

2222

2323
def parse_args():

tests/test_tipc/configs/bigru_crf/train_infer_python.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ null:null
5252
===========================train_benchmark_params==========================
5353
batch_size:32
5454
fp_items:fp32
55-
epoch:1
55+
epoch:3
5656
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
5757
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096

tests/test_tipc/prepare.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ elif [ ${MODE} = "whole_infer" ];then
272272
elif [ ${MODE} = "benchmark_train" ];then
273273
if [ ${model_name} == "bigru_crf" ]; then
274274
rm -rf ./data/lexical_analysis_dataset_tiny ./data/lexical_analysis_dataset_tiny.tar.gz
275-
wget -nc -P ./data/ https://bj.bcebos.com/paddlenlp/datasets/lexical_analysis_dataset_tiny.tar.gz --no-check-certificate
275+
python ${BENCHMARK_ROOT}/paddlecloud/file_upload_download.py --remote-path frame_benchmark/paddle/PaddleNLP/lexical_analysis_dataset_tiny/ --local-path ./data/ --mode download
276276
cd ./data/ && tar xfz lexical_analysis_dataset_tiny.tar.gz && cd ..
277277
fi
278278

@@ -288,6 +288,8 @@ elif [ ${MODE} = "benchmark_train" ];then
288288
ln -s hdf5_lower_case_1_seq_len_512_max_pred_80_masked_lm_prob_0.15_random_seed_12345_dupe_factor_5/wikicorpus_en_seqlen512/ wikicorpus_en_seqlen512
289289

290290
cd ..
291+
292+
python -m pip install h5py -i https://mirror.baidu.com/pypi/simple
291293
fi
292294

293295
if [[ ${model_name} =~ gpt* ]]; then

tests/test_tipc/static/dp/bert/benchmark_common/prepare.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
1515
python -m pip install setuptools_scm
1616
python -m pip install Cython
1717
python -m pip install -r ../requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
18-
python -m pip install pybind11 regex sentencepiece tqdm visualdl attrdict pyyaml -i https://mirror.baidu.com/pypi/simple
18+
python -m pip install pybind11 regex sentencepiece tqdm visualdl attrdict pyyaml h5py -i https://mirror.baidu.com/pypi/simple
1919

2020
python -m pip install -e ../
2121
# python -m pip install paddlenlp # PDC 镜像中安装失败

0 commit comments

Comments
 (0)