Showing posts with label llm. Show all posts
Showing posts with label llm. Show all posts

7/09/2025

Claude Code install shell script

 install Claude Code using this shell script


.

#!/bin/bash

# install-claude.sh
# Installs Node.js 18+, npm, and Claude Code CLI, handling common conflicts.

set -e

echo "=== [1/5] Removing conflicting Node.js and libnode-dev packages ==="
apt-get remove -y nodejs nodejs-doc libnode-dev || true

echo "=== [2/5] Cleaning up package manager ==="
apt-get autoremove -y
apt-get clean

echo "=== [3/5] Installing Node.js 18.x and npm ==="
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs

# Ensure npm is installed (should be bundled with Node.js 18.x)
if ! command -v npm &>/dev/null; then
echo "npm not found, installing..."
apt-get install -y npm
fi

echo "=== [4/5] Verifying Node.js and npm installation ==="
node --version
npm --version

echo "=== [5/5] Installing Claude Code CLI ==="
npm install -g @anthropic-ai/claude-code

echo "=== Claude Code CLI installed successfully! ==="
echo "Run 'claude' to get started."

..


Thank you!


12/30/2024

What is "GPU_MAX_HW_QUEUES"?

 GPU_MAX_HW_QUEUES controls the maximum number of hardware queues that can be used for GPU operations in ROCm/HIP environment (AMD GPUs).

Specifically:

  1. Each hardware queue can handle GPU operations (kernels) independently
  2. Default value is typically 8
  3. In your script, it's set to 4: export GPU_MAX_HW_QUEUES=4

This setting affects:

  • Parallel kernel execution
  • Memory transfers
  • Overall GPU utilization
  • Resource allocation

Lower values (like 4) can:

  • Reduce overhead
  • Improve memory usage
  • Lead to more predictable performance
  • Be better for large models like LLaMA 70B

Higher values can:

  • Allow more parallel operations
  • Potentially improve throughput for smaller models
  • Use more GPU resources

In your case, setting GPU_MAX_HW_QUEUES=4 is a conservative choice that helps manage memory and scheduling overhead when training the large LLaMA 70B model.

9/28/2024

How many GPUs do I need to train a LLM?



How many GPUs do I need to train a LLM?

This is a complicated question in general, but if we assume that you are using FSDP with 
FULL_SHARD, activation checkpointing, and DecoupledLionW, then a good rule of thumb is:

Your total cluster memory in GB should be larger than 12 * N (# billions of params).

E.g. To train a GPT-13B model which has ~13 billion params, 
have at least 12 * 13 = 156 GB of total memory across your GPUs. 
You can accomplish this with 4xA100-40GB, or 2xA100-80GB, etc.

If you run into OOM errors when using small device counts, 
reduce device_train_microbatch_size until it succeeds.

Keep in mind: even though training will work in these minimalist settings, 
you will get much better throughput_per_device 
if you use a larger cluster or devices with higher memory capacity, 
because this will enable you to use larger microbatch sizes.

7/08/2024

Unknown parameter in retrievalConfiguration.vectorSearchConfiguration: "overrideSearchType", must be one of: numberOfResults

 Error in AWS bedrock like:

Unknown parameter in retrievalConfiguration.vectorSearchConfiguration: "overrideSearchType", must be one of: numberOfResults


Solution 

Update boto3 sdk as latest one.

The parameters changed on 2024-03-27.

refer to here: https://awsapichanges.com/archive/changes/cd42c1-bedrock-agent-runtime.html


Thank you!