diff --git a/python/flexflow/serve/__init__.py b/python/flexflow/serve/__init__.py index 319cc9cfc4..e832bc7de4 100644 --- a/python/flexflow/serve/__init__.py +++ b/python/flexflow/serve/__init__.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .serve import LLM, SamplingConfig \ No newline at end of file +from .serve import LLM, SamplingConfig diff --git a/python/flexflow/serve/models/__init__.py b/python/flexflow/serve/models/__init__.py new file mode 100644 index 0000000000..3b4087203b --- /dev/null +++ b/python/flexflow/serve/models/__init__.py @@ -0,0 +1,17 @@ +# Copyright 2023 CMU, Facebook, LANL, MIT, NVIDIA, and Stanford (alphabetical) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from .llama import FlexFlowLLAMA +from .opt import FlexFlowOPT +from .falcon import FlexFlowFalcon diff --git a/python/flexflow/serve/models/falcon.py b/python/flexflow/serve/models/falcon.py new file mode 100644 index 0000000000..4bbecca56c --- /dev/null +++ b/python/flexflow/serve/models/falcon.py @@ -0,0 +1,19 @@ +# Copyright 2023 CMU, Facebook, LANL, MIT, NVIDIA, and Stanford (alphabetical) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from flexflow.core import * + +class FlexFlowFalcon: + def __init__(self): + pass diff --git a/python/flexflow/serve/models/llama.py b/python/flexflow/serve/models/llama.py new file mode 100644 index 0000000000..429309f1e8 --- /dev/null +++ b/python/flexflow/serve/models/llama.py @@ -0,0 +1,19 @@ +# Copyright 2023 CMU, Facebook, LANL, MIT, NVIDIA, and Stanford (alphabetical) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from flexflow.core import * + +class FlexFlowLLAMA: + def __init__(self): + pass diff --git a/python/flexflow/serve/models/opt.py b/python/flexflow/serve/models/opt.py new file mode 100644 index 0000000000..753d993b7d --- /dev/null +++ b/python/flexflow/serve/models/opt.py @@ -0,0 +1,19 @@ +# Copyright 2023 CMU, Facebook, LANL, MIT, NVIDIA, and Stanford (alphabetical) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from flexflow.core import * + +class FlexFlowOPT: + def __init__(self): + pass diff --git a/python/flexflow/serve/serve.py b/python/flexflow/serve/serve.py index 4a4f7f413b..417ea90e54 100644 --- a/python/flexflow/serve/serve.py +++ b/python/flexflow/serve/serve.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from flexflow.core import * +from flexflow.serve.models import FlexFlowLLAMA, FlexFlowOPT, FlexFlowFalcon from transformers import AutoConfig import sys @@ -26,16 +26,14 @@ class LLM: def __init__(self, model_name, data_type="half"): self.model_name = model_name self.supported_models = { - "LlamaForCausalLM": 'placeholder', - "LLaMAForCausalLM": 'placeholder', - "OPTForCausalLM": 'placeholder', - "RWForCausalLM": 'placeholder' # falcon + "LlamaForCausalLM": FlexFlowLLAMA, + "LLaMAForCausalLM": FlexFlowLLAMA, + "OPTForCausalLM": FlexFlowOPT, + "RWForCausalLM": FlexFlowFalcon # falcon } self.model_type = self.__get_ff_model_type(model_name) self.data_type = data_type self.default_config = SamplingConfig() - - self.ffconfig = FFConfig() def __get_ff_model_type(self, model_name): hf_config = AutoConfig.from_pretrained(model_name)