| #!/usr/bin/env bash |
| |
| |
| |
| set -euo pipefail |
|
|
| echo "=== SparseVLM Vast AI Setup ===" |
| echo "GPU: $(nvidia-smi --query-gpu=name,memory.total --format=csv,noheader 2>/dev/null || echo 'no GPU detected')" |
|
|
| |
| apt-get update -qq && apt-get install -y -qq git wget unzip |
|
|
| |
| pip install --quiet --upgrade pip |
| pip install --quiet \ |
| "torch>=2.1.0" \ |
| "torchvision" \ |
| "transformers>=4.40.0" \ |
| "triton>=2.1.0" \ |
| "numpy>=1.24.0" \ |
| "accelerate" \ |
| "Pillow" \ |
| "huggingface_hub" \ |
| "pytest" \ |
| "requests" |
|
|
| |
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" |
| pip install --quiet -e "$SCRIPT_DIR" |
|
|
| echo "" |
| echo "=== Verifying install ===" |
| python -c " |
| import torch, triton, transformers, sparsevlm, kernels |
| print(f'torch {torch.__version__}') |
| print(f'triton {triton.__version__}') |
| print(f'transformers {transformers.__version__}') |
| print(f'sparsevlm {sparsevlm.__version__}') |
| print(f'CUDA avail {torch.cuda.is_available()}') |
| if torch.cuda.is_available(): |
| print(f'GPU {torch.cuda.get_device_name(0)}') |
| print(f'VRAM {torch.cuda.get_device_properties(0).total_memory/1e9:.1f} GB') |
| " |
|
|
| echo "" |
| echo "=== Setup complete. Next steps ===" |
| echo " Layer-1 kernel benchmark (no model download): python benchmark/bench_layer1.py" |
| echo " Unit tests: pytest tests/" |
| echo " Full e2e + benchmark: python test_e2e.py" |
|
|