From d763acea8212390109696bac94d1dd29b64ab915 Mon Sep 17 00:00:00 2001 From: Zack Zhiyuan Li Date: Thu, 22 Aug 2024 13:20:13 -0700 Subject: [PATCH 1/4] add parallism for build --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a51549a7..e35ee2af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "nexaai" -version = "0.0.5" +version = "0.0.5.1" description = "Nexa AI SDK" readme = "README.md" license = { text = "MIT" } @@ -78,7 +78,7 @@ sdist.exclude = [".github", "build", "dist", "nexa.egg-info", "dependency/llama. build.verbose = true cmake.build-type = "Release" cmake.version = ">=3.16" -# cmake.args = ["-DCMAKE_CXX_FLAGS=-fopenmp"] +# cmake.args = ["-DCMAKE_CXX_FLAGS=-fopenmp","-DCMAKE_BUILD_PARALLEL_LEVEL=16"] [tool.pytest.ini_options] testpaths = ["tests"] \ No newline at end of file From d1b4118bdc0d063baf582e03746b2f1cc83b0bd0 Mon Sep 17 00:00:00 2001 From: Zack Zhiyuan Li Date: Thu, 22 Aug 2024 13:32:27 -0700 Subject: [PATCH 2/4] update docs --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a10d1d64..72588a51 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,10 @@ check if you have GPU acceleration (torch required) ```bash pip install nexaai --index-url https://nexaai.github.io/nexa-sdk/whl/cu124 --extra-index-url https://pypi.org/simple ``` + Optionally, you can install onnx supported version: + ```bash + pip install nexaai[onnx] --index-url https://nexaai.github.io/nexa-sdk/whl/cu124 --extra-index-url https://pypi.org/simple + ```
Apple M Chip: @@ -58,43 +62,74 @@ check if you have GPU acceleration (torch required) ```bash pip install nexaai --index-url https://nexaai.github.io/nexa-sdk/whl/metal --extra-index-url https://pypi.org/simple ``` + Optionally, you can install onnx supported version: + ```bash + pip install nexaai[onnx] --index-url https://nexaai.github.io/nexa-sdk/whl/metal --extra-index-url https://pypi.org/simple + ```
### CPU version
- Mac with Intel chips + Mac with Intel Chips - ``` + To install the `nexaai` package on a Mac with Intel chips, use the following command: + + ```bash CMAKE_ARGS="-DCMAKE_CXX_FLAGS=-fopenmp" pip install nexaai ``` + + **Optional:** To install the version with ONNX support, use: + + ```bash + CMAKE_ARGS="-DCMAKE_CXX_FLAGS=-fopenmp" pip install nexaai[onnx] + ``` +
- Mac with M chips or other Operating systems: + Mac with M Chips or Other Operating Systems - ``` + To install the `nexaai` package on a Mac with M chips or other operating systems, use the following command: + + ```bash pip install nexaai ``` + + **Optional:** To install the version with ONNX support, use: + + ```bash + pip install nexaai[onnx] + ``` + +
+If you prefer to install the pre-built wheel for CPU versions: -Or you prefer to install the pre-built wheel: ```bash pip install nexaai --index-url https://nexaai.github.io/nexa-sdk/whl/cpu --extra-index-url https://pypi.org/simple ``` -### Docker Usage -Note: Docker doesn't support GPU acceleration +To include ONNX support: -`docker pull nexa4ai/sdk:latest` +```bash +pip install nexaai[onnx] --index-url https://nexaai.github.io/nexa-sdk/whl/cpu --extra-index-url https://pypi.org/simple +``` +### Docker Usage +Note: Docker doesn't support GPU acceleration +```bash +docker pull nexa4ai/sdk:latest +``` replace following placeholder with your path and command - -`docker run -v :/model -it nexa4ai/sdk:latest [nexa_command] [your_model_relative_path]` +```bash +docker run -v :/model -it nexa4ai/sdk:latest [nexa_command] [your_model_relative_path] +``` Example: - -`docker run -v /home/ubuntu/.cache/nexa/hub/official:/model -it nexa4ai/sdk:latest nexa gen-text /model/Phi-3-mini-128k-instruct/q4_0.gguf` +```bash +docker run -v /home/ubuntu/.cache/nexa/hub/official:/model -it nexa4ai/sdk:latest nexa gen-text /model/Phi-3-mini-128k-instruct/q4_0.gguf +``` will create an interactive session with text generation From 2e231abfef837e931c5f12c9a5d5f883481893b7 Mon Sep 17 00:00:00 2001 From: Zack Zhiyuan Li Date: Thu, 22 Aug 2024 14:36:15 -0700 Subject: [PATCH 3/4] fix CI issue --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85c19f7f..489218f3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest] - python-version: [3.10] + python-version: ["3.10"] steps: - name: Checkout code From 0d339b11038125adb96ba8c68f87b95a646f7a06 Mon Sep 17 00:00:00 2001 From: Zack Zhiyuan Li Date: Thu, 22 Aug 2024 14:38:54 -0700 Subject: [PATCH 4/4] wip --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e35ee2af..14384e89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,8 @@ sdist.exclude = [".github", "build", "dist", "nexa.egg-info", "dependency/llama. build.verbose = true cmake.build-type = "Release" cmake.version = ">=3.16" -# cmake.args = ["-DCMAKE_CXX_FLAGS=-fopenmp","-DCMAKE_BUILD_PARALLEL_LEVEL=16"] +# cmake.args = ["-DCMAKE_CXX_FLAGS=-fopenmp"] # for macOS with Intel Silicon +cmake.args = ["-DCMAKE_BUILD_PARALLEL_LEVEL=16"] [tool.pytest.ini_options] testpaths = ["tests"] \ No newline at end of file