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.1.tar.gz (647.2 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.1-py3-none-any.whl (581.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ultimate_utils-0.10.1.tar.gz
Algorithm Hash digest
SHA256 0233a635dae4ce2c0a216051ad57556cefe27effccd5ff1ad7681c8d1bb93da3
MD5 d5189a19340816aa5afc5c9854b47618
BLAKE2b-256 5978a6e4f92939d64b1c4cae1f01faefa23e1daabcc8ba16b24157ac26049e62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ultimate_utils-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b35f06a3eb7352dbd55e754adbb3039fac3ca69d338df892b8c094995630d271
MD5 9aa8cd9e0b7a6de79d80328b8f1d5689
BLAKE2b-256 48d8879404c3108d184b5d90d140a0ec295cbd7a035e7be2804f1616a40c0b81

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