-
Notifications
You must be signed in to change notification settings - Fork 24
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
Support profiling from inside the interpreter, or even from code #71
Comments
To what extent is calling filprofiler from code now supported, given the Jupyter magic work completed in #12? |
It works, it's just ... not documented. And probably need a bit more glue to make it easier? I'll try to do this this week, and then do a release, it's probably time for one. |
@corleyma what's your use case, BTW? There are different ways I could approach this, from making the IPython DTRT to more general Python interpreter support. |
Though this is likely very specific to problems I am currently solving for my teams, here's a detailed statement for what I'm trying to achieve: I am interested in integrating filprofiler with our Python workflow orchestration layer such that engineers and scientists can specify dynamically that they'd like to profile a given workflow step. In that case, the workflow orchestration layer would invoke user code with profiling, saving the profiling outputs as workflow artifacts for later consumption. Another, related use case of interest: updating our workflow orchestration layer to re-try steps that fail with OOM with profiling enabled, saving the profiling outputs created by filprofiler as workflow artifacts for later consumption. Translating to this into an ask for filprofiler:
Take the above suggestions with a grain of salt, because I am less familiar with the constraints of filprofiler and what makes for a reasonable API. |
As far as those requirements:
One thing I've been thinking about is how to make Fil development sustainable; there are projects like the normal Python interpreter, multiprocessing, etc. that are pretty big, and this is development I'm doing on my own time. Since it sounds like Fil would be helping you quite a bit, would you be interested in funding some of the work? For example, I could imagine a supporter contract structure where organizations who buy it get their feature requests prioritized. So effectively not different than buying proprietary off-the-shelf software or services, just what you're getting is slightly different, just so it's easiest for everyone. If that's something you'd be interested in, I'd love to hear what would the easiest thing for you to do within your corporate structure, e.g. if it's easier to do monthly payments vs. one-off large payment. |
Being able to call filprofiler from a modified interpreter that doesn't add too much overhead until profiling happens is totally sufficient for our use case. It seems like what's missing for us at this stage then is just some documentation around how to use filprofiler from code (with a suitably altered interpreter), and API access to the profiling artifacts.
I think the idea of supporting open source work is very interesting but I can't speak for my company. As a matter of personal interest, however, I would be willing to collaborate on feature development for the right features. |
|
Status report:
|
Another status report:
|
The same infrastructure that would allow profiling with Jupyter (#12) would also allow limited-scope profiling from inside a running Python interpreter (as opposed to the current "full interpreter run" option). The main benefits being:
This is mostly documentation since the hard lifting will be done in #12.
Going to restrict this to "API for profiling particular bits of code", IPython CLI support can be different issue.
The text was updated successfully, but these errors were encountered: