Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ultimate_utils-0.10.0.tar.gz (644.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ultimate_utils-0.10.0-py3-none-any.whl (578.2 kB view details)

Uploaded Python 3

File details

Details for the file ultimate_utils-0.10.0.tar.gz.

File metadata

  • Download URL: ultimate_utils-0.10.0.tar.gz
  • Upload date:
  • Size: 644.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for ultimate_utils-0.10.0.tar.gz
Algorithm Hash digest
SHA256 a1cd6e186718304295e63c402326499e09f10b4caf94d1b28b8e0af973b6f608
MD5 7ec4660619cf4c03ab83afa5d506cc95
BLAKE2b-256 6cbd500deb2ae0243fd5c1367c2ee6784a578786928d2f57fa10093424814c19

See more details on using hashes here.

File details

Details for the file ultimate_utils-0.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ultimate_utils-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90d91c536605861e82d46807257409385526c8f71d3bc78514359bb48067f966
MD5 d9610d3528c1f303baff9de7142ce598
BLAKE2b-256 4dce127af54745cd12f8a38f10f1422c86344abca7e58eedceaf20230b6f72a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page