-
Notifications
You must be signed in to change notification settings - Fork 825
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 timeout and loc for blocking calls #6007
Add timeout and loc for blocking calls #6007
Conversation
效果: E0824 10:59:54.763103 4013850 tensor.cpp:96] [rank=1] blocking detected. Python stack:
File "graph/train_consistent.py", line 370, in <module>
main(args)
File "graph/train_consistent.py", line 310, in main
l = loss.numpy()
File "/home/caishenghang/oneflow_cuda/python/oneflow/framework/tensor.py", line 50, in _tensor_numpy
with BlockingContext() as ctx:
File "/home/caishenghang/oneflow_cuda/python/oneflow/support/blocking.py", line 9, in __init__
stack_info = "\n".join(traceback.format_stack(limit=5))
E0824 10:59:57.762894 4013849 transport_util.cpp:34] [rank=0] blocking detected. Python stack:
File "graph/train_consistent.py", line 370, in <module>
main(args)
File "graph/train_consistent.py", line 348, in main
flow.save(
File "/home/caishenghang/oneflow_cuda/python/oneflow/framework/check_point_v2.py", line 166, in save
var_dict[name] = var.to_consistent(sbp=flow.sbp.broadcast).to_local()
File "/home/caishenghang/oneflow_cuda/python/oneflow/nn/modules/consistent_cast.py", line 104, in to_consistent_op
with BlockingContext() as ctx:
File "/home/caishenghang/oneflow_cuda/python/oneflow/support/blocking.py", line 9, in __init__
stack_info = "\n".join(traceback.format_stack(limit=5)) |
python/oneflow/support/blocking.py
Outdated
import oneflow._oneflow_internal | ||
|
||
|
||
class BlockingContext: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BlockingInfoContext
python/oneflow/support/blocking.py
Outdated
|
||
def __exit__(self, exc_type, exc_value, traceback): | ||
pass | ||
# oneflow._oneflow_internal.blocking.clear_stack_info_callback() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不应该被注释。
oneflow/core/common/spin_counter.cpp
Outdated
std::chrono::duration<double> elapsed_seconds = end - start; | ||
CHECK_LT_OR_RETURN(elapsed_seconds.count(), seconds) | ||
<< Error::TimeoutError() << "Timeout error at " << seconds << " seconds."; | ||
} | ||
return Maybe<void>::Ok(); | ||
} | ||
|
||
Maybe<void> SpinWaitUntilTimeout(const std::function<bool()>& NeedSpin, int64_t seconds) { | ||
return SpinWaitUntilTimeout( | ||
NeedSpin, seconds, [] {}, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的heartbeat_interval_seconds是不是应该是seconds
…ub.com/Oneflow-Inc/oneflow into add_timeout_and_loc_for_blocking_calls
…ub.com/Oneflow-Inc/oneflow into add_timeout_and_loc_for_blocking_calls
Speed stats:
|
No description provided.