Repository navigation
Fix Deepseek Qwen Fatal Bus Error [#291] - #456
Merged
Merged
Conversation
Contributor
Author
|
I have tested if |
jazpurTT
reviewed
Mar 19, 2025
|
||||||||||||||
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #456 +/- ##
==========================================
- Coverage 72.25% 70.15% -2.10%
==========================================
Files 13 13
Lines 1820 1893 +73
==========================================
+ Hits 1315 1328 +13
- Misses 505 565 +60 ☔ View full report in Codecov by Sentry. |
AleksKnezevic
requested changes
Mar 19, 2025
ddilbazTT
force-pushed
the
deepseek_qwen
branch
from
March 19, 2025 16:15
1471084 to
01d6aaa
Compare
|
||||||||||||||
ddilbazTT
force-pushed
the
deepseek_qwen
branch
from
March 19, 2025 17:08
01d6aaa to
b0c33a2
Compare
|
||||||||||||||
AleksKnezevic
approved these changes
Mar 19, 2025
ddilbazTT
force-pushed
the
deepseek_qwen
branch
from
March 19, 2025 19:50
b0c33a2 to
746ebba
Compare
Contributor
|
@jazpurTT, can you please check your model with this change too? |
Deepseek Qwen op no. 9552 fails with out-of-memory error. This is expected to be caught by try-except block. Instead, the whole program crashes. The error is related to multiprocessing in Python. There is no full isolation between parent and child processes. So, the child process running out of memory kills the parent process. Thus, now there is a memory limit to inputs that we pass on to the child process, and if exceeded, we push the inputs to disk and send a reference to disk address to child process. This is not the ideal solution, but it works using python's multiprocessing module. - helper functions such as `get_tensor_size`, `get_inputs_size` help determine size of inputs in bytes - `run_op` determines if inputs exceed 1 GB or not - if exceeding, inputs are dumped to a temporary file using pickle - `execute_process` uses `pickle.load()` if inputs exceed memory limit - file where inputs are stored is deleted at the end of `run_op` As a note, PyTorch also faces a similar issue, and seems like they have extended torch.multiprocessing to handle large tensor sharing over processes.
jazpurTT
approved these changes
Mar 19, 2025
ddilbazTT
force-pushed
the
deepseek_qwen
branch
from
March 19, 2025 19:51
746ebba to
3b342f9
Compare
Contributor
I did, it is compiling op_by_op, no more Bus Error. There is just an ATOL error during verify_output. |
ddilbazTT
enabled auto-merge (squash)
March 19, 2025 20:00
|
||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deepseek Qwen op no. 9552 fails with out-of-memory error. This is expected to be caught by try-except block. Instead, the whole program crashes.
The error is related to multiprocessing in Python. There is no full isolation between parent and child processes. So, the child process running out of memory kills the parent process.
Thus, now there is a memory limit to inputs that we pass on to the child process, and if exceeded, we push the inputs to disk and send a reference to disk address to child process. This is not the ideal solution, but it works using python's multiprocessing module.
get_tensor_size,get_inputs_sizehelp determine size of inputs in bytesrun_opdetermines if inputs exceed 1 GB or notexecute_processusespickle.load()if inputs exceed memory limitrun_opAs a note, PyTorch also faces a similar issue, and seems like they have extended torch.multiprocessing to handle large tensor sharing over processes.
Ticket
#291