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

Add RecordingReplay debug tool #5121

Merged
merged 19 commits into from
Jun 10, 2021
Merged

Add RecordingReplay debug tool #5121

merged 19 commits into from
Jun 10, 2021

Conversation

wyg1997
Copy link
Contributor

@wyg1997 wyg1997 commented Jun 7, 2021

提供了4个接口,用于debug:

oneflow._oneflow_internal.start_recording_instruction()
oneflow._oneflow_internal.end_recording_instruction()
oneflow._oneflow_internal.clear_recording_instruction()
oneflow._oneflow_internal.replay_instruction()

可以记录main线程创建的指令,后续直接调用 oneflow._oneflow_internal.replay_instruction() 回放指令,因为这条语句速度非常快,可以认为scheduler线程后续在单独工作,用于确认是否有线程安全问题存在于main线程和scheduler线程之间。

用法如下:

oneflow._oneflow_internal.start_recording_instruction()  # 开始记录指令
train(module, images, labels)
oneflow._oneflow_internal.end_recording_instruction()  # 结束记录指令

for i in range(num_epoch):
    oneflow._oneflow_internal.replay_instruction()  # 指令回放
oneflow._oneflow_internal.clear_recording_instruction()  # 清除指令

@wyg1997 wyg1997 marked this pull request as ready for review June 8, 2021 10:30
@daquexian

This comment has been minimized.

@oneflow-ci-bot oneflow-ci-bot self-requested a review June 9, 2021 09:33
@oneflow-ci-bot oneflow-ci-bot removed their request for review June 9, 2021 11:06
@oneflow-ci-bot oneflow-ci-bot self-requested a review June 9, 2021 13:43
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 9, 2021 15:42
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 9, 2021 17:15
@oneflow-ci-bot oneflow-ci-bot removed their request for review June 9, 2021 18:39
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 9, 2021 18:39
@oneflow-ci-bot oneflow-ci-bot self-requested a review June 9, 2021 20:34
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 9, 2021 22:44
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 10, 2021 00:37
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 10, 2021 02:52
@oneflow-ci-bot oneflow-ci-bot merged commit 61c883f into master Jun 10, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the feat-recording_replay branch June 10, 2021 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants