From af433790c182378b5d05a0e4c60fc43f1e3be45e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=87=AF=E5=AE=87?= Date: Sat, 11 Oct 2025 16:30:00 +0800 Subject: [PATCH] =?UTF-8?q?BERT-NER-Pytorch=E3=80=81Wenet=5FConformer=5Ffo?= =?UTF-8?q?r=5FPytorch=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Wenet_Conformer_for_Pytorch/examples/aishell/s0/run.sh | 6 +++--- .../examples/aishell/s0/run_whisper.sh | 6 +++--- .../examples/aishell/s0/test/env_npu.sh | 6 +++++- PyTorch/contrib/nlp/BERT-NER-Pytorch/test/env_npu.sh | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/run.sh b/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/run.sh index 2e7f6cd60b..ce872596ad 100644 --- a/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/run.sh +++ b/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/run.sh @@ -27,7 +27,7 @@ node_rank=0 data=$6 data_url=www.openslr.org/resources/33 -nj=16 +nj=32 dict=data/dict/lang_char.txt HOST_NOOD_ADDR="localhost:0" @@ -83,7 +83,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then rm data/${x}/text.org done - ../../../tools/compute_cmvn_stats.py --num_workers 16 --train_config $train_config \ + ../../../tools/compute_cmvn_stats.py --num_workers 24 --train_config $train_config \ --in_scp data/${train_set}/wav.scp \ --out_cmvn data/$train_set/global_cmvn fi @@ -143,7 +143,7 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then --model_dir $dir \ --ddp.init_method $init_method \ --ddp.dist_backend $dist_backend \ - --num_workers 8 \ + --num_workers 24 \ --performance_epoch $performance_epoch \ $cmvn_opts \ --pin_memory > $test_output_dir/0/train.log 2>&1 diff --git a/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/run_whisper.sh b/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/run_whisper.sh index c8894a103e..621f263e9a 100644 --- a/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/run_whisper.sh +++ b/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/run_whisper.sh @@ -27,7 +27,7 @@ node_rank=0 data=$6 data_url=www.openslr.org/resources/33 -nj=16 +nj=32 dict=data/dict/lang_char.txt HOST_NOOD_ADDR="localhost:0" @@ -83,7 +83,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then rm data/${x}/text.org done - ../../../tools/compute_cmvn_stats.py --num_workers 16 --train_config $train_config \ + ../../../tools/compute_cmvn_stats.py --num_workers 24 --train_config $train_config \ --in_scp data/${train_set}/wav.scp \ --out_cmvn data/$train_set/global_cmvn fi @@ -142,7 +142,7 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then --model_dir $dir \ --ddp.init_method $init_method \ --ddp.dist_backend $dist_backend \ - --num_workers 8 \ + --num_workers 24 \ --performance_epoch $performance_epoch \ $cmvn_opts \ --pin_memory > $test_output_dir/0/train.log 2>&1 diff --git a/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/test/env_npu.sh b/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/test/env_npu.sh index 1d729ed6d8..8b4976b1c9 100644 --- a/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/test/env_npu.sh +++ b/PyTorch/built-in/audio/Wenet_Conformer_for_Pytorch/examples/aishell/s0/test/env_npu.sh @@ -45,4 +45,8 @@ export COMBINED_ENABLE=1 #设置特殊场景是否需要重新编译,不需要修改 export DYNAMIC_OP="ADD#MUL" #HCCL白名单开关,1-关闭/0-开启。设置为1则无需校验HCCL通信白名单。 -export HCCL_WHITELIST_DISABLE=1 \ No newline at end of file +export HCCL_WHITELIST_DISABLE=1 +#增大host缓存 +export ACLNN_CACHE_LIMIT=100000 +#扩展内存池 +export PYTORCH_NPU_ALLOC_CONF="expandable_segments:True" \ No newline at end of file diff --git a/PyTorch/contrib/nlp/BERT-NER-Pytorch/test/env_npu.sh b/PyTorch/contrib/nlp/BERT-NER-Pytorch/test/env_npu.sh index 7bc3e4d672..fc422cb748 100644 --- a/PyTorch/contrib/nlp/BERT-NER-Pytorch/test/env_npu.sh +++ b/PyTorch/contrib/nlp/BERT-NER-Pytorch/test/env_npu.sh @@ -35,7 +35,7 @@ export ASCEND_GLOBAL_EVENT_ENABLE=0 #-配置为0时:关闭task_queue算子下发队列优化。 #-配置为1或未配置时:开启task_queue算子下发队列Level 1优化。 #-配置为2时:开启task_queue算子下发队列Level 2优化。关于Level 1和Level 2优化的详细解释请查看官网文档。 -export TASK_QUEUE_ENABLE=1 +export TASK_QUEUE_ENABLE=2 #设置是否开启PTCopy,0-关闭/1-开启 export PTCOPY_ENABLE=1 -- Gitee