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

feat: add file lock for remote files download to local path when multiple thread environment. #1887

Merged
merged 21 commits into from
Dec 24, 2024

Conversation

Tridu33
Copy link
Contributor

@Tridu33 Tridu33 commented Dec 24, 2024

清空.mindnlp执行并行案例可以下载【数据集,tokenizer和pretrainedModel】,0在忙着下载前两个的话,1抢占到文件锁会下载最后一个,都能等待。
1

thon串行下载也没有问题
2
对于文件锁,linux环境下无法预编译winfcntlock.pywinfcntlock.pyc导致pylint会告警E401:impor-error,如果希望兼容windows,pylint告警E0401: Unable to import 是否应该被忽略

@@ -20,6 +20,7 @@ echo "start training"

export MULTI_NPU="true"
export ASCEND_SLOG_PRINT_TO_STDOUT=1
export ASCEND_RT_VISIBLE_DEVICES=6,7 # Specify the available card numbers
Copy link
Collaborator

Choose a reason for hiding this comment

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

这行去掉

lock_file_path = pointer_path + ".lock"
if sys.platform != "win32":
# pylint: disable=import-error
import fcntl
Copy link
Collaborator

Choose a reason for hiding this comment

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

disable要写在当前行

# pylint: disable=import-error
import fcntl
else:
# pylint: disable=import-error
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上

@lvyufeng lvyufeng linked an issue Dec 24, 2024 that may be closed by this pull request
@lvyufeng lvyufeng merged commit 2d01edf into mindspore-lab:master Dec 24, 2024
4 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

数据并行多进程同时下载模型有问题。
2 participants