-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathsetup_env.sh
More file actions
executable file
·86 lines (74 loc) · 2.38 KB
/
setup_env.sh
File metadata and controls
executable file
·86 lines (74 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# MLPerf Storage Environment Setup
# Supports both uv and traditional venv/pip
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
S3DLIO_PATH="${SCRIPT_DIR}/../s3dlio"
echo "=========================================="
echo "MLPerf Storage Environment Setup"
echo "=========================================="
# Detect if uv is available
if command -v uv &> /dev/null; then
echo "✓ Using uv (recommended)"
USE_UV=1
else
echo "ℹ Using traditional venv/pip"
USE_UV=0
fi
# Create and activate virtual environment
if [ $USE_UV -eq 1 ]; then
# uv workflow
if [ ! -d ".venv" ]; then
echo "Creating uv virtual environment..."
uv venv
fi
source .venv/bin/activate
# Install s3dlio from local path first
if [ -d "$S3DLIO_PATH" ]; then
echo "Installing s3dlio from local path: $S3DLIO_PATH"
uv pip install -e "$S3DLIO_PATH"
else
echo "WARNING: s3dlio not found at $S3DLIO_PATH"
echo "Installing s3dlio from PyPI instead..."
uv pip install s3dlio
fi
# Install mlpstorage with dependencies
echo "Installing mlpstorage and dependencies..."
uv pip install -e .
else
# Traditional venv/pip workflow
if [ ! -d ".venv" ]; then
echo "Creating Python virtual environment..."
python3 -m venv .venv
fi
source .venv/bin/activate
# Upgrade pip
echo "Upgrading pip..."
python -m pip install --upgrade pip
# Install s3dlio from local path first
if [ -d "$S3DLIO_PATH" ]; then
echo "Installing s3dlio from local path: $S3DLIO_PATH"
pip install -e "$S3DLIO_PATH"
else
echo "WARNING: s3dlio not found at $S3DLIO_PATH"
echo "Installing s3dlio from PyPI instead..."
pip install s3dlio
fi
# Install mlpstorage with dependencies
echo "Installing mlpstorage and dependencies..."
pip install -e .
fi
echo ""
echo "=========================================="
echo "✓ Setup complete!"
echo "=========================================="
echo ""
echo "Next steps:"
echo " 1. Activate environment: source .venv/bin/activate"
echo " 2. Run benchmark: mlpstorage training run --model unet3d --accelerator-type h100 ..."
echo ""
echo "To use s3dlio backend, add to your DLIO config:"
echo " storage:"
echo " storage_type: s3dlio"
echo " storage_root: s3://bucket/prefix"
echo ""