add auto-initialization for python#101
Merged
Merged
Conversation
Make use of uv to automatically initialize the python environment before any jax operation is accessed. Expose a separate dimwit.setup() method to allow manual initialization in cases the user needs to access python libraries before jax. Update build.sbt and docker files Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
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.
So far DimWit users have to set up the Python environment manually, which is cumbersome and requires careful setup of IDEs to make running programs/tests from the IDE possible.
As a possible solution it was proposed to create a sbt plugin, which uses
uv syncto simplify the process. This has, however, the disadvantage that only users who use sbt can benefit from it. This PR takes the idea from the plugin, but integrates the initialization directly into dimwit. At the time when Jax is inititalized, auv syncis run and the python path set up accordingly. If the user hasuvinstalled, then running dimwit will not need any setup from the user side at all.The mechanism has been tested on my local development machine (linux) and on docker. More testing is necessary and downsides of the automatic approach need to be evaluated. If proven robust enough, this solution might offer a user friendly way to use
DimWitand lower the barrier for first time users.