-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix segmentation fault #3978
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
base: main
Are you sure you want to change the base?
fix segmentation fault #3978
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1028,6 +1028,10 @@ def multi_gpu_launcher(args): | |||||||||||||||||||
| console.print_exception(suppress=[__file__], show_locals=False) | ||||||||||||||||||||
| else: | ||||||||||||||||||||
| raise | ||||||||||||||||||||
| else: | ||||||||||||||||||||
| if is_xpu_available(): | ||||||||||||||||||||
| import os as _os | ||||||||||||||||||||
| _os._exit(0) | ||||||||||||||||||||
|
Comment on lines
+1033
to
+1034
|
||||||||||||||||||||
| import os as _os | |
| _os._exit(0) | |
| # On XPU systems, a hard process exit is used to avoid a known oneCCL teardown crash. | |
| # This can be disabled for library/test usage by setting the environment variable | |
| # ACCELERATE_DISABLE_XPU_PROCESS_EXIT to a truthy value (e.g. "1", "true", "yes"). | |
| disable_exit = os.environ.get("ACCELERATE_DISABLE_XPU_PROCESS_EXIT", "").lower() | |
| if disable_exit not in {"1", "true", "yes"}: | |
| import os as _os | |
| _os._exit(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.
os._exit()bypasses normal shutdown (finally blocks,atexithandlers, logging/IO flushing). To reduce the chance of losing buffered output, consider explicitly flushingstdout/stderr(and/or logging handlers) immediately before the forced exit, and add a brief inline comment explaining that this is intentionally avoiding oneCCL static destructor teardown on XPU.