docstr: A simple test to check if the model conversion has been done correctly by checking on the
  memory footprint of the converted model and the class type of the linear layers of the converted models
docstr_tok: ["A","simple","test","to","check","if","the","model","conversion","has","been","done","correctly","by","checking","on","the","memory","footprint","of","the","converted","model","and","the","class","type","of","the","linear","layers","of","the","converted","models"]
code: def test_linear_are_8bit(self):
      r"""
      A simple test to check if the model conversion has been done correctly by checking on the
      memory footprint of the converted model and the class type of the linear layers of the converted models
      """
      from transformers import T5PreTrainedModel
  
      self.model_fp16.get_memory_footprint()
      self.model_8bit.get_memory_footprint()
  
      for name, module in self.model_8bit.named_modules():
          if isinstance(module, torch.nn.Linear):
              if (
                  name
                  not in ["lm_head"]
                  + T5PreTrainedModel._keep_in_fp32_modules
              ):
                  self.assertTrue(module.weight.dtype == torch.int8)
  
imports: import gc
  import importlib.metadata
  import tempfile
  import unittest
  from packaging import version
  from transformers import AutoConfig, AutoModel, AutoModelForCausalLM, AutoModelForSeq2SeqLM, AutoModelForSequenceClassification, AutoTokenizer, BitsAndBytesConfig, pipeline
  from transformers.testing_utils import is_accelerate_available, is_torch_available, require_accelerate, require_bitsandbytes, require_torch, require_torch_gpu, require_torch_multi_gpu, slow
label_desc: Use image node_id 8 for calling the MixedInt8Test obj's underlying member method code with example usage: obj.test_linear_are_8bit() without return types