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
Scalene: internal error: unable to find Python allocator functions #278
Comments
Thanks for the report. I've fixed the case triggered by |
Awesome! Let me know if you need any info about my environment for the allocator function issue! |
Running on the current HEAD of scalene's |
Replicated on python 3.7.10, does not arise on 3.8.10. Attempting on 3.7.12 |
Error arises in 3.7.12 |
This seems to be a python3.7 issue instead of a Poetry issue |
I made a 3.8 environment using the same tools (pyenv, poetry, scalene as a local dep, ...) and the allocator function issue does not appear. So no pyenv nor poetry seem to be related to the issue. |
I need to verify this by doing a binary install of Python 3.7, but it appears to be either a python 3.7 issue or an issue with the interaction between Pyenv and Python 3.7. Pyenv starts up a bunch of child processes and for some reason one of the children doesn't load |
Same error when importing
|
I have the same issue with python 3.7.3
First time i try scalene so not sure if i did anything wrong. Advice please |
I can confirm the error message appearing with python 3.8.12 version. |
With conda or without? We are trying to figure out what on earth is going on here, since naturally it works fine on our end and in our CI environment. Thanks! |
Using conda and python 3.8.12 from conda-forge, and I do see the allocators exist, as in ❯ for fn in $(find /home/user/miniconda3/envs/env-dev-profiling/lib/ -name "libpython*.so"); do echo $fn; readelf -s $fn | grep -i "pymem_[gs]etallocator"; done
/home/user/miniconda3/envs/env-dev-profiling/lib/libpython3.8.so
626: 00000000001adf00 64 FUNC GLOBAL DEFAULT 11 PyMem_GetAllocator
1450: 00000000001adf40 39 FUNC GLOBAL DEFAULT 11 PyMem_SetAllocator
34188: 00000000001adf40 39 FUNC GLOBAL DEFAULT 11 PyMem_SetAllocator
34998: 00000000001adf00 64 FUNC GLOBAL DEFAULT 11 PyMem_GetAllocator EDIT: It works fine with simple code as the one in #278 (comment) and also in other simpler codes of mine that use CUDA. |
Getting the same error on WSL2, running a conda environment with python 3.7.11. I still get profiling information from scalene, but the message is always present. |
Update: we believe we have finally figured out what's going on and hope to have a fix out soon! |
Downgrading to Scalene version 1.3.12 fixes the issue for me |
This should be fixed now (in yesterday's release). Please re-open if it's not. |
If anybody else has been following this issue and wants to know a bit more about the details of the fix, I believe these are the most important changes between v1.3.15 and v1.3.16
|
Describe the bug
When starting
scalene
(withpoetry run python -m scalene my_script.py
), I get the errorScalene: internal error: unable to find Python allocator functions
. This happens both withpoetry run python -m scalene my_script.py
or if started within the venv (python -m scalene my_script.py
or justscalene my_script.py
).Some seconds after this output, i get a long traceback (reported afterwards).
I don't really think this is something about my program, since it always worked without
scalene
, but I think it is something related to Trio.To Reproduce
Steps to reproduce the behavior:
Snippet that cause the error:
and then
poetry run python -m scalene asd.py
. This gives this traceback:Commenting out the line
import trio
, makes everything works.However, the line
Scalene: internal error: unable to find Python allocator functions
is always present.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: