Skip to content

Pip to pip3 #504

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

Merged
merged 2 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/hqq-dtype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:

echo "::group::Download checkpoints"
# Install requirements
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip install -r requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip3 install -r requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
echo "::endgroup::"

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
echo "$(uname -a)"
- name: Install dependencies
run: |
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
- name: Download checkpoints
run: |
Expand Down Expand Up @@ -81,9 +81,9 @@ jobs:
echo "$(uname -a)"
- name: Install dependencies
run: |
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
- name: Download checkpoints
run: |
Expand Down Expand Up @@ -128,9 +128,9 @@ jobs:
echo "::endgroup::"
echo "::group::Install required packages"
pip install --progress-bar off --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip install -r ./requirements.txt
pip list
pip3 install --progress-bar off --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip3 install -r ./requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
echo "::endgroup::"
Expand Down
171 changes: 48 additions & 123 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
echo "$(uname -a)"
- name: Install dependencies
run: |
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
- name: Download checkpoints
run: |
Expand Down Expand Up @@ -82,9 +82,9 @@ jobs:
echo "$(uname -a)"
- name: Install dependencies
run: |
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
- name: Download checkpoints
run: |
Expand Down Expand Up @@ -117,9 +117,9 @@ jobs:
echo "$(uname -a)"
- name: Install dependencies
run: |
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
- name: Download checkpoints
run: |
Expand Down Expand Up @@ -164,9 +164,9 @@ jobs:
echo "::endgroup::"

echo "::group::Install required packages"
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip install -r ./requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip3 install -r ./requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
echo "::endgroup::"

Expand Down Expand Up @@ -200,9 +200,9 @@ jobs:
echo "::endgroup::"

echo "::group::Install required packages"
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip install -r ./requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip3 install -r ./requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
echo "::endgroup::"

Expand Down Expand Up @@ -236,9 +236,9 @@ jobs:
echo "::endgroup::"

echo "::group::Install required packages"
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip install -r ./requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121
pip3 install -r ./requirements.txt
pip3 list
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
echo "::endgroup::"

Expand Down Expand Up @@ -276,12 +276,12 @@ jobs:
fi
- name: Install requirements
run: |
echo "Intalling pip packages"
pip install wheel
pip install cmake
pip install ninja
pip install zstd
pip install -r requirements.txt
echo "Intalling pip3 packages"
pip3 install wheel
pip3 install cmake
pip3 install ninja
pip3 install zstd
pip3 install -r requirements.txt

echo "Executorch: cloning"
mkdir etorch
Expand Down Expand Up @@ -425,9 +425,9 @@ jobs:
fi
- name: Install requirements
run: |
echo "Installing pip packages"
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
echo "Installing pip3 packages"
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'

- name: Download Stories files
Expand Down Expand Up @@ -458,81 +458,6 @@ jobs:
python torchchat.py generate stories15M
python torchchat.py remove stories15m

test-tinystories-eager:
strategy:
matrix:
runner: [macos-12]
runs-on: ${{matrix.runner}}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Print machine info
run: |
uname -a
if [ $(uname -s) == Darwin ]; then
sysctl machdep.cpu.brand_string
sysctl machdep.cpu.core_count
fi
- name: Install requirements
run: |
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
- name: Download checkpoints
run: |
mkdir -p checkpoints/stories15M
pushd checkpoints/stories15M
wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.pt
wget https://github.com/karpathy/llama2.c/raw/master/tokenizer.model
popd
- name: Run inference
run: |
export MODEL_PATH=checkpoints/stories15M/stories15M.pt
export MODEL_NAME=stories15M
export MODEL_DIR=/tmp
for DTYPE in bfloat16 float16 float32; do
# if [ $(uname -s) == Darwin ]; then
# export DTYPE=float16
# fi
python3 torchchat.py generate --dtype ${DTYPE} --checkpoint-path ${MODEL_PATH} --temperature 0

echo "******************************************"
echo "******* Emb: channel-wise quantized ******"
echo "******************************************"
python3 torchchat.py generate --dtype ${DTYPE} --quant '{"embedding" : {"bitwidth": 8, "groupsize": 0}}' --checkpoint-path ${MODEL_PATH} --temperature 0

echo "******************************************"
echo "******** Emb: group-wise quantized *******"
echo "******************************************"
python3 torchchat.py generate --dtype ${DTYPE} --quant '{"embedding" : {"bitwidth": 8, "groupsize": 8}}' --checkpoint-path ${MODEL_PATH} --temperature 0

echo "******************************************"
echo "******* INT8 channel-wise quantized ******"
echo "******************************************"
python3 torchchat.py generate --dtype ${DTYPE} --quant '{"linear:int8" : {"bitwidth": 8, "groupsize": 0}}' --checkpoint-path ${MODEL_PATH} --temperature 0

echo "******************************************"
echo "******** INT8 group-wise quantized *******"
echo "******************************************"
python3 torchchat.py generate --dtype ${DTYPE} --quant '{"linear:int8" : {"bitwidth": 8, "groupsize": 8}}' --checkpoint-path ${MODEL_PATH} --temperature 0

echo "******************************************"
echo "******** INT4 group-wise quantized *******"
echo "******************************************"

echo "INT4 should work on MacOS on x86, but cannot be tested"
echo "because nightlies are too old!"

# python3 torchchat.py generate --dtype ${DTYPE} --quant '{"linear:int4" : {"groupsize": 32}}' --checkpoint-path ${MODEL_PATH} --temperature 0

echo "tests complete for ${DTYPE}"
done

echo "tests complete for all dtypes!"
test-mps:
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
Expand All @@ -541,7 +466,7 @@ jobs:
set -x
# NS: Remove previous installation of torch first
# as this script does not isntall anything into conda env but rather as system dep
pip uninstall -y torch || true
pip3 uninstall -y torch || true
set -eou pipefail

echo "::group::Print machine info"
Expand All @@ -552,10 +477,10 @@ jobs:

echo "::group::Install requirements"
# Install requirements
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
ls -la
pwd
pip install -r requirements.txt
pip3 install -r requirements.txt
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
echo "::endgroup::"

Expand Down Expand Up @@ -616,10 +541,10 @@ jobs:
fi
- name: Install requirements
run: |
echo "Intalling pip packages"
pip install gguf
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
echo "Intalling pip3 packages"
pip3 install gguf
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'

git clone https://github.com/ggerganov/llama.cpp.git
Expand Down Expand Up @@ -650,7 +575,7 @@ jobs:
set -x
# NS: Remove previous installation of torch first
# as this script does not isntall anything into conda env but rather as system dep
pip uninstall -y torch || true
pip3 uninstall -y torch || true

set -eou pipefail

Expand All @@ -662,10 +587,10 @@ jobs:

echo "::group::Install requirements"
# Install requirements
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
ls -la
pwd
pip install -r requirements.txt
pip3 install -r requirements.txt
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
echo "::endgroup::"

Expand Down Expand Up @@ -721,9 +646,9 @@ jobs:
fi
- name: Install requirements
run: |
pip install gguf
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
pip3 install gguf
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
- name: Download GGUF
run: |
Expand Down Expand Up @@ -795,8 +720,8 @@ jobs:
fi
- name: Install requirements
run: |
echo "Intalling pip packages"
pip install -r requirements.txt
echo "Intalling pip3 packages"
pip3 install -r requirements.txt

export TORCHCHAT_ROOT=${PWD}
bash scripts/build_native.sh et
Expand Down Expand Up @@ -844,9 +769,9 @@ jobs:
echo "$(uname -a)"
- name: Install dependencies
run: |
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
pip list
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install -r requirements.txt
pip3 list

bash scripts/build_native.sh aoti

Expand Down Expand Up @@ -885,10 +810,10 @@ jobs:
fi
git submodule sync
git submodule update --init
echo "Intalling pip packages"
pip install cmake --upgrade
echo "Intalling pip3 packages"
pip3 install cmake --upgrade
cmake --version
pip install -r requirements.txt
pip3 install -r requirements.txt
export TORCHCHAT_ROOT=${PWD}
pushd /tmp
wget https://dl.google.com/android/repository/android-ndk-r26c-linux.zip
Expand Down
Loading