Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cuda version for Burn #58

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ check_jq() {
fi
}

get_torch_cuda_version() {
# Get the full CUDA version using nvcc
CUDA_VERSION=$(nvcc --version | grep "release" | awk '{print $6}')

# Remove dots from the CUDA version
CUDA_VERSION_NUMERIC=$(echo "${CUDA_VERSION}" | tr -d '.')

# Set TORCH_CUDA_VERSION variable
TORCH_CUDA_VERSION="cu${CUDA_VERSION_NUMERIC}"

# Return the dynamically set variable
echo "${TORCH_CUDA_VERSION}"
}

# Function to download models
download_models() {
echo -e "\nDownloading models..."
Expand Down Expand Up @@ -126,7 +140,7 @@ run_benchmarks() {
if [ "$DEVICE" == "cpu" ] || [ "$USE_NVIDIA" == true ]; then
# Run Rust benchmarks
if [ "$DEVICE" == "gpu" ] && [ "$PLATFORM" != "Darwin" ]; then
TORCH_CUDA_VERSION=cu117
TORCH_CUDA_VERSION=$(get_torch_cuda_version)
fi
cargo run --release --bin sample \
--manifest-path="$DIR/rust_bench/llama2-burn/Cargo.toml" \
Expand Down