-
Notifications
You must be signed in to change notification settings - Fork 62
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
Improvements to legate.jupyter #425
Conversation
I just tried the new jupyter branch, it works for me. Nice work! Regarding the questions:
I think we do not need it. I use it because I do not know the legate installation directory with the old makefile system.
Are we able to find this file in both editable and non-editable installation? I copied this file into kernel directory because I do not know how to find this file.
If without
I am OK with installing a profiling kernel.
I think
No, I do not see how to run |
Brilliant, I will cross it off the list
Thanks for this, I had been testing editable. It looks like some work may be needed for non-editable (still investigating)
The workflow I had imagined is that users would switch to whatever legate environment they want, and then install jupyter extensions (once each) and run jupyter, out of that environment. To me that keeps things mentally separated in a nice way, but I can believe there are other use cases or needs I am not aware of. I would definitely like feedback on this point especially cc @manopapad @ipdemes
Hrmm you may be right, I am still seeing if I can make
I'll make sure to update the README regardless. EDIT: I actually can't get
👍 I will leave this for a future PR
OK great just double checking. I think if we published this as a separate package then there might be some conda mechanism, but we can save that until/unless we split the jupyter extension off in the future. |
@eddy16112 I think there is currently an issue with legions
|
Not much to add over Wei's comments.
I don't see why not.
I think this makes sense, but I don't personally use jupyter very often. |
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.
Took a look at the code as it is right now, didn't see any issues. I know we're still waiting on more changes.
@bryevdv Have you updated your Legion to the latest control replication branch? There was a bug in Legion python binding regarding calling -m, but I recently fixed it. https://gitlab.com/StanfordLegion/legion/-/commits/master/bindings/python/legion_top.py Here is my result:
|
@eddy16112 @manopapad I have resolved the issues [1] by defining a real entry point, so the tool is used like:
and verified it works with non-editable installs. Does this seem acceptable? If so I will update docs and add tests. [1] Boils down to |
da24919
to
50fb0c0
Compare
@manopapad apologies for the force push, I had been doing merges but somehow must have accidently done a rebase at some point. This is ready to go now. |
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.
Beautiful! Any further comments @eddy16112 ?
LGTM, nice job! |
This PR fixes the
legate.jupyter
functionality and also make some improvements:stub typings added so that mypy can be employed
driver code is re-used to:
legate
invocationsconfig values for
%legate_info
are passed in kernel spec metadata, reducing filesystem operationskernel name is included in the kernelspec env, so that:
legate.jupyter
can create multiple differently named kernel configurations%legate_info
can report on the exact running kernelQuestions
Currently the
--legate-dir
option is removed. Is this option needed? At present,legate.jupyter
always uses thelegate
install for itself, which seems appropriate, especially now that installs always happen into python environments. This includes pointing the specargv
at a_legion_kernel.py
module in the install, instead of actually copying files around.Currently
--json
(renamed--config
) is a no-op. Is it actually needed? Just runningpython -m legate.jupyter
uses exactly the same defaults aslegate
. These can be overridden with the standardlegate
command line options. Do we need to allow configuration of kernels from a file as well? If so I would propose splitting into two sub-commmands, one for using a file and one for using cmdline args, to avoid complicated config merges.I don't see any reason we couldn't easily support any other standard driver options (e.g. for profiling) easily now. Would it be useful for users to be able to install a debugging or profiling kernel alongside others?
Do we want a real entry point? e.g. users run
legate-jupyter
instead ofpython -m legate.jupyter
Currently have to explicitly run
%load_ext legate.jupyter
first before%legate_info
was this avoided somehow before?%legate_info
could report the computedlegion_python
invocation. Would that be useful for debugging? Or perhaps%legate info
and%legate driver
? or similarTodo
Once questions are resolved I intend to implement any appropriate changes in this PR, and then add a unit test suite.
I would also like to push some improvements down into legion's version of this code, but I do think it will result in much less friction if legate's implementation remains self-contained and decoupled from legion (apart from the ultimate
legion_python
invocation)Notes:
The changes under
legate.driver
are to facilitate increased code re-use, e.g the exact command line args can be re-used between different command line programs.Updated code never needs to create/install a fake spec, so there is no code to remove specs. If users give an existing name they get actionable error message:
Verbose mode has multiple levels of detail.
-v
gives basic info:But
--vv
dumps the full spec that is installed