code: def test_enable_gradient_checkpointing(tmpdir, caplog):
      """Test that gradient checkpointing is enabled when specified in the config and that it does not cause an error
      when the model does not have support for gradient checkpointing.
      """
      input_features = [text_feature()]
      output_features = [
          category_feature(
              decoder={"vocab_size": 2}, reduce_input="sum"
          )
      ]
  
      csv_filename = os.path.join(tmpdir, "training.csv")
      data_csv = generate_data(
          input_features, output_features, csv_filename
      )
      val_csv = shutil.copyfile(
          data_csv, os.path.join(tmpdir, "validation.csv")
      )
      test_csv = shutil.copyfile(
          data_csv, os.path.join(tmpdir, "test.csv")
      )
  
      config = {
          INPUT_FEATURES: input_features,
          OUTPUT_FEATURES: output_features,
          "combiner": {"type": "concat", "output_size": 14},
          TRAINER: {
              "train_steps": 2,
              BATCH_SIZE: 8,
              "enable_gradient_checkpointing": True,
          },
      }
  
      model = LudwigModel(
          config, backend=LocalTestBackend(), logging_level=logging.INFO
      )
      assert model.config_obj.trainer.enable_gradient_checkpointing
  
      model.train(
          training_set=data_csv,
          validation_set=val_csv,
          test_set=test_csv,
          output_directory=tmpdir,
      )
  
      # Check that the warning is emitted when the model does not support gradient checkpointing
      # but does not prevent training from starting.
      assert (
          "Gradient checkpointing is currently only supported for model_type: llm. Skipping..."
          in caplog.text
      )
  
imports: import logging
  import os
  import shutil
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import torch
  from packaging.version import parse
  from ludwig.api import LudwigModel
  from ludwig.callbacks import Callback
  from ludwig.constants import BATCH_SIZE, EFFECTIVE_BATCH_SIZE, EPOCHS, EVAL_BATCH_SIZE, INPUT_FEATURES, MAX_BATCH_SIZE_DATASET_FRACTION, OUTPUT_FEATURES, TRAINER
  from ludwig.distributed import init_dist_strategy
  from tests.integration_tests.utils import binary_feature, category_feature, generate_data, LocalTestBackend, number_feature, RAY_BACKEND_CONFIG, sequence_feature, text_feature, vector_feature
label_desc: Use image node_id 9 for calling a global function with example usage: test_enable_gradient_checkpointing(tmpdir, caplog) without return types