added a model check for use_triton in deepspeed
diff --git a/deepspeed/module_inject/containers/base.py b/deepspeed/module_inject/containers/base.py
index 62b78a091fd5..4498bfba8f1f 100644
--- a/deepspeed/module_inject/containers/base.py
+++ b/deepspeed/module_inject/containers/base.py
@@ -120,6 +120,10 @@ def create_ds_model_config(self):
             triton_autotune=self.config.triton_autotune)
 
         if self.use_triton and deepspeed.HAS_TRITON:
+            from .bert import DS_BERTContainer
+            if not isinstance(self, DS_BERTContainer):
+                raise NotImplementedError("Triton kernels are only for BERT-like models yet")
+
             if not self.config.triton_autotune:
                 from deepspeed.ops.transformer.inference.triton.matmul_ext import fp16_matmul
                 fp16_matmul.skip_autotune()

This PR is a follow-up to https://github.com/microsoft/DeepSpeed/issues/4231.
It adds proper error messages when triton kernel is enabled for non-BERT models.