-
Notifications
You must be signed in to change notification settings - Fork 40
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
Added support for Swarm Mode #344
Conversation
PR Summary
|
src-tauri/src/main.rs
Outdated
println!("🚀 Starting the Swarm..."); | ||
|
||
let _ = Command::new("/usr/bin/python3") | ||
.args(&["-m", "pip", "install", "git+https://github.com/bigscience-workshop/petals",]) |
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.
Potentially fallback to pip install --user
before giving up?
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.
Ideally, we should install python, conda, create a conda env, and then install, but I want your opinion on that on how to make this installation super smooth.
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.
I'd suggest:
- try to find
mamba
on$PATH
- try to find
conda
on$PATH
- try to find
python3
on$PATH
- install https://github.com/conda-forge/miniforge#mambaforge
for (1), (2) and (4): create/activate an env called prem
before installing
What' the Tauri problem with $PATH
?
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.
LGTM
@casperdcl @sekulicd @Janaka-Steph @tiero instead of passing |
could just use current username |
Good point. I ll apply the changes you suggested above. |
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.
lgtm but maybe open follow-up issues for:
I ll address the remaining points in this PR soon. I want first the new services to be working and then I ll move on with this. :) |
Missing
|
@casperdcl can you check it? @Janaka-Steph can you enhance the style of swarm settings? |
@filopedraz, @tiero should we update it as user_name@premAI or keep it as user_name? Where user name is what specified by the user (with default prem-app) |
pip install -r $REQUIREMENTS_FILE_PATH | ||
|
||
# Package the Python script | ||
pyinstaller --onefile $PYTHON_SCRIPT_PATH --distpath $DIST_PATH --clean -n petals-x86_64-apple-darwin |
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.
This will not work on all architectures, please build one for each architecture
pyinstaller --onefile $PYTHON_SCRIPT_PATH --distpath $DIST_PATH --clean -n petals-x86_64-apple-darwin | |
pyinstaller --onefile $PYTHON_SCRIPT_PATH --distpath $DIST_PATH --clean -n petals-x86_64-apple-darwin | |
pyinstaller --onefile $PYTHON_SCRIPT_PATH --distpath $DIST_PATH --clean -n petals-aarch64-apple-darwin |
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.
I think this will not be enough. If is not possible to make an universal binary with single name, we must package both in the App
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.
dont trust, verify (its the AI) https://chat.openai.com/share/2a996ae8-abe3-4b50-a13a-3a6c8c41afbd
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.
If we manage to make an universal binary, we should them call it petals-universal-apple-darwin
otherwsie when you will be up to compile
Error failed to bundle project: Failed to copy external binaries: Failed to copy external binaries: path matching bin/python/petals-universal-apple-darwin not found.: path matching bin/python/petals-universal-apple-darwin not found.
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.
if not possible to have universal binary, we must also change how we build the desktop app and file naming (splitting Apple SIlicon and Apple Intel) on website, documentations etc..
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.
universal bin may or may not be possible1:
pyinstaller --onefile $PYTHON_SCRIPT_PATH --distpath $DIST_PATH --clean -n petals-x86_64-apple-darwin | |
pyinstaller --onefile $PYTHON_SCRIPT_PATH --distpath $DIST_PATH --clean --target-arch universal2 -n petals-universal-apple-darwin |
plus tauri build --target universal-apple-darwin
23
Note, however, that this increases your bundle size significantly4
Footnotes
We should start with a default name taken from user-space ie. |
@tiero it will be a public name. User should be able to provide what they want. |
I did little tweaks to UI and compiled also aarch64 version to test for Apple SIlicon, please @nsosio pull before commiting more work |
Ok I will reintroduce the Input, but once they start the swarm |
Starting the Swarm on any model crashes once click on Start |
|
…ersal-apple-darwin
Currently does not work on my Mac M1, investigating. @filopedraz If you have time to test on your device let me know if you experience the same. |
Just tested, to me works. |
66102ba
to
293d52d
Compare
293d52d
to
dfccace
Compare
working on this in a separate repo (https://github.com/premAI-io/test-app/actions)... any idea why tauri build fails with "path matching bin/python/petals-aarch64-apple-darwin not found" despite |
It would be nice to move the Petals rust code into its own file rather than in main.rs |
follow-up: apparently
Just one or two of the above isn't enough. |
CI-built |
Description
Added support for Swarm Mode which starts the necessary processes in order to be part of the Petals Swarm. The User can
Enable
the mode from Settings. Tauri will spawn a thread that installs the dependencies and runs the python process.The PR contains all the building blocks in order to implement the complete POC functionality.
Limitations
@tiero @casperdcl @sekulicd @Janaka-Steph please have a look.