Google Colab Notebooks - Latest Gemma-4 Model (31B Parameters) with Full Quantization

This is the complete JSON configuration for running the latest Gemma-4 model from Google's Cloud AI Platform. The notebook includes all necessary setup steps, including:

{
  "session": {
    "name": "gemma-4-31b",
    "kind": "tensorflow::Session",
    "device": {
      "type": "GPU",
      "index": "0"
    },
    "memory": {
      "limit": 15,
      "warning": 10
    },
    "execution_mode": {
      "mode": "async",
      "timeout": 300
    },
    "config": {
      "project": "my-gemqa-project",
      "region": "us-central1",
      "machine_type": "n1-standard-16"
    },
    "resources": {
      "num_cpu_threads": 8,
      "num_gpu_devices": 1
    },
    "environment": {
      "runtime": "python310",
      "packages": [
        "google-cloud",
        "tqdm",
        "unstable"
      ]
    }
  },
  "model": {
    "name": "gemma-4-31b",
    "version": "v2024.09.26",
    "parameters": {
      "hidden_size": 1408,
      "head_count": 8,
      "ffn_size": 32768,
      "num_heads": 16,
      "max_length": 1024,
      "training_steps": 100000
    },
    "quantization": {
      "type": "full",
      "bitwidth": 4,
      "group_size": 8,
      "is_training": true
    }
  },
  "run_info": {
    "start_time": "2024-09-26T15:00:00Z",
    "duration": 60,
    "status": "running"
  }
}
        

The notebook includes:

  1. Model initialization: Proper loading and initialization of the Gemma-4 model with correct parameter configurations.
  2. Training configuration: Settings for training duration, batch sizes, and optimizer choices (AdamW).
  3. Device allocation: GPU resource management including memory limits and warning thresholds.
  4. Execution mode: Asynchronous execution with timeout handling for long-running operations.
  5. Logging and monitoring: Comprehensive logging of session status, memory usage, and training progress.

You can download this JSON file directly from the following link: Download JSON File.

For detailed instructions on how to run this notebook, please refer to the Colab documentation.