ladderlore
လမ်းညွှန် တောင်းဆိုရန်
  • S3 သို့မဟုတ် IAM လို service အမည်ကို ရိုက်ထည့်ပါ။

သဘောတရား

Hosting large models on SageMaker

Large model inference containers, tensor parallelism, quantization and memory sizing.

ဒီသင်ခန်းစာကို မြန်မာဘာသာ မပြန်ရသေးလို့ အင်္ဂလိပ်လို ပြထားပါတယ်။

One GPU instance
Application
LMI container
GPU 1
GPU 2
  1. 1The application sends a prompt and reads tokens as they stream back.
  2. 2The container loads the model and splits it across the GPUs.
The container splits the model across the GPUs of one instance.
  • Tensor parallel degree

    What it does
    Splits each layer across GPUs
    Watch for
    Match the GPU count
  • Quantization

    What it does
    Stores weights in 8 or 4 bits
    Watch for
    Small quality loss
  • Instance memory

    What it does
    Holds weights and the attention cache
    Watch for
    70B at 16-bit is about 140 GB
  • Volume and timeouts

    What it does
    Disk, download and health check time
    Watch for
    Raise them for models over 30 or 40 GB
  • Streaming

    What it does
    Returns tokens as they come
    Watch for
    InvokeEndpointWithResponseStream
  • Inferentia and Trainium

    What it does
    AWS silicon for inference
    Watch for
    Compile with the Neuron SDK
Six settings that decide whether a large model runs.

1 / 2

  • Tensor parallel degree

    What it does
    Splits each layer across GPUs
    Watch for
    Match the GPU count
  • Quantization

    What it does
    Stores weights in 8 or 4 bits
    Watch for
    Small quality loss
  • Instance memory

    What it does
    Holds weights and the attention cache
    Watch for
    70B at 16-bit is about 140 GB

2 / 2

  • Volume and timeouts

    What it does
    Disk, download and health check time
    Watch for
    Raise them for models over 30 or 40 GB
  • Streaming

    What it does
    Returns tokens as they come
    Watch for
    InvokeEndpointWithResponseStream
  • Inferentia and Trainium

    What it does
    AWS silicon for inference
    Watch for
    Compile with the Neuron SDK
Six settings that decide whether a large model runs.

ဘာလဲ

A large language model does not fit one small GPU. SageMaker AI offers large model inference (LMI) containers that bundle an inference engine such as vLLM or TensorRT-LLM, with a Neuron build for AWS Inferentia and AWS Trainium. You deploy one from JumpStart or from your own model files, and the container serves requests, batches them continuously and can stream tokens back.

ဘာလဲ

Size memory first. Weights take about 2 bytes per parameter at 16-bit, so a 70-billion-parameter model needs about 140 GB for weights alone, plus room for the attention cache. An ml.g5.12xlarge has four 24 GB GPUs (96 GB), so that model does not fit unless you quantize it. Quantization stores weights in 8 or 4 bits, which cuts memory and cost for a small loss of quality. Tensor parallel degree splits each layer across GPUs in one instance. Set it to the number of GPUs you want to use.

ဘာလဲ

Large models start slowly. In the production variant, raise the volume size when the model is over 30 GB and the instance has no local disk, the model download timeout when it is over 40 GB, and the container startup health check timeout when the health check times out. Uncompressed files in S3 load faster than one model.tar.gz. For streaming, call InvokeEndpointWithResponseStream. Inferentia and Trainium instances (ml.inf2, ml.trn1) need a model compiled with the Neuron SDK.

မှတ်ထားရန်

  • LMI container: an inference engine, continuous batching and streaming, from JumpStart or your files.
  • Memory: about 2 bytes per parameter at 16-bit, plus the attention cache.
  • Quantization: 8 or 4 bit weights. Less memory and cost, small quality loss.
  • Tensor parallel degree: splits layers across the GPUs of one instance.

မှတ်ထားရန်

  • Large models need more disk, a longer download timeout and a longer health check timeout.
  • Inferentia and Trainium: compile for Neuron first.

စာမေးပွဲမှာ

  • “Model weights are larger than one GPU” points to a bigger instance with tensor parallelism, or quantization.
  • “Endpoint creation fails with a health check timeout on a large model” points to a longer container startup health check timeout.
  • “Show tokens to the user as they are generated” points to InvokeEndpointWithResponseStream.
  • “Lower the cost of serving an LLM on AWS silicon” points to Inferentia2 or Trainium with the Neuron SDK.