-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Package exo as installable #354
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
Closed
Closed
Changes from 87 commits
Commits
Show all changes
120 commits
Select commit
Hold shift + click to select a range
5a750e9
added build folder
8d3d151
script for building mac app
dcd3264
added ci/cd
eda1ffd
added nuitka to deps
96b8d85
fixes to PR
a54d178
win icon
5ad45f4
fixes to static linking
17b85bd
fixed mlx error
39c260f
mlx library fix
885c663
remove .DS_Store
AlexCheema 358c58d
changes to replace error
768413f
use resolve_tokenizer consistently
AlexCheema c333b2c
os.path.dirname of sys.executable
AlexCheema 8f6cb76
changes to win jobs
d2805dc
added linux icon
b4ae3c2
linux build fix
3b64471
linux message
d767713
linux build
edd9483
renamed folder
3a40d21
linux packaging code
4bb9a1b
fixes to linux dist
98442e4
changes to linux nuitka
29fe3cf
added linux icon
3b9dbc8
changed to linux ico
b598947
changes to linux build ci/cd
bd414b5
macOS build
bcd0a35
Merge branch 'exo-explore:main' into package-exo-as-installable
4823cc5
testing wfs
23b1ddc
fix to config
21bafa7
fix config issue
c40b90a
circle ci issue fix
18d0726
changes to config
68db82f
config.yml
cbe4dec
fix to config.yml
6432c2b
changes to resource class
a9bde46
change to image
4645292
build fix error
0281f4f
fixes to build errors
ada61f6
fix to build error
4583c28
fix to circle ci/cd
bc6bb44
build fixes
1a2a576
circle ci/cd fixes error
4da2529
circle ci/cd errors fix
7b69a89
ci/cd error fix
8dd099b
error fix
d9b780d
ci/cd error fix
4908a2e
circle ci/cd errors
ecdf113
indent fix
5d68850
error fix
ae06a95
fix to conda
34938c5
conda error fix
e24dc63
circle ci error
b2a77a1
circle ci error
ef35cfd
circle ci fix
4b6a6bc
cci fix
f8599a4
circle ci/cd fix
b5e6c18
circle ci/cd fix
aa11281
circle ci/cd erro fix
b7c17b6
circle ci/cd error
67612f5
circle ci/cd error
399fe36
circle error
3d13c49
ci/cd fix
dcaf20e
ci/cd fix
48dac95
build error fix
a384c8c
build error fix
8512263
improv to build ci/cd
2859a62
added jobs
55150b4
fix to linux job
48eaf85
fix to clang
054e444
float fix
eadfdb3
float fix
993217c
float fix
08d8b75
change to model
fd3436d
smaller model
761800b
fix to clang error
e1887ea
model change
f708c4b
fixing layer missing
fd45f3b
seg fault error
e0a2e9a
llvir
fb0ef4e
changed to fl32
96e3ed1
added 3.2-3b
67b12ab
float 16
9c4bf27
fix to float16
65d747e
fix to float16
7b2b7ec
fix to float16
5b7ee2e
fix to float16
682e7e4
using torch:
fad9ed8
removed unused import
d22efaf
pr comment
ec8707d
removed bf16 changes:
6156976
Merge branch 'main' into package-exo-as-installable
AlexCheema a01b2ce
fix spacing
AlexCheema 330240c
try except open_web_chat. we shouldnt kill exo if that fails
AlexCheema f75f0a8
using electron app:
928ad22
added tray photo
060c0c7
changs to backend
6e7a308
changes to ci
9270503
build error fix
910ace4
build error fix
140293d
build app fix
60fe15f
compilation issue
f456117
changes to exo app
9dcc06c
added out to gitignore
b15aa5f
fixed dock quit:
b9467c1
changes to circle ci
73c28e5
fixes to circle ci error
2e41500
circle ci fixes
adfed0a
circle config version
253f9b7
publish tags
4ba72f7
git tags fix
0ae1b7b
circle config edits
963fa85
pr suggestion fixes
c796b13
added qwen2.5
b42e031
build config changes
83793b6
enabled lto
08b7385
build error time:
d150607
final polish
79c2886
reverting config changes
e2a1bf6
cleaning
2dff5cf
clean unrelated
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ version: 2.1 | |
|
||
orbs: | ||
python: circleci/python@2 | ||
|
||
win: circleci/[email protected] | ||
commands: | ||
run_chatgpt_api_test: | ||
parameters: | ||
|
@@ -208,6 +208,119 @@ jobs: | |
# inference_engine: tinygrad | ||
# model_id: llama-3-8b | ||
|
||
build_exo_macos: | ||
macos: | ||
xcode: "16.0.0" | ||
resource_class: m2pro.large | ||
steps: | ||
- checkout | ||
- run: | ||
name: Set up Python environment | ||
command: | | ||
brew install [email protected] | ||
python3.12 -m venv env | ||
- run: | ||
name: Install dependencies | ||
command: | | ||
source env/bin/activate | ||
pip install --upgrade pip | ||
pip install . | ||
- run: | ||
name: Build exo for macOS | ||
command: | | ||
source env/bin/activate | ||
python3 buildexo/build_exo.py | ||
- run: | ||
name: Create a macOS app | ||
command: | | ||
mv dist/main.app dist/exo.app | ||
|
||
build_exo_linux: | ||
machine: | ||
image: ubuntu-2004:current | ||
resource_class: xlarge | ||
steps: | ||
- checkout | ||
- run: | ||
name: Set up Python environment | ||
command: | | ||
sudo apt-get update | ||
sudo apt-get install -y python3 python3-venv | ||
sudo apt-get install clang | ||
sudo apt-get install patchelf | ||
python3 -m venv env | ||
- run: | ||
name: Install dependencies | ||
command: | | ||
source env/bin/activate | ||
pip install --upgrade pip | ||
pip install . | ||
- run: | ||
name: Build exo for Linux | ||
no_output_timeout: 90m | ||
command: | | ||
source env/bin/activate | ||
python3 buildexo/build_exo.py | ||
- run: | ||
name: Create an AppImage | ||
command: | | ||
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool | ||
sudo chmod +x /usr/local/bin/appimagetool | ||
mkdir -p exo.AppDir/usr/bin | ||
cp -r env/lib/python3.12/site-packages/tinygrad exo.AppDir/usr/bin | ||
cp -r dist/main.dist/* exo.AppDir/usr/bin | ||
# copying icons from docs to exo.AppDir | ||
cp docs/exo-rounded.png exo.AppDir | ||
cat > exo.AppDir/exo.desktop << 'EOF' | ||
[Desktop Entry] | ||
Name=exo | ||
Icon=exo-rounded | ||
Terminal=false | ||
Type=Application | ||
Categories=Utility; | ||
EOF | ||
|
||
cat > exo.AppDir/AppRun << 'EOF' | ||
#!/bin/bash | ||
export APPDIR="$(dirname "$(readlink -f "$0")")" | ||
export PATH="$APPDIR/usr/bin/:$PATH" | ||
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH" | ||
export XDG_DATA_DIRS="$APPDIR/usr/share/:/usr/share/:$XDG_DATA_DIRS" | ||
"$APPDIR"/usr/bin/exo "$@" | ||
EOF | ||
|
||
chmod +x exo.AppDir/AppRun | ||
appimagetool exo.AppDir/ | ||
mv *.AppImage ./output/ | ||
|
||
build_exo_windows: | ||
executor: win/default | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Conda | ||
command: | | ||
choco install anaconda3 --yes | ||
- run: | ||
name: Set up Conda environment | ||
command: | | ||
conda create -n exo-env python=3.12 --yes | ||
conda activate exo-env | ||
conda install -c conda-forge python=3.12 | ||
conda install -c conda-forge libstatic | ||
conda install -c conda-forge rust | ||
- run: | ||
name: Install dependencies | ||
command: | | ||
conda activate exo-env | ||
pip install --upgrade pip | ||
pip install . | ||
- run: | ||
name: Build Exo for Windows | ||
command: | | ||
conda activate exo-env | ||
python buildexo/build_exo.py | ||
|
||
workflows: | ||
version: 2 | ||
build_and_test: | ||
|
@@ -216,4 +329,6 @@ workflows: | |
- discovery_integration_test | ||
- chatgpt_api_integration_test_mlx | ||
- test_macos_m1 | ||
- build_exo_macos | ||
- build_exo_linux | ||
# - chatgpt_api_integration_test_tinygrad | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import subprocess | ||
import sys | ||
import os | ||
def run(): | ||
|
||
python_version = f"python{sys.version_info.major}.{sys.version_info.minor}" | ||
|
||
command = [ | ||
f"{sys.executable}", "-m", "nuitka", "exo/main.py", | ||
"--company-name=exolabs", | ||
"--product-name=exo", | ||
"--output-dir=dist", | ||
"--follow-imports", | ||
"--standalone", | ||
"--output-filename=exo", | ||
"--static-libpython=yes" | ||
] | ||
|
||
if sys.platform == "darwin": | ||
command.extend([ | ||
"--macos-app-name=exo", | ||
"--macos-app-mode=gui", | ||
"--macos-app-version=0.0.1", | ||
"--macos-create-app-bundle", | ||
"--macos-app-icon=docs/exo-logo.icns", | ||
"--include-module=exo.inference.mlx.models.llama", | ||
"--include-module=exo.inference.mlx.models.deepseek_v2", | ||
"--include-module=exo.inference.mlx.models.base", | ||
"--include-module=exo.inference.mlx.models.llava", | ||
"--include-module=exo.inference.mlx.models.qwen2", | ||
"--include-distribution-meta=mlx", | ||
"--include-module=mlx._reprlib_fix", | ||
"--include-module=mlx._os_warning", | ||
f"--include-data-files=./env/lib/{python_version}/site-packages/mlx/lib/mlx.metallib=mlx/lib/mlx.metallib", | ||
AlexCheema marked this conversation as resolved.
Show resolved
Hide resolved
|
||
f"--include-data-files=./env/lib/{python_version}/site-packages/mlx/lib/mlx.metallib=./mlx.metallib", | ||
"--include-distribution-meta=pygments" | ||
]) | ||
elif sys.platform == "win32": | ||
command.extend([ | ||
"--onefile", | ||
"--windows-icon-from-ico=docs/exo-logo-win.ico", | ||
"--file-version=0.0.1", | ||
"--product-version=0.0.1" | ||
]) | ||
elif sys.platform.startswith("linux"): | ||
command.extend([ | ||
"--include-distribution-metadata=pygments", | ||
"--linux-icon=docs/exo-rounded.png" | ||
]) | ||
|
||
command.extend([ | ||
"--include-data-dir=exo/tinychat=tinychat" | ||
]) | ||
|
||
if sys.platform == 'darwin': | ||
libpython_path = f"/opt/homebrew/opt/python@{sys.version_info.major}.{sys.version_info.minor}/Frameworks/Python.framework/Versions/{sys.version_info.major}.{sys.version_info.minor}/lib/python{sys.version_info.major}.{sys.version_info.minor}/config-{sys.version_info.major}.{sys.version_info.minor}-darwin" | ||
include_path = f"/opt/homebrew/opt/python@{sys.version_info.major}.{sys.version_info.minor}/Frameworks/Python.framework/Versions/{sys.version_info.major}.{sys.version_info.minor}/include/python{sys.version_info.major}.{sys.version_info.minor}" | ||
env = os.environ.copy() | ||
env['LDFLAGS'] = f"-L{libpython_path}" | ||
env['CPPFLAGS'] = f"-I{include_path}" | ||
|
||
try: | ||
subprocess.run(command, check=True) | ||
print("Build completed!") | ||
except subprocess.CalledProcessError as e: | ||
print(f"An error occurred: {e}") | ||
|
||
if __name__ == "__main__": | ||
run() |
Oops, something went wrong.
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.
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.
why not
build_exo_windows
?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.
exo does not run on windows machines, at least on its current state, some dependencies use posix shared memory which windows does not support
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.
do you know which dependencies are problematic right now?
tinygrad supports windows fully now so we should be able to get exo working on windows with little effort