-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
viztracer seems to be incompatible with some python packages #259
Comments
I can't reproduce this issue locally with python3.9 + WSL2 Ubuntu. The error normally means there's a file corruption. Are you able to reproduce this issue reliably with the exact code you provided? |
Thanks for your timely reply. It seems there was something wrong with my environment. I create a new environment and everything is fine now. I have never seen this kind of error before. Sorry for the inconvenience caused. |
Well, after using another version of FYI, The following are my pip installation log, pip install viztracer
pip install tqdm
pip install dm-acme[jax,tf,envs] together with the full
Could you please try this? 🤔 |
The reason of this bug is PyCapsule, an uncommon class used for passing a C void pointer between C extensions, which is used in jaxlib(mlir actually). I think the binary is built using some 3rd party library so the function name is left blank(more like garbage) on C level, which confused VizTracer. I can patch this, just need to think about what's the best way to do it. |
I believe this is a bug in either jax or mlir(llvm). I filed an issue in jax jax-ml/jax#11750 |
So after some experiments, this is in kind of a grey area. VizTracer assumes every There are a couple of solutions to this specific problem, but none of them are good:
This is a super rare corner case and probably will not happen a lot. In my opinion, it's at least 50% mlir's implementation's issue. I filed an issue llvm/llvm-project#56943 on llvm github and let's see how they will respond to this. In the mean time, I will consider how to at least avoid an error from viztracer in this kind of situation. |
I added a workaround in #261 for this - an option If you want to try it out, you can install the mainline version by However, this is a very rare situation so I won't document this feature. It will stay quietly among the options. To me this is an deficiency in mlir code, whether or not they agree. So there will be no major changes to the default behavior to accommodate this kind of issue. On the other hand, the problematic function happened in import phase. If the only thing you are interested in is the code you are working on, you could do |
I encountered this weird problem when I was using
viztracer
to profile reverb.My python version is
Python 3.9.12
and OS version isUbuntu 20.04.4 LTS
.The exception details are as follows,
And the following is the issue code,
I'm wondering whether I have made some mistakes or if this is a compatibility issue with
viztracer
. 🤔By the way, this is really a nice profiling tool. 🤗
The text was updated successfully, but these errors were encountered: