Brando's Ultimate Utils for Science, Machine Learning, and AI
Project description
Ultimate-utils
Ulitmate-utils (or uutils) is collection of useful code that Brando has collected through the years that has been useful accross his projects. Mainly for machine learning and programming languages tasks.
Installing Ultimate-utils
WARNING: YOU HAVE TO INSTALL PYTORCH ON YOUR OWN (WITH CUDA IF YOU NEED A GPU)
Installation [Dev]
To install with code do:
conda create -n uutils python=3.11 -y
conda activate uutils
# conda remove --all --name uutils
pip install -e ~/ultimate-utils
To install with venv do:
deactivate
mkdir ~/.virtualenvs
ls ~/.virtualenvs
python3.11 -m venv ~/.virtualenvs/uutils
# python3 -m venv ~/.virtualenvs/uutils
source ~/.virtualenvs/uutils/bin/activate
pip install --upgrade pip
which python
pip install -e ~/ultimate-utils
To test (any) pytorch do:
python -c "import uutils; uutils.torch_uu.gpu_test_torch_any_device()"
Install vLLM
To install vllm:
# - Recommended vllm (it works with lora adapters)
# install all deps first
pip install -e ~/ultimate-utils
# right version for vllm lora
pip install torch==2.4.0
pip install vllm==0.5.5
# make sure the local lib is installed
pip install -e ~/ultimate-utils --no-deps
# [Optional] make sure you really have the right torch and vllm version
pip list | grep vllm
pip list | grep torch
pip install torch==2.4.0
pip install vllm==0.5.5
# test vllm lora (for unsloth to work since merge save doesn't seem to work)
python ~/ultimate-utils/experiments/experiments/2024/september/vllm_lora_test.py
# save env now (given how fragile it can be if it works)
pip freeze > ~/ultimate-utils/requirements.txt
# # - Install vllm
# # FAILED: bellow failed to install vllm with uutils first installing it with default setup.py then
# # pip install --upgrade pip
# # pip install torch==2.2.1
# # pip install vllm==0.4.1
# # - Installed vllm on skampere1
# pip install --upgrade pip
# pip uninstall torchvision vllm vllm-flash-attn flash-attn xformers
# pip install torch==2.2.1 vllm==0.4.1
# # fails install
# # pip install flash-attn==2.6.3
Pushing to pypi
For full details see
~/ultimate-utils/tutorials_for_myself/pushing_to_pypi/README.md
For quick push do:
cd ~/ultimate-utils/
rm -rf build
rm -rf dist
cd ~/ultimate-utils/
python setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*
then:
cd ~/ultimate-utils/
rm -rf build
rm -rf dist
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ultimate_utils-0.8.0.tar.gz.
File metadata
- Download URL: ultimate_utils-0.8.0.tar.gz
- Upload date:
- Size: 418.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4571f85118131ba656ff58dc9ecd8d939806e4bd8aa6093260bef2acaa137cb
|
|
| MD5 |
f4a7e2bcb8bf9dda7c8c828777fc68ef
|
|
| BLAKE2b-256 |
7315218d9b3f8ecb5ac6246c194deb01a0ce323fdddfe29a3b2828be150b441c
|
File details
Details for the file ultimate_utils-0.8.0-py3-none-any.whl.
File metadata
- Download URL: ultimate_utils-0.8.0-py3-none-any.whl
- Upload date:
- Size: 506.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b0a320fb0d19dc7423398466ffe76269e78cbce3181425774444efb202bd9c9
|
|
| MD5 |
ba43e2386cf296f0976d6d0855536645
|
|
| BLAKE2b-256 |
8dc7a7d606d1d276398b98d5b97df3e7ddf74b9a53cb7aca94e5fb68287946a6
|